@@ -32,6 +32,7 @@ import (
3232 "github.com/devfile/devworkspace-operator/pkg/library/flatten"
3333 "github.com/devfile/devworkspace-operator/pkg/library/lifecycle"
3434 "github.com/devfile/devworkspace-operator/pkg/library/overrides"
35+ dwResources "github.com/devfile/devworkspace-operator/pkg/library/resources"
3536 corev1 "k8s.io/api/core/v1"
3637)
3738
@@ -68,7 +69,7 @@ func GetKubeContainersFromDevfile(
6869 if component .Container == nil {
6970 continue
7071 }
71- k8sContainer , err := convertContainerToK8s (component , securityContext , pullPolicy , defaultResources , resourceCaps )
72+ k8sContainer , err := convertContainerToK8s (component , securityContext , pullPolicy , defaultResources )
7273 if err != nil {
7374 return nil , err
7475 }
@@ -82,6 +83,11 @@ func GetKubeContainersFromDevfile(
8283 }
8384 k8sContainer = patchedContainer
8485 }
86+
87+ // applying caps only after overrides
88+ resources := dwResources .ApplyCaps (& k8sContainer .Resources , resourceCaps )
89+ k8sContainer .Resources = * resources
90+
8591 podAdditions .Containers = append (podAdditions .Containers , * k8sContainer )
8692 }
8793
@@ -94,7 +100,7 @@ func GetKubeContainersFromDevfile(
94100 }
95101
96102 for _ , initComponent := range initComponents {
97- k8sContainer , err := convertContainerToK8s (initComponent , securityContext , pullPolicy , defaultResources , nil )
103+ k8sContainer , err := convertContainerToK8s (initComponent , securityContext , pullPolicy , defaultResources )
98104 if err != nil {
99105 return nil , err
100106 }
0 commit comments