Skip to content

Commit

Permalink
Update NodeMaintenance API
Browse files Browse the repository at this point in the history
- remove un-needed protobuf markers
- remove unsupported strategic merge related markes
  as they are not supported for CRDs [1]
- add new field in spec: AdditionalRequestors to be used
  to allow multiple entities to share the same NodeMaintenance
  object.

[1] kubernetes/kubectl#1280

Signed-off-by: adrianc <[email protected]>
  • Loading branch information
adrianchiris committed Aug 20, 2024
1 parent f527ef8 commit fa35beb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
11 changes: 8 additions & 3 deletions api/v1alpha1/nodemaintenance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ type NodeMaintenanceSpec struct {
// +kubebuilder:validation:MinLength=2
RequestorID string `json:"requestorID"`

// AdditionalRequestors is a set of additional requestor IDs which are using the same NodeMaintenance
// request. addition or removal of requiestor IDs to this list MUST be made with update operation (and retry on failure)
// which will replace the entire list.
// +kubebuilder:validation:Optional
// +listType=set
AdditionalRequestors []string `json:"additionalRequestors,omitempty"`

// NodeName is The name of the node that maintenance operation will be performed on
// creation fails if node obj does not exist (webhook)
NodeName string `json:"nodeName"`
Expand Down Expand Up @@ -143,11 +150,9 @@ type PodEvictionFiterEntry struct {
type NodeMaintenanceStatus struct {
// Conditions represents observations of NodeMaintenance current state
// +kubebuilder:validation:Optional
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchMergeKey:"type" patchStrategy:"merge" protobuf:"bytes,1,rep,name=conditions"`
Conditions []metav1.Condition `json:"conditions,omitempty"`

// WaitForCompletion is the list of namespaced named pods that we wait to complete
WaitForCompletion []string `json:"waitForCompletion,omitempty"`
Expand Down
9 changes: 9 additions & 0 deletions config/crd/bases/maintenance.nvidia.com_nodemaintenances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ spec:
spec:
description: NodeMaintenanceSpec defines the desired state of NodeMaintenance
properties:
additionalRequestors:
description: |-
AdditionalRequestors is a set of additional requestor IDs which are using the same NodeMaintenance
request. addition or removal of requiestor IDs to this list MUST be made with update operation (and retry on failure)
which will replace the entire list.
items:
type: string
type: array
x-kubernetes-list-type: set
cordon:
default: true
description: Cordon if set, marks node as unschedulable during maintenance
Expand Down

0 comments on commit fa35beb

Please sign in to comment.