Skip to content

Devfile validation does not verify that resource requests are less than resource limits. #672

Closed
devfile/library
#124
@amisevsk

Description

@amisevsk

/kind bug

Which area this bug is related to?

/area library

What versions of software are you using?

Operating System:
N/A
Go Pkg Version:
N/A

Bug Summary

In a pod, having either a CPU or memory request that is greater than the specified limit is an invalid configuration. The validation package in devfile/api does not detect this error, so it's on downstream users to either detect it or submit an invalid object to the cluster.

To Reproduce:
The devfile below passes validation:

schemaVersion: 2.0.0
metadata:
  name: sample-devfile
components:
  - name: web-terminal
    container:
      image: quay.io/wto/web-terminal-tooling:latest
      memoryLimit: 512Mi
      memoryRequest: 1024Mi
      command:
        - "tail"
        - "-f"
        - "/dev/null"

Expected behavior

Validation should fail with a message specifying the discrepancy.

Additional context

Originally reported in eclipse-che/che#20751

Metadata

Metadata

Assignees

Labels

area/apiEnhancement or issue related to the api/devfile specificationarea/libraryCommon devfile library for interacting with devfileskind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions