Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions api/apps/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,17 @@ type PersistentVolumeClaim struct {
//
// When creating the NIMService pods, it adds a name (`DNS_LABEL` format) to it
// that uniquely identifies the DRA resource.
// +kubebuilder:validation:XValidation:rule="has(self.resourceClaimName) != has(self.resourceClaimTemplateName)",message="exactly one of spec.resourceClaimName and spec.resourceClaimTemplateName must be set."
type DRAResource struct {
// ResourceClaimName is the name of a ResourceClaim object in the same
// namespace as the NIMService.
//
// Exactly one of ResourceClaimName and ResourceClaimTemplateName must
// be set.
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*`
ResourceClaimName *string `json:"resourceClaimName,omitempty"`

// ResourceClaimTemplateName is the name of a ResourceClaimTemplate
Expand All @@ -261,12 +266,18 @@ type DRAResource struct {
//
// Exactly one of ResourceClaimName and ResourceClaimTemplateName must
// be set.
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*`
ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"`

// Requests is the list of requests in the referenced ResourceClaim/ResourceClaimTemplate
// to be made available to the model container of the NIMService pods.
//
// If empty, everything from the claim is made available, otherwise
// only the result of this subset of requests.
//
// +kubebuilder:validation:items:MinLength=1
Requests []string `json:"requests,omitempty"`
}
11 changes: 11 additions & 0 deletions bundle/manifests/apps.nvidia.com_nimpipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ spec:
If empty, everything from the claim is made available, otherwise
only the result of this subset of requests.
items:
minLength: 1
type: string
type: array
resourceClaimName:
Expand All @@ -129,6 +130,9 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
resourceClaimTemplateName:
description: |-
Expand All @@ -140,8 +144,15 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
type: object
x-kubernetes-validations:
- message: exactly one of spec.resourceClaimName and spec.resourceClaimTemplateName
must be set.
rule: has(self.resourceClaimName) != has(self.resourceClaimTemplateName)
type: array
env:
items:
Expand Down
11 changes: 11 additions & 0 deletions bundle/manifests/apps.nvidia.com_nimservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ spec:
If empty, everything from the claim is made available, otherwise
only the result of this subset of requests.
items:
minLength: 1
type: string
type: array
resourceClaimName:
Expand All @@ -90,6 +91,9 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
resourceClaimTemplateName:
description: |-
Expand All @@ -101,8 +105,15 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
type: object
x-kubernetes-validations:
- message: exactly one of spec.resourceClaimName and spec.resourceClaimTemplateName
must be set.
rule: has(self.resourceClaimName) != has(self.resourceClaimTemplateName)
type: array
env:
items:
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/apps.nvidia.com_nimpipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ spec:
If empty, everything from the claim is made available, otherwise
only the result of this subset of requests.
items:
minLength: 1
type: string
type: array
resourceClaimName:
Expand All @@ -129,6 +130,9 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
resourceClaimTemplateName:
description: |-
Expand All @@ -140,8 +144,15 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
type: object
x-kubernetes-validations:
- message: exactly one of spec.resourceClaimName and spec.resourceClaimTemplateName
must be set.
rule: has(self.resourceClaimName) != has(self.resourceClaimTemplateName)
type: array
env:
items:
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/apps.nvidia.com_nimservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ spec:
If empty, everything from the claim is made available, otherwise
only the result of this subset of requests.
items:
minLength: 1
type: string
type: array
resourceClaimName:
Expand All @@ -90,6 +91,9 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
resourceClaimTemplateName:
description: |-
Expand All @@ -101,8 +105,15 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
type: object
x-kubernetes-validations:
- message: exactly one of spec.resourceClaimName and spec.resourceClaimTemplateName
must be set.
rule: has(self.resourceClaimName) != has(self.resourceClaimTemplateName)
type: array
env:
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ spec:
If empty, everything from the claim is made available, otherwise
only the result of this subset of requests.
items:
minLength: 1
type: string
type: array
resourceClaimName:
Expand All @@ -129,6 +130,9 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
resourceClaimTemplateName:
description: |-
Expand All @@ -140,8 +144,15 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
type: object
x-kubernetes-validations:
- message: exactly one of spec.resourceClaimName and spec.resourceClaimTemplateName
must be set.
rule: has(self.resourceClaimName) != has(self.resourceClaimTemplateName)
type: array
env:
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ spec:
If empty, everything from the claim is made available, otherwise
only the result of this subset of requests.
items:
minLength: 1
type: string
type: array
resourceClaimName:
Expand All @@ -90,6 +91,9 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
resourceClaimTemplateName:
description: |-
Expand All @@ -101,8 +105,15 @@ spec:

Exactly one of ResourceClaimName and ResourceClaimTemplateName must
be set.
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
type: string
type: object
x-kubernetes-validations:
- message: exactly one of spec.resourceClaimName and spec.resourceClaimTemplateName
must be set.
rule: has(self.resourceClaimName) != has(self.resourceClaimTemplateName)
type: array
env:
items:
Expand Down
Loading