diff --git a/deploy/crd.yaml b/deploy/crd.yaml index c93f0c4..f0fefd4 100644 --- a/deploy/crd.yaml +++ b/deploy/crd.yaml @@ -133,6 +133,7 @@ spec: x-kubernetes-int-or-string: true description: ResourceList is a set of (resource name, quantity) pairs. + nullable: true type: object type: object required: @@ -155,6 +156,7 @@ spec: x-kubernetes-int-or-string: true description: ResourceList is a set of (resource name, quantity) pairs. + nullable: true type: object type: object throttlerName: @@ -190,6 +192,7 @@ spec: x-kubernetes-int-or-string: true description: ResourceList is a set of (resource name, quantity) pairs. + nullable: true type: object type: object required: @@ -206,6 +209,7 @@ spec: resourceRequests: additionalProperties: type: boolean + nullable: true type: object type: object used: @@ -224,6 +228,7 @@ spec: x-kubernetes-int-or-string: true description: ResourceList is a set of (resource name, quantity) pairs. + nullable: true type: object type: object type: object @@ -421,6 +426,7 @@ spec: x-kubernetes-int-or-string: true description: ResourceList is a set of (resource name, quantity) pairs. + nullable: true type: object type: object required: @@ -443,6 +449,7 @@ spec: x-kubernetes-int-or-string: true description: ResourceList is a set of (resource name, quantity) pairs. + nullable: true type: object type: object throttlerName: @@ -478,6 +485,7 @@ spec: x-kubernetes-int-or-string: true description: ResourceList is a set of (resource name, quantity) pairs. + nullable: true type: object type: object required: @@ -494,6 +502,7 @@ spec: resourceRequests: additionalProperties: type: boolean + nullable: true type: object type: object used: @@ -512,6 +521,7 @@ spec: x-kubernetes-int-or-string: true description: ResourceList is a set of (resource name, quantity) pairs. + nullable: true type: object type: object type: object diff --git a/pkg/apis/schedule/v1alpha1/resource_amount.go b/pkg/apis/schedule/v1alpha1/resource_amount.go index 706bf19..195d4d4 100644 --- a/pkg/apis/schedule/v1alpha1/resource_amount.go +++ b/pkg/apis/schedule/v1alpha1/resource_amount.go @@ -26,8 +26,10 @@ import ( ) type ResourceAmount struct { - ResourceCounts *ResourceCounts `json:"resourceCounts,omitempty"` - ResourceRequests corev1.ResourceList `json:"resourceRequests"` + ResourceCounts *ResourceCounts `json:"resourceCounts,omitempty"` + + //+nullable + ResourceRequests corev1.ResourceList `json:"resourceRequests,omitempty"` } type ResourceCounts struct { @@ -35,8 +37,10 @@ type ResourceCounts struct { } type IsResourceAmountThrottled struct { - ResourceCounts IsResourceCountThrottled `json:"resourceCounts"` - ResourceRequests map[corev1.ResourceName]bool `json:"resourceRequests"` + ResourceCounts IsResourceCountThrottled `json:"resourceCounts"` + + //+nullable + ResourceRequests map[corev1.ResourceName]bool `json:"resourceRequests,omitempty"` } func (t IsResourceAmountThrottled) IsThrottledFor(pod *corev1.Pod) bool {