From c80b09ee94a5f9912a94242da3309fb70a53fedf Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Thu, 23 Jan 2025 21:26:13 -0500 Subject: [PATCH 1/9] addition of v1 mcn type & test --- .../MachineConfigNodes.yaml | 248 +++++++++++++++++ .../v1/types_machineconfignode.go | 263 ++++++++++++++++++ 2 files changed, 511 insertions(+) create mode 100644 machineconfiguration/v1/tests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml create mode 100644 machineconfiguration/v1/types_machineconfignode.go diff --git a/machineconfiguration/v1/tests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml b/machineconfiguration/v1/tests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml new file mode 100644 index 00000000000..b2f7c6272a9 --- /dev/null +++ b/machineconfiguration/v1/tests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml @@ -0,0 +1,248 @@ +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this +name: "MachineConfigNode" +crdName: machineconfignodes.machineconfiguration.openshift.io +featureGates: MachineConfigNodes +tests: + onCreate: + - name: Should be able to create a minimal MachineConfigNode + initial: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + expected: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + - name: Node name must match the Object name. + initial: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: barfoo + pool: + name: worker + configVersion: + desired: rendered-worker-abc + expectedError: "Invalid value: \"object\": spec.node.name should match metadata.name" + - name: Pool is required. + initial: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: barfoo + configVersion: + desired: rendered-worker-abc + expectedError: "spec.pool: Required value, : Invalid value: \"null\"" + - name: Node is required. + initial: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + pool: + name: barfoo + configVersion: + desired: rendered-worker-abc + expectedError: "spec.node: Required value, : Invalid value: \"null\"" + - name: ConfigVersion is required. + initial: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + pool: + name: barfoo + node: + name: foobar + expectedError: "spec.configVersion: Required value, : Invalid value: \"null\"" + - name: Should be able to create a MachineConfigNode with a PinnedImageSet + initial: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + expected: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + onUpdate: + - name: PinnedImageSet desired generation must be greater than or equal to the current generation + initial: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + status: + observedGeneration: 1 + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + currentGeneration: 1 + desiredGeneration: 1 + updated: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + status: + observedGeneration: 1 + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + currentGeneration: 2 + desiredGeneration: 1 + expectedStatusError: "Invalid value: \"object\": desired generation must be greater than or equal to the current generation" + - name: PinnedImageSet desired generation must be greater than last failed generation + initial: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + status: + observedGeneration: 4 + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + currentGeneration: 2 + desiredGeneration: 2 + lastFailedGeneration: 1 + updated: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + status: + observedGeneration: 5 + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + currentGeneration: 3 + desiredGeneration: 3 + lastFailedGeneration: 4 + expectedStatusError: "Invalid value: \"object\": desired generation must be greater than last failed generation" + - name: PinnedImageSet desired generation must be set if last failed generation is set + initial: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + status: + observedGeneration: 4 + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + updated: | + apiVersion: machineconfiguration.openshift.io/v1alpha1 + kind: MachineConfigNode + metadata: + name: foobar + spec: + node: + name: foobar + pool: + name: worker + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + status: + observedGeneration: 5 + configVersion: + desired: rendered-worker-abc + pinnedImageSets: + - name: test-pinned-image-set + lastFailedGeneration: 2 + expectedStatusError: "Invalid value: \"object\": desired generation must be defined if last failed generation is defined" \ No newline at end of file diff --git a/machineconfiguration/v1/types_machineconfignode.go b/machineconfiguration/v1/types_machineconfignode.go new file mode 100644 index 00000000000..f36f7d94dc9 --- /dev/null +++ b/machineconfiguration/v1/types_machineconfignode.go @@ -0,0 +1,263 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=machineconfignodes,scope=Cluster +// +kubebuilder:subresource:status +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/XXXX //TODO: Update once PR is opened +// +openshift:file-pattern=cvoRunLevel=0000_80,operatorName=machine-config,operatorOrdering=01 +// +openshift:enable:FeatureGate=MachineConfigNodes +// +kubebuilder:printcolumn:name="PoolName",type="string",JSONPath=.spec.pool.name,priority=0 +// +kubebuilder:printcolumn:name="DesiredConfig",type="string",JSONPath=.spec.configVersion.desired,priority=0 +// +kubebuilder:printcolumn:name="CurrentConfig",type="string",JSONPath=.status.configVersion.current,priority=0 +// +kubebuilder:printcolumn:name="Updated",type="string",JSONPath=.status.conditions[?(@.type=="Updated")].status,priority=0 +// +kubebuilder:printcolumn:name="UpdatePrepared",type="string",JSONPath=.status.conditions[?(@.type=="UpdatePrepared")].status,priority=1 +// +kubebuilder:printcolumn:name="UpdateExecuted",type="string",JSONPath=.status.conditions[?(@.type=="UpdateExecuted")].status,priority=1 +// +kubebuilder:printcolumn:name="UpdatePostActionComplete",type="string",JSONPath=.status.conditions[?(@.type=="UpdatePostActionComplete")].status,priority=1 +// +kubebuilder:printcolumn:name="UpdateComplete",type="string",JSONPath=.status.conditions[?(@.type=="UpdateComplete")].status,priority=1 +// +kubebuilder:printcolumn:name="Resumed",type="string",JSONPath=.status.conditions[?(@.type=="Resumed")].status,priority=1 +// +kubebuilder:printcolumn:name="UpdateCompatible",type="string",JSONPath=.status.conditions[?(@.type=="UpdateCompatible")].status,priority=1 +// +kubebuilder:printcolumn:name="UpdatedFilesAndOS",type="string",JSONPath=.status.conditions[?(@.type=="AppliedFilesAndOS")].status,priority=1 +// +kubebuilder:printcolumn:name="CordonedNode",type="string",JSONPath=.status.conditions[?(@.type=="Cordoned")].status,priority=1 +// +kubebuilder:printcolumn:name="DrainedNode",type="string",JSONPath=.status.conditions[?(@.type=="Drained")].status,priority=1 +// +kubebuilder:printcolumn:name="RebootedNode",type="string",JSONPath=.status.conditions[?(@.type=="RebootedNode")].status,priority=1 +// +kubebuilder:printcolumn:name="ReloadedCRIO",type="string",JSONPath=.status.conditions[?(@.type=="ReloadedCRIO")].status,priority=1 +// +kubebuilder:printcolumn:name="UncordonedNode",type="string",JSONPath=.status.conditions[?(@.type=="Uncordoned")].status,priority=1 +// +kubebuilder:metadata:labels=openshift.io/operator-managed= + +// MachineConfigNode describes the health of the Machines on the system +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +// +kubebuilder:validation:XValidation:rule="self.metadata.name == self.spec.node.name",message="spec.node.name should match metadata.name" +type MachineConfigNode struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard object metadata. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec describes the configuration of the machine config node. + // +required + Spec MachineConfigNodeSpec `json:"spec"` + + // status describes the last observed state of this machine config node. + // +optional + Status MachineConfigNodeStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineConfigNodeList describes all of the MachinesStates on the system +// +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +type MachineConfigNodeList struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard list metadata. + // +optional + metav1.ListMeta `json:"metadata"` + + // items contains a collection of MachineConfigNode resources. + // +optional + Items []MachineConfigNode `json:"items"` +} + +// MachineConfigNodeSpec describes the MachineConfigNode we are managing. +type MachineConfigNodeSpec struct { + // node contains a reference to the node for this machine config node. + // +required + Node MCOObjectReference `json:"node"` + + // pool contains a reference to the machine config pool that this machine config node's + // referenced node belongs to. + // +required + Pool MCOObjectReference `json:"pool"` //TODO: Check this + + // configVersion holds the desired config version for the node targeted by this machine config node resource. + // The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates + // the new machine config against the current machine config. //TODO: check this is only the desired config version + // +required + ConfigVersion MachineConfigNodeSpecMachineConfigVersion `json:"configVersion"` + + // pinnedImageSets holds the desired pinned image sets that this node should pin and pull. + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=100 + // +optional + PinnedImageSets []MachineConfigNodeSpecPinnedImageSet `json:"pinnedImageSets,omitempty"` +} + +// MCOObjectReference holds information about an object the MCO either owns +// or modifies in some way +type MCOObjectReference struct { + // name is the object name. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + // It may consist of only alphanumeric characters, hyphens (-) and periods (.) + // and must be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // +required + Name string `json:"name"` +} + +// MachineConfigNodeStatus holds the reported information on a particular machine config node. +type MachineConfigNodeStatus struct { + // conditions represent the observations of a machine config node's current state. + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // observedGeneration represents the generation observed by the controller. + // This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. + // +required + ObservedGeneration int64 `json:"observedGeneration"` + // configVersion describes the current and desired machine config for this node. + // The current version represents the current machine config for the node and is updated after a successful update. + // The desired version represents the machine config the node will attempt to update to. + // This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + // +required + ConfigVersion MachineConfigNodeStatusMachineConfigVersion `json:"configVersion"` + // pinnedImageSets describes the current and desired pinned image sets for this node. + // The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + // The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=100 + // +optional + PinnedImageSets []MachineConfigNodeStatusPinnedImageSet `json:"pinnedImageSets,omitempty"` +} + +// TODO: Add description of struct +// +kubebuilder:validation:XValidation:rule="has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true",message="desired generation must be greater than or equal to the current generation" +// +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true",message="desired generation must be greater than last failed generation" +// +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) ? has(self.desiredGeneration): true",message="desired generation must be defined if last failed generation is defined" +type MachineConfigNodeStatusPinnedImageSet struct { + // name is the name of the pinned image set. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + // It may consist of only alphanumeric characters, hyphens (-) and periods (.) + // and must be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // +required + Name string `json:"name"` + // currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. + // +optional + CurrentGeneration int32 `json:"currentGeneration,omitempty"` + // desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node. + // +kubebuilder:validation:Minimum=0 + // +optional + DesiredGeneration int32 `json:"desiredGeneration,omitempty"` + // lastFailedGeneration is the generation of the most recent pinned image set that failed to be pulled and pinned on this node. + // +kubebuilder:validation:Minimum=0 + // +optional + LastFailedGeneration int32 `json:"lastFailedGeneration,omitempty"` + // lastFailedGenerationErrors is a list of errors why the lastFailed generation failed to be pulled and pinned. + // +kubebuilder:validation:MaxItems=10 + // +optional + LastFailedGenerationErrors []string `json:"lastFailedGenerationErrors,omitempty"` +} + +// MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. +// When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will +// monitor the upgrade process. +// When the current and desired versions do not match, //TODO: check if this is meant to be a repeat of the previous line +// the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode. +type MachineConfigNodeStatusMachineConfigVersion struct { + // current is the name of the machine config currently in use on the node. + // This value is updated once the machine config daemon has completed the update of the configuration for the node. + // This value should match the desired version unless an upgrade is in progress. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + // It may consist of only alphanumeric characters, hyphens (-) and periods (.) + // and must be at most 253 characters in length. + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // +optional + Current string `json:"current"` + // desired is the MachineConfig the node wants to upgrade to. + // This value gets set in the machine config node status once the machine config has been validated + // against the current machine config. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + // It may consist of only alphanumeric characters, hyphens (-) and periods (.) + // and must be at most 253 characters in length. + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // +required + Desired string `json:"desired"` +} + +// MachineConfigNodeSpecMachineConfigVersion holds the desired config version for the current observed machine config node. +// When Current is not equal to Desired; the MachineConfigOperator is in an upgrade phase and the machine config node will +// take account of upgrade related events. Otherwise they will be ignored given that certain operations +// happen both during the MCO's upgrade mode and the daily operations mode. +type MachineConfigNodeSpecMachineConfigVersion struct { + // desired is the name of the machine config that the the node should be upgraded to. + // This value is set when the machine config pool generates a new version of its rendered configuration. + // When this value is changed, the machine config daemon starts the node upgrade process. + // This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + // It may consist of only alphanumeric characters, hyphens (-) and periods (.) + // and must be at most 253 characters in length. + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // +required + Desired string `json:"desired"` +} + +// TODO: Add description of struct +type MachineConfigNodeSpecPinnedImageSet struct { + // name is the name of the pinned image set. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + // It may consist of only alphanumeric characters, hyphens (-) and periods (.) + // and must be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // +required + Name string `json:"name"` +} + +// StateProgress is each possible state for each possible MachineConfigNodeType +// UpgradeProgression Kind will only use the "MachinConfigPoolUpdate..." types for example +// Please note: These conditions are subject to change. Both additions and deletions may be made. //TODO: Make sure this can be removed +type StateProgress string + +const ( + // MachineConfigNodeUpdatePrepared describes a machine that is preparing in the daemon to trigger an update + MachineConfigNodeUpdatePrepared StateProgress = "UpdatePrepared" + // MachineConfigNodeUpdateExecuted describes a machine that has executed the body of the upgrade + MachineConfigNodeUpdateExecuted StateProgress = "UpdateExecuted" + // MachineConfigNodeUpdatePostActionComplete describes a machine that has executed its post update action + MachineConfigNodeUpdatePostActionComplete StateProgress = "UpdatePostActionComplete" + // MachineConfigNodeUpdateComplete describes a machine that has completed the core parts of an upgrade + MachineConfigNodeUpdateComplete StateProgress = "UpdateComplete" + // MachineConfigNodeUpdated describes a machine that has a matching desired and current config after executing an update + MachineConfigNodeUpdated StateProgress = "Updated" + // MachineConfigNodeUpdateResumed describes a machine that has resumed normal processes + MachineConfigNodeResumed StateProgress = "Resumed" //TDOD: Check if this should be MachineConfigNodeUpdateResumed + // MachineConfigNodeUpdateCompatible the part of the preparing phase where the mco decides whether it can update + MachineConfigNodeUpdateCompatible StateProgress = "UpdateCompatible" + // MachineConfigNodeUpdateDrained describes the part of the inprogress phase where the node drains + MachineConfigNodeUpdateDrained StateProgress = "Drained" + // MachineConfigNodeUpdateFilesAndOS describes the part of the inprogress phase where the nodes file and OS config change + MachineConfigNodeUpdateFilesAndOS StateProgress = "AppliedFilesAndOS" + // MachineConfigNodeUpdateCordoned describes the part of the completing phase where the node cordons + MachineConfigNodeUpdateCordoned StateProgress = "Cordoned" + // MachineConfigNodeUpdateUncordoned describes the part of the completing phase where the node uncordons + MachineConfigNodeUpdateUncordoned StateProgress = "Uncordoned" + // MachineConfigNodeUpdateRebooted describes the part of the post action phase where the node reboots itself + MachineConfigNodeUpdateRebooted StateProgress = "RebootedNode" + // MachineConfigNodeUpdateReloaded describes the part of the post action phase where the node reloads its CRIO service + MachineConfigNodeUpdateReloaded StateProgress = "ReloadedCRIO" + // MachineConfigNodePinnedImageSetsProgressing describes a machine currently progressing to the desired pinned image sets + MachineConfigNodePinnedImageSetsProgressing StateProgress = "PinnedImageSetsProgressing" + // MachineConfigNodePinnedImageSetsDegraded describes a machine that has failed to progress to the desired pinned image sets + MachineConfigNodePinnedImageSetsDegraded StateProgress = "PinnedImageSetsDegraded" +) From c32f007e417288cf2f7b019c73a2b7ec4c365c01 Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Fri, 24 Jan 2025 11:48:49 -0500 Subject: [PATCH 2/9] addition of generated files --- machineconfiguration/v1/register.go | 2 + ...achineconfignodes-CustomNoUpgrade.crd.yaml | 371 ++++++++++++++++++ ...neconfignodes-DevPreviewNoUpgrade.crd.yaml | 371 ++++++++++++++++++ ...econfignodes-TechPreviewNoUpgrade.crd.yaml | 371 ++++++++++++++++++ .../v1/zz_generated.deepcopy.go | 201 ++++++++++ ..._generated.featuregated-crd-manifests.yaml | 85 ++++ .../MachineConfigNodes.yaml | 371 ++++++++++++++++++ .../v1/zz_generated.swagger_doc_generated.go | 93 +++++ 8 files changed, 1865 insertions(+) create mode 100644 machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml create mode 100644 machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml create mode 100644 machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml create mode 100644 machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml diff --git a/machineconfiguration/v1/register.go b/machineconfiguration/v1/register.go index cddaa853015..11858146f3a 100644 --- a/machineconfiguration/v1/register.go +++ b/machineconfiguration/v1/register.go @@ -38,6 +38,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &MachineOSConfigList{}, &MachineOSBuild{}, &MachineOSBuildList{}, + &MachineConfigNode{}, + &MachineConfigNodeList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml new file mode 100644 index 00000000000..c41aae83bca --- /dev/null +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml @@ -0,0 +1,371 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: 'https://github.com/openshift/api/pull/XXXX //TODO: + Update once PR is opened' + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: CustomNoUpgrade + labels: + openshift.io/operator-managed: "" + name: machineconfignodes.machineconfiguration.openshift.io +spec: + group: machineconfiguration.openshift.io + names: + kind: MachineConfigNode + listKind: MachineConfigNodeList + plural: machineconfignodes + singular: machineconfignode + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.pool.name + name: PoolName + type: string + - jsonPath: .spec.configVersion.desired + name: DesiredConfig + type: string + - jsonPath: .status.configVersion.current + name: CurrentConfig + type: string + - jsonPath: .status.conditions[?(@.type=="Updated")].status + name: Updated + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePrepared")].status + name: UpdatePrepared + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateExecuted")].status + name: UpdateExecuted + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePostActionComplete")].status + name: UpdatePostActionComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateComplete")].status + name: UpdateComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Resumed")].status + name: Resumed + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateCompatible")].status + name: UpdateCompatible + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="AppliedFilesAndOS")].status + name: UpdatedFilesAndOS + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Cordoned")].status + name: CordonedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Drained")].status + name: DrainedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="RebootedNode")].status + name: RebootedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="ReloadedCRIO")].status + name: ReloadedCRIO + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Uncordoned")].status + name: UncordonedNode + priority: 1 + type: string + name: v1 + schema: + openAPIV3Schema: + description: |- + MachineConfigNode describes the health of the Machines on the system + Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec describes the configuration of the machine config node. + properties: + configVersion: + description: |- + configVersion holds the desired config version for the node targeted by this machine config node resource. + The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates + the new machine config against the current machine config. //TODO: check this is only the desired config version + properties: + desired: + description: |- + desired is the name of the machine config that the the node should be upgraded to. + This value is set when the machine config pool generates a new version of its rendered configuration. + When this value is changed, the machine config daemon starts the node upgrade process. + This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - desired + type: object + node: + description: node contains a reference to the node for this machine + config node. + properties: + name: + description: |- + name is the object name. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + pinnedImageSets: + description: pinnedImageSets holds the desired pinned image sets that + this node should pin and pull. + items: + properties: + name: + description: |- + name is the name of the pinned image set. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + pool: + description: |- + pool contains a reference to the machine config pool that this machine config node's + referenced node belongs to. + properties: + name: + description: |- + name is the object name. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + required: + - configVersion + - node + - pool + type: object + status: + description: status describes the last observed state of this machine + config node. + properties: + conditions: + description: conditions represent the observations of a machine config + node's current state. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + configVersion: + description: |- + configVersion describes the current and desired machine config for this node. + The current version represents the current machine config for the node and is updated after a successful update. + The desired version represents the machine config the node will attempt to update to. + This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + properties: + current: + description: |- + current is the name of the machine config currently in use on the node. + This value is updated once the machine config daemon has completed the update of the configuration for the node. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + desired: + description: |- + desired is the MachineConfig the node wants to upgrade to. + This value gets set in the machine config node status once the machine config has been validated + against the current machine config. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - desired + type: object + observedGeneration: + description: |- + observedGeneration represents the generation observed by the controller. + This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. + format: int64 + type: integer + pinnedImageSets: + description: |- + pinnedImageSets describes the current and desired pinned image sets for this node. + The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + items: + properties: + currentGeneration: + description: currentGeneration is the generation of the pinned + image set that has most recently been successfully pulled + and pinned on this node. + format: int32 + type: integer + desiredGeneration: + description: desiredGeneration is the generation of the pinned + image set that is targeted to be pulled and pinned on this + node. + format: int32 + minimum: 0 + type: integer + lastFailedGeneration: + description: lastFailedGeneration is the generation of the most + recent pinned image set that failed to be pulled and pinned + on this node. + format: int32 + minimum: 0 + type: integer + lastFailedGenerationErrors: + description: lastFailedGenerationErrors is a list of errors + why the lastFailed generation failed to be pulled and pinned. + items: + type: string + maxItems: 10 + type: array + name: + description: |- + name is the name of the pinned image set. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + x-kubernetes-validations: + - message: desired generation must be greater than or equal to the + current generation + rule: 'has(self.desiredGeneration) && has(self.currentGeneration) + ? self.desiredGeneration >= self.currentGeneration : true' + - message: desired generation must be greater than last failed generation + rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) + ? self.desiredGeneration >= self.lastFailedGeneration : true' + - message: desired generation must be defined if last failed generation + is defined + rule: 'has(self.lastFailedGeneration) ? has(self.desiredGeneration): + true' + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - configVersion + - observedGeneration + type: object + required: + - spec + type: object + x-kubernetes-validations: + - message: spec.node.name should match metadata.name + rule: self.metadata.name == self.spec.node.name + served: true + storage: true + subresources: + status: {} diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml new file mode 100644 index 00000000000..43a32ac0553 --- /dev/null +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml @@ -0,0 +1,371 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: 'https://github.com/openshift/api/pull/XXXX //TODO: + Update once PR is opened' + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: DevPreviewNoUpgrade + labels: + openshift.io/operator-managed: "" + name: machineconfignodes.machineconfiguration.openshift.io +spec: + group: machineconfiguration.openshift.io + names: + kind: MachineConfigNode + listKind: MachineConfigNodeList + plural: machineconfignodes + singular: machineconfignode + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.pool.name + name: PoolName + type: string + - jsonPath: .spec.configVersion.desired + name: DesiredConfig + type: string + - jsonPath: .status.configVersion.current + name: CurrentConfig + type: string + - jsonPath: .status.conditions[?(@.type=="Updated")].status + name: Updated + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePrepared")].status + name: UpdatePrepared + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateExecuted")].status + name: UpdateExecuted + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePostActionComplete")].status + name: UpdatePostActionComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateComplete")].status + name: UpdateComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Resumed")].status + name: Resumed + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateCompatible")].status + name: UpdateCompatible + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="AppliedFilesAndOS")].status + name: UpdatedFilesAndOS + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Cordoned")].status + name: CordonedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Drained")].status + name: DrainedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="RebootedNode")].status + name: RebootedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="ReloadedCRIO")].status + name: ReloadedCRIO + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Uncordoned")].status + name: UncordonedNode + priority: 1 + type: string + name: v1 + schema: + openAPIV3Schema: + description: |- + MachineConfigNode describes the health of the Machines on the system + Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec describes the configuration of the machine config node. + properties: + configVersion: + description: |- + configVersion holds the desired config version for the node targeted by this machine config node resource. + The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates + the new machine config against the current machine config. //TODO: check this is only the desired config version + properties: + desired: + description: |- + desired is the name of the machine config that the the node should be upgraded to. + This value is set when the machine config pool generates a new version of its rendered configuration. + When this value is changed, the machine config daemon starts the node upgrade process. + This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - desired + type: object + node: + description: node contains a reference to the node for this machine + config node. + properties: + name: + description: |- + name is the object name. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + pinnedImageSets: + description: pinnedImageSets holds the desired pinned image sets that + this node should pin and pull. + items: + properties: + name: + description: |- + name is the name of the pinned image set. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + pool: + description: |- + pool contains a reference to the machine config pool that this machine config node's + referenced node belongs to. + properties: + name: + description: |- + name is the object name. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + required: + - configVersion + - node + - pool + type: object + status: + description: status describes the last observed state of this machine + config node. + properties: + conditions: + description: conditions represent the observations of a machine config + node's current state. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + configVersion: + description: |- + configVersion describes the current and desired machine config for this node. + The current version represents the current machine config for the node and is updated after a successful update. + The desired version represents the machine config the node will attempt to update to. + This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + properties: + current: + description: |- + current is the name of the machine config currently in use on the node. + This value is updated once the machine config daemon has completed the update of the configuration for the node. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + desired: + description: |- + desired is the MachineConfig the node wants to upgrade to. + This value gets set in the machine config node status once the machine config has been validated + against the current machine config. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - desired + type: object + observedGeneration: + description: |- + observedGeneration represents the generation observed by the controller. + This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. + format: int64 + type: integer + pinnedImageSets: + description: |- + pinnedImageSets describes the current and desired pinned image sets for this node. + The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + items: + properties: + currentGeneration: + description: currentGeneration is the generation of the pinned + image set that has most recently been successfully pulled + and pinned on this node. + format: int32 + type: integer + desiredGeneration: + description: desiredGeneration is the generation of the pinned + image set that is targeted to be pulled and pinned on this + node. + format: int32 + minimum: 0 + type: integer + lastFailedGeneration: + description: lastFailedGeneration is the generation of the most + recent pinned image set that failed to be pulled and pinned + on this node. + format: int32 + minimum: 0 + type: integer + lastFailedGenerationErrors: + description: lastFailedGenerationErrors is a list of errors + why the lastFailed generation failed to be pulled and pinned. + items: + type: string + maxItems: 10 + type: array + name: + description: |- + name is the name of the pinned image set. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + x-kubernetes-validations: + - message: desired generation must be greater than or equal to the + current generation + rule: 'has(self.desiredGeneration) && has(self.currentGeneration) + ? self.desiredGeneration >= self.currentGeneration : true' + - message: desired generation must be greater than last failed generation + rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) + ? self.desiredGeneration >= self.lastFailedGeneration : true' + - message: desired generation must be defined if last failed generation + is defined + rule: 'has(self.lastFailedGeneration) ? has(self.desiredGeneration): + true' + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - configVersion + - observedGeneration + type: object + required: + - spec + type: object + x-kubernetes-validations: + - message: spec.node.name should match metadata.name + rule: self.metadata.name == self.spec.node.name + served: true + storage: true + subresources: + status: {} diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml new file mode 100644 index 00000000000..396991274f7 --- /dev/null +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml @@ -0,0 +1,371 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: 'https://github.com/openshift/api/pull/XXXX //TODO: + Update once PR is opened' + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: TechPreviewNoUpgrade + labels: + openshift.io/operator-managed: "" + name: machineconfignodes.machineconfiguration.openshift.io +spec: + group: machineconfiguration.openshift.io + names: + kind: MachineConfigNode + listKind: MachineConfigNodeList + plural: machineconfignodes + singular: machineconfignode + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.pool.name + name: PoolName + type: string + - jsonPath: .spec.configVersion.desired + name: DesiredConfig + type: string + - jsonPath: .status.configVersion.current + name: CurrentConfig + type: string + - jsonPath: .status.conditions[?(@.type=="Updated")].status + name: Updated + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePrepared")].status + name: UpdatePrepared + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateExecuted")].status + name: UpdateExecuted + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePostActionComplete")].status + name: UpdatePostActionComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateComplete")].status + name: UpdateComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Resumed")].status + name: Resumed + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateCompatible")].status + name: UpdateCompatible + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="AppliedFilesAndOS")].status + name: UpdatedFilesAndOS + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Cordoned")].status + name: CordonedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Drained")].status + name: DrainedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="RebootedNode")].status + name: RebootedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="ReloadedCRIO")].status + name: ReloadedCRIO + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Uncordoned")].status + name: UncordonedNode + priority: 1 + type: string + name: v1 + schema: + openAPIV3Schema: + description: |- + MachineConfigNode describes the health of the Machines on the system + Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec describes the configuration of the machine config node. + properties: + configVersion: + description: |- + configVersion holds the desired config version for the node targeted by this machine config node resource. + The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates + the new machine config against the current machine config. //TODO: check this is only the desired config version + properties: + desired: + description: |- + desired is the name of the machine config that the the node should be upgraded to. + This value is set when the machine config pool generates a new version of its rendered configuration. + When this value is changed, the machine config daemon starts the node upgrade process. + This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - desired + type: object + node: + description: node contains a reference to the node for this machine + config node. + properties: + name: + description: |- + name is the object name. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + pinnedImageSets: + description: pinnedImageSets holds the desired pinned image sets that + this node should pin and pull. + items: + properties: + name: + description: |- + name is the name of the pinned image set. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + pool: + description: |- + pool contains a reference to the machine config pool that this machine config node's + referenced node belongs to. + properties: + name: + description: |- + name is the object name. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + required: + - configVersion + - node + - pool + type: object + status: + description: status describes the last observed state of this machine + config node. + properties: + conditions: + description: conditions represent the observations of a machine config + node's current state. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + configVersion: + description: |- + configVersion describes the current and desired machine config for this node. + The current version represents the current machine config for the node and is updated after a successful update. + The desired version represents the machine config the node will attempt to update to. + This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + properties: + current: + description: |- + current is the name of the machine config currently in use on the node. + This value is updated once the machine config daemon has completed the update of the configuration for the node. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + desired: + description: |- + desired is the MachineConfig the node wants to upgrade to. + This value gets set in the machine config node status once the machine config has been validated + against the current machine config. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - desired + type: object + observedGeneration: + description: |- + observedGeneration represents the generation observed by the controller. + This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. + format: int64 + type: integer + pinnedImageSets: + description: |- + pinnedImageSets describes the current and desired pinned image sets for this node. + The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + items: + properties: + currentGeneration: + description: currentGeneration is the generation of the pinned + image set that has most recently been successfully pulled + and pinned on this node. + format: int32 + type: integer + desiredGeneration: + description: desiredGeneration is the generation of the pinned + image set that is targeted to be pulled and pinned on this + node. + format: int32 + minimum: 0 + type: integer + lastFailedGeneration: + description: lastFailedGeneration is the generation of the most + recent pinned image set that failed to be pulled and pinned + on this node. + format: int32 + minimum: 0 + type: integer + lastFailedGenerationErrors: + description: lastFailedGenerationErrors is a list of errors + why the lastFailed generation failed to be pulled and pinned. + items: + type: string + maxItems: 10 + type: array + name: + description: |- + name is the name of the pinned image set. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + x-kubernetes-validations: + - message: desired generation must be greater than or equal to the + current generation + rule: 'has(self.desiredGeneration) && has(self.currentGeneration) + ? self.desiredGeneration >= self.currentGeneration : true' + - message: desired generation must be greater than last failed generation + rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) + ? self.desiredGeneration >= self.lastFailedGeneration : true' + - message: desired generation must be defined if last failed generation + is defined + rule: 'has(self.lastFailedGeneration) ? has(self.desiredGeneration): + true' + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - configVersion + - observedGeneration + type: object + required: + - spec + type: object + x-kubernetes-validations: + - message: spec.node.name should match metadata.name + rule: self.metadata.name == self.spec.node.name + served: true + storage: true + subresources: + status: {} diff --git a/machineconfiguration/v1/zz_generated.deepcopy.go b/machineconfiguration/v1/zz_generated.deepcopy.go index 94f9acbd5ad..c4a50491e29 100644 --- a/machineconfiguration/v1/zz_generated.deepcopy.go +++ b/machineconfiguration/v1/zz_generated.deepcopy.go @@ -589,6 +589,22 @@ func (in *KubeletConfigStatus) DeepCopy() *KubeletConfigStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MCOObjectReference) DeepCopyInto(out *MCOObjectReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MCOObjectReference. +func (in *MCOObjectReference) DeepCopy() *MCOObjectReference { + if in == nil { + return nil + } + out := new(MCOObjectReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineConfig) DeepCopyInto(out *MachineConfig) { *out = *in @@ -649,6 +665,191 @@ func (in *MachineConfigList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNode) DeepCopyInto(out *MachineConfigNode) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNode. +func (in *MachineConfigNode) DeepCopy() *MachineConfigNode { + if in == nil { + return nil + } + out := new(MachineConfigNode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineConfigNode) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeList) DeepCopyInto(out *MachineConfigNodeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineConfigNode, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeList. +func (in *MachineConfigNodeList) DeepCopy() *MachineConfigNodeList { + if in == nil { + return nil + } + out := new(MachineConfigNodeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineConfigNodeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeSpec) DeepCopyInto(out *MachineConfigNodeSpec) { + *out = *in + out.Node = in.Node + out.Pool = in.Pool + out.ConfigVersion = in.ConfigVersion + if in.PinnedImageSets != nil { + in, out := &in.PinnedImageSets, &out.PinnedImageSets + *out = make([]MachineConfigNodeSpecPinnedImageSet, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeSpec. +func (in *MachineConfigNodeSpec) DeepCopy() *MachineConfigNodeSpec { + if in == nil { + return nil + } + out := new(MachineConfigNodeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeSpecMachineConfigVersion) DeepCopyInto(out *MachineConfigNodeSpecMachineConfigVersion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeSpecMachineConfigVersion. +func (in *MachineConfigNodeSpecMachineConfigVersion) DeepCopy() *MachineConfigNodeSpecMachineConfigVersion { + if in == nil { + return nil + } + out := new(MachineConfigNodeSpecMachineConfigVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeSpecPinnedImageSet) DeepCopyInto(out *MachineConfigNodeSpecPinnedImageSet) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeSpecPinnedImageSet. +func (in *MachineConfigNodeSpecPinnedImageSet) DeepCopy() *MachineConfigNodeSpecPinnedImageSet { + if in == nil { + return nil + } + out := new(MachineConfigNodeSpecPinnedImageSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeStatus) DeepCopyInto(out *MachineConfigNodeStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.ConfigVersion = in.ConfigVersion + if in.PinnedImageSets != nil { + in, out := &in.PinnedImageSets, &out.PinnedImageSets + *out = make([]MachineConfigNodeStatusPinnedImageSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeStatus. +func (in *MachineConfigNodeStatus) DeepCopy() *MachineConfigNodeStatus { + if in == nil { + return nil + } + out := new(MachineConfigNodeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeStatusMachineConfigVersion) DeepCopyInto(out *MachineConfigNodeStatusMachineConfigVersion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeStatusMachineConfigVersion. +func (in *MachineConfigNodeStatusMachineConfigVersion) DeepCopy() *MachineConfigNodeStatusMachineConfigVersion { + if in == nil { + return nil + } + out := new(MachineConfigNodeStatusMachineConfigVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeStatusPinnedImageSet) DeepCopyInto(out *MachineConfigNodeStatusPinnedImageSet) { + *out = *in + if in.LastFailedGenerationErrors != nil { + in, out := &in.LastFailedGenerationErrors, &out.LastFailedGenerationErrors + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeStatusPinnedImageSet. +func (in *MachineConfigNodeStatusPinnedImageSet) DeepCopy() *MachineConfigNodeStatusPinnedImageSet { + if in == nil { + return nil + } + out := new(MachineConfigNodeStatusPinnedImageSet) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineConfigPool) DeepCopyInto(out *MachineConfigPool) { *out = *in diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml index bb386656df9..b4601e57082 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml @@ -109,6 +109,91 @@ machineconfigs.machineconfiguration.openshift.io: TopLevelFeatureGates: [] Version: v1 +machineconfignodes.machineconfiguration.openshift.io: + Annotations: {} + ApprovedPRNumber: 'https://github.com/openshift/api/pull/XXXX //TODO: Update once + PR is opened' + CRDName: machineconfignodes.machineconfiguration.openshift.io + Capability: "" + Category: "" + FeatureGates: + - MachineConfigNodes + FilenameOperatorName: machine-config + FilenameOperatorOrdering: "01" + FilenameRunLevel: "0000_80" + GroupName: machineconfiguration.openshift.io + HasStatus: true + KindName: MachineConfigNode + Labels: + openshift.io/operator-managed: "" + PluralName: machineconfignodes + PrinterColumns: + - jsonPath: .spec.pool.name + name: PoolName + type: string + - jsonPath: .spec.configVersion.desired + name: DesiredConfig + type: string + - jsonPath: .status.configVersion.current + name: CurrentConfig + type: string + - jsonPath: .status.conditions[?(@.type=="Updated")].status + name: Updated + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePrepared")].status + name: UpdatePrepared + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateExecuted")].status + name: UpdateExecuted + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePostActionComplete")].status + name: UpdatePostActionComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateComplete")].status + name: UpdateComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Resumed")].status + name: Resumed + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateCompatible")].status + name: UpdateCompatible + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="AppliedFilesAndOS")].status + name: UpdatedFilesAndOS + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Cordoned")].status + name: CordonedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Drained")].status + name: DrainedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="RebootedNode")].status + name: RebootedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="ReloadedCRIO")].status + name: ReloadedCRIO + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Uncordoned")].status + name: UncordonedNode + priority: 1 + type: string + Scope: Cluster + ShortNames: null + TopLevelFeatureGates: + - MachineConfigNodes + Version: v1 + machineconfigpools.machineconfiguration.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/1453 diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml new file mode 100644 index 00000000000..a1d60467585 --- /dev/null +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml @@ -0,0 +1,371 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: 'https://github.com/openshift/api/pull/XXXX //TODO: + Update once PR is opened' + api.openshift.io/filename-cvo-runlevel: "0000_80" + api.openshift.io/filename-operator: machine-config + api.openshift.io/filename-ordering: "01" + feature-gate.release.openshift.io/MachineConfigNodes: "true" + labels: + openshift.io/operator-managed: "" + name: machineconfignodes.machineconfiguration.openshift.io +spec: + group: machineconfiguration.openshift.io + names: + kind: MachineConfigNode + listKind: MachineConfigNodeList + plural: machineconfignodes + singular: machineconfignode + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.pool.name + name: PoolName + type: string + - jsonPath: .spec.configVersion.desired + name: DesiredConfig + type: string + - jsonPath: .status.configVersion.current + name: CurrentConfig + type: string + - jsonPath: .status.conditions[?(@.type=="Updated")].status + name: Updated + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePrepared")].status + name: UpdatePrepared + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateExecuted")].status + name: UpdateExecuted + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePostActionComplete")].status + name: UpdatePostActionComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateComplete")].status + name: UpdateComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Resumed")].status + name: Resumed + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateCompatible")].status + name: UpdateCompatible + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="AppliedFilesAndOS")].status + name: UpdatedFilesAndOS + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Cordoned")].status + name: CordonedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Drained")].status + name: DrainedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="RebootedNode")].status + name: RebootedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="ReloadedCRIO")].status + name: ReloadedCRIO + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Uncordoned")].status + name: UncordonedNode + priority: 1 + type: string + name: v1 + schema: + openAPIV3Schema: + description: |- + MachineConfigNode describes the health of the Machines on the system + Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec describes the configuration of the machine config node. + properties: + configVersion: + description: |- + configVersion holds the desired config version for the node targeted by this machine config node resource. + The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates + the new machine config against the current machine config. //TODO: check this is only the desired config version + properties: + desired: + description: |- + desired is the name of the machine config that the the node should be upgraded to. + This value is set when the machine config pool generates a new version of its rendered configuration. + When this value is changed, the machine config daemon starts the node upgrade process. + This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - desired + type: object + node: + description: node contains a reference to the node for this machine + config node. + properties: + name: + description: |- + name is the object name. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + pinnedImageSets: + description: pinnedImageSets holds the desired pinned image sets that + this node should pin and pull. + items: + properties: + name: + description: |- + name is the name of the pinned image set. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + pool: + description: |- + pool contains a reference to the machine config pool that this machine config node's + referenced node belongs to. + properties: + name: + description: |- + name is the object name. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + required: + - configVersion + - node + - pool + type: object + status: + description: status describes the last observed state of this machine + config node. + properties: + conditions: + description: conditions represent the observations of a machine config + node's current state. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + configVersion: + description: |- + configVersion describes the current and desired machine config for this node. + The current version represents the current machine config for the node and is updated after a successful update. + The desired version represents the machine config the node will attempt to update to. + This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + properties: + current: + description: |- + current is the name of the machine config currently in use on the node. + This value is updated once the machine config daemon has completed the update of the configuration for the node. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + desired: + description: |- + desired is the MachineConfig the node wants to upgrade to. + This value gets set in the machine config node status once the machine config has been validated + against the current machine config. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - desired + type: object + observedGeneration: + description: |- + observedGeneration represents the generation observed by the controller. + This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. + format: int64 + type: integer + pinnedImageSets: + description: |- + pinnedImageSets describes the current and desired pinned image sets for this node. + The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + items: + properties: + currentGeneration: + description: currentGeneration is the generation of the pinned + image set that has most recently been successfully pulled + and pinned on this node. + format: int32 + type: integer + desiredGeneration: + description: desiredGeneration is the generation of the pinned + image set that is targeted to be pulled and pinned on this + node. + format: int32 + minimum: 0 + type: integer + lastFailedGeneration: + description: lastFailedGeneration is the generation of the most + recent pinned image set that failed to be pulled and pinned + on this node. + format: int32 + minimum: 0 + type: integer + lastFailedGenerationErrors: + description: lastFailedGenerationErrors is a list of errors + why the lastFailed generation failed to be pulled and pinned. + items: + type: string + maxItems: 10 + type: array + name: + description: |- + name is the name of the pinned image set. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + It may consist of only alphanumeric characters, hyphens (-) and periods (.) + and must be at most 253 characters in length. + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + required: + - name + type: object + x-kubernetes-validations: + - message: desired generation must be greater than or equal to the + current generation + rule: 'has(self.desiredGeneration) && has(self.currentGeneration) + ? self.desiredGeneration >= self.currentGeneration : true' + - message: desired generation must be greater than last failed generation + rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) + ? self.desiredGeneration >= self.lastFailedGeneration : true' + - message: desired generation must be defined if last failed generation + is defined + rule: 'has(self.lastFailedGeneration) ? has(self.desiredGeneration): + true' + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - configVersion + - observedGeneration + type: object + required: + - spec + type: object + x-kubernetes-validations: + - message: spec.node.name should match metadata.name + rule: self.metadata.name == self.spec.node.name + served: true + storage: true + subresources: + status: {} diff --git a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index 22ead771e62..21d776c2a33 100644 --- a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -368,6 +368,99 @@ func (PoolSynchronizerStatus) SwaggerDoc() map[string]string { return map_PoolSynchronizerStatus } +var map_MCOObjectReference = map[string]string{ + "": "MCOObjectReference holds information about an object the MCO either owns or modifies in some way", + "name": "name is the object name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", +} + +func (MCOObjectReference) SwaggerDoc() map[string]string { + return map_MCOObjectReference +} + +var map_MachineConfigNode = map[string]string{ + "": "MachineConfigNode describes the health of the Machines on the system Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "metadata": "metadata is the standard object metadata.", + "spec": "spec describes the configuration of the machine config node.", + "status": "status describes the last observed state of this machine config node.", +} + +func (MachineConfigNode) SwaggerDoc() map[string]string { + return map_MachineConfigNode +} + +var map_MachineConfigNodeList = map[string]string{ + "": "MachineConfigNodeList describes all of the MachinesStates on the system\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "metadata": "metadata is the standard list metadata.", + "items": "items contains a collection of MachineConfigNode resources.", +} + +func (MachineConfigNodeList) SwaggerDoc() map[string]string { + return map_MachineConfigNodeList +} + +var map_MachineConfigNodeSpec = map[string]string{ + "": "MachineConfigNodeSpec describes the MachineConfigNode we are managing.", + "node": "node contains a reference to the node for this machine config node.", + "pool": "pool contains a reference to the machine config pool that this machine config node's referenced node belongs to.", + "configVersion": "configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. //TODO: check this is only the desired config version", + "pinnedImageSets": "pinnedImageSets holds the desired pinned image sets that this node should pin and pull.", +} + +func (MachineConfigNodeSpec) SwaggerDoc() map[string]string { + return map_MachineConfigNodeSpec +} + +var map_MachineConfigNodeSpecMachineConfigVersion = map[string]string{ + "": "MachineConfigNodeSpecMachineConfigVersion holds the desired config version for the current observed machine config node. When Current is not equal to Desired; the MachineConfigOperator is in an upgrade phase and the machine config node will take account of upgrade related events. Otherwise they will be ignored given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", + "desired": "desired is the name of the machine config that the the node should be upgraded to. This value is set when the machine config pool generates a new version of its rendered configuration. When this value is changed, the machine config daemon starts the node upgrade process. This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", +} + +func (MachineConfigNodeSpecMachineConfigVersion) SwaggerDoc() map[string]string { + return map_MachineConfigNodeSpecMachineConfigVersion +} + +var map_MachineConfigNodeSpecPinnedImageSet = map[string]string{ + "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", +} + +func (MachineConfigNodeSpecPinnedImageSet) SwaggerDoc() map[string]string { + return map_MachineConfigNodeSpecPinnedImageSet +} + +var map_MachineConfigNodeStatus = map[string]string{ + "": "MachineConfigNodeStatus holds the reported information on a particular machine config node.", + "conditions": "conditions represent the observations of a machine config node's current state.", + "observedGeneration": "observedGeneration represents the generation observed by the controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec.", + "configVersion": "configVersion describes the current and desired machine config for this node. The current version represents the current machine config for the node and is updated after a successful update. The desired version represents the machine config the node will attempt to update to. This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists.", + "pinnedImageSets": "pinnedImageSets describes the current and desired pinned image sets for this node. The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set'", +} + +func (MachineConfigNodeStatus) SwaggerDoc() map[string]string { + return map_MachineConfigNodeStatus +} + +var map_MachineConfigNodeStatusMachineConfigVersion = map[string]string{ + "": "MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will monitor the upgrade process. When the current and desired versions do not match, //TODO: check if this is meant to be a repeat of the previous line the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", + "current": "current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", + "desired": "desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", +} + +func (MachineConfigNodeStatusMachineConfigVersion) SwaggerDoc() map[string]string { + return map_MachineConfigNodeStatusMachineConfigVersion +} + +var map_MachineConfigNodeStatusPinnedImageSet = map[string]string{ + "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", + "currentGeneration": "currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node.", + "desiredGeneration": "desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node.", + "lastFailedGeneration": "lastFailedGeneration is the generation of the most recent pinned image set that failed to be pulled and pinned on this node.", + "lastFailedGenerationErrors": "lastFailedGenerationErrors is a list of errors why the lastFailed generation failed to be pulled and pinned.", +} + +func (MachineConfigNodeStatusPinnedImageSet) SwaggerDoc() map[string]string { + return map_MachineConfigNodeStatusPinnedImageSet +} + var map_MachineConfigReference = map[string]string{ "": "Refers to the name of a rendered MachineConfig (e.g., \"rendered-worker-ec40d2965ff81bce7cd7a7e82a680739\", etc.): the build targets this MachineConfig, this is often used to tell us whether we need an update.", "name": "name is the name of the rendered MachineConfig object. This value should be between 10 and 253 characters, and must contain only lowercase alphanumeric characters, hyphens and periods, and should start and end with an alphanumeric character.", From 5a279304bcbb3d654a87cc95a54310800c7257ea Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Mon, 27 Jan 2025 08:32:27 -0500 Subject: [PATCH 3/9] cleanup --- .../v1/types_machineconfignode.go | 22 +++++++++---------- ...achineconfignodes-CustomNoUpgrade.crd.yaml | 15 ++++++++----- ...neconfignodes-DevPreviewNoUpgrade.crd.yaml | 15 ++++++++----- ...econfignodes-TechPreviewNoUpgrade.crd.yaml | 15 ++++++++----- ..._generated.featuregated-crd-manifests.yaml | 3 +-- .../MachineConfigNodes.yaml | 15 ++++++++----- .../v1/zz_generated.swagger_doc_generated.go | 8 ++++--- 7 files changed, 57 insertions(+), 36 deletions(-) diff --git a/machineconfiguration/v1/types_machineconfignode.go b/machineconfiguration/v1/types_machineconfignode.go index f36f7d94dc9..1d5b582e87f 100644 --- a/machineconfiguration/v1/types_machineconfignode.go +++ b/machineconfiguration/v1/types_machineconfignode.go @@ -10,7 +10,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:path=machineconfignodes,scope=Cluster // +kubebuilder:subresource:status -// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/XXXX //TODO: Update once PR is opened +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2171 // +openshift:file-pattern=cvoRunLevel=0000_80,operatorName=machine-config,operatorOrdering=01 // +openshift:enable:FeatureGate=MachineConfigNodes // +kubebuilder:printcolumn:name="PoolName",type="string",JSONPath=.spec.pool.name,priority=0 @@ -78,11 +78,11 @@ type MachineConfigNodeSpec struct { // pool contains a reference to the machine config pool that this machine config node's // referenced node belongs to. // +required - Pool MCOObjectReference `json:"pool"` //TODO: Check this + Pool MCOObjectReference `json:"pool"` // configVersion holds the desired config version for the node targeted by this machine config node resource. // The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates - // the new machine config against the current machine config. //TODO: check this is only the desired config version + // the new machine config against the current machine config. // +required ConfigVersion MachineConfigNodeSpecMachineConfigVersion `json:"configVersion"` @@ -127,8 +127,8 @@ type MachineConfigNodeStatus struct { // +required ConfigVersion MachineConfigNodeStatusMachineConfigVersion `json:"configVersion"` // pinnedImageSets describes the current and desired pinned image sets for this node. - // The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' - // The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + // The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. + // The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. // +listType=map // +listMapKey=name // +kubebuilder:validation:MaxItems=100 @@ -136,7 +136,7 @@ type MachineConfigNodeStatus struct { PinnedImageSets []MachineConfigNodeStatusPinnedImageSet `json:"pinnedImageSets,omitempty"` } -// TODO: Add description of struct +// MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current observed machine config node. // +kubebuilder:validation:XValidation:rule="has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true",message="desired generation must be greater than or equal to the current generation" // +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true",message="desired generation must be greater than last failed generation" // +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) ? has(self.desiredGeneration): true",message="desired generation must be defined if last failed generation is defined" @@ -169,8 +169,8 @@ type MachineConfigNodeStatusPinnedImageSet struct { // MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. // When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will // monitor the upgrade process. -// When the current and desired versions do not match, //TODO: check if this is meant to be a repeat of the previous line -// the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode. +// When the current and desired versions do not match, the machine config node will ignore these events given that certain operations +// happen both during the MCO's upgrade mode and the daily operations mode. type MachineConfigNodeStatusMachineConfigVersion struct { // current is the name of the machine config currently in use on the node. // This value is updated once the machine config daemon has completed the update of the configuration for the node. @@ -212,7 +212,8 @@ type MachineConfigNodeSpecMachineConfigVersion struct { Desired string `json:"desired"` } -// TODO: Add description of struct +// MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node +// should pin and pull. type MachineConfigNodeSpecPinnedImageSet struct { // name is the name of the pinned image set. // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) @@ -226,7 +227,6 @@ type MachineConfigNodeSpecPinnedImageSet struct { // StateProgress is each possible state for each possible MachineConfigNodeType // UpgradeProgression Kind will only use the "MachinConfigPoolUpdate..." types for example -// Please note: These conditions are subject to change. Both additions and deletions may be made. //TODO: Make sure this can be removed type StateProgress string const ( @@ -241,7 +241,7 @@ const ( // MachineConfigNodeUpdated describes a machine that has a matching desired and current config after executing an update MachineConfigNodeUpdated StateProgress = "Updated" // MachineConfigNodeUpdateResumed describes a machine that has resumed normal processes - MachineConfigNodeResumed StateProgress = "Resumed" //TDOD: Check if this should be MachineConfigNodeUpdateResumed + MachineConfigNodeUpdateResumed StateProgress = "Resumed" // MachineConfigNodeUpdateCompatible the part of the preparing phase where the mco decides whether it can update MachineConfigNodeUpdateCompatible StateProgress = "UpdateCompatible" // MachineConfigNodeUpdateDrained describes the part of the inprogress phase where the node drains diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml index c41aae83bca..4c56ed62076 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml @@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.openshift.io: 'https://github.com/openshift/api/pull/XXXX //TODO: - Update once PR is opened' + api-approved.openshift.io: https://github.com/openshift/api/pull/2171 api.openshift.io/merged-by-featuregates: "true" include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" @@ -112,7 +111,7 @@ spec: description: |- configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates - the new machine config against the current machine config. //TODO: check this is only the desired config version + the new machine config against the current machine config. properties: desired: description: |- @@ -149,6 +148,9 @@ spec: description: pinnedImageSets holds the desired pinned image sets that this node should pin and pull. items: + description: |- + MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node + should pin and pull. properties: name: description: |- @@ -295,9 +297,12 @@ spec: pinnedImageSets: description: |- pinnedImageSets describes the current and desired pinned image sets for this node. - The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' - The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. + The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. items: + description: MachineConfigNodeStatusPinnedImageSet holds information + about the current and desired pinned image sets for the current + observed machine config node. properties: currentGeneration: description: currentGeneration is the generation of the pinned diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml index 43a32ac0553..1cf0cee1e95 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml @@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.openshift.io: 'https://github.com/openshift/api/pull/XXXX //TODO: - Update once PR is opened' + api-approved.openshift.io: https://github.com/openshift/api/pull/2171 api.openshift.io/merged-by-featuregates: "true" include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" @@ -112,7 +111,7 @@ spec: description: |- configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates - the new machine config against the current machine config. //TODO: check this is only the desired config version + the new machine config against the current machine config. properties: desired: description: |- @@ -149,6 +148,9 @@ spec: description: pinnedImageSets holds the desired pinned image sets that this node should pin and pull. items: + description: |- + MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node + should pin and pull. properties: name: description: |- @@ -295,9 +297,12 @@ spec: pinnedImageSets: description: |- pinnedImageSets describes the current and desired pinned image sets for this node. - The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' - The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. + The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. items: + description: MachineConfigNodeStatusPinnedImageSet holds information + about the current and desired pinned image sets for the current + observed machine config node. properties: currentGeneration: description: currentGeneration is the generation of the pinned diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml index 396991274f7..f8b8d8d499a 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml @@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.openshift.io: 'https://github.com/openshift/api/pull/XXXX //TODO: - Update once PR is opened' + api-approved.openshift.io: https://github.com/openshift/api/pull/2171 api.openshift.io/merged-by-featuregates: "true" include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" @@ -112,7 +111,7 @@ spec: description: |- configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates - the new machine config against the current machine config. //TODO: check this is only the desired config version + the new machine config against the current machine config. properties: desired: description: |- @@ -149,6 +148,9 @@ spec: description: pinnedImageSets holds the desired pinned image sets that this node should pin and pull. items: + description: |- + MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node + should pin and pull. properties: name: description: |- @@ -295,9 +297,12 @@ spec: pinnedImageSets: description: |- pinnedImageSets describes the current and desired pinned image sets for this node. - The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' - The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. + The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. items: + description: MachineConfigNodeStatusPinnedImageSet holds information + about the current and desired pinned image sets for the current + observed machine config node. properties: currentGeneration: description: currentGeneration is the generation of the pinned diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml index b4601e57082..080c6bf2a3b 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml @@ -111,8 +111,7 @@ machineconfigs.machineconfiguration.openshift.io: machineconfignodes.machineconfiguration.openshift.io: Annotations: {} - ApprovedPRNumber: 'https://github.com/openshift/api/pull/XXXX //TODO: Update once - PR is opened' + ApprovedPRNumber: https://github.com/openshift/api/pull/2171 CRDName: machineconfignodes.machineconfiguration.openshift.io Capability: "" Category: "" diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml index a1d60467585..e078ac2cb5d 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml @@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.openshift.io: 'https://github.com/openshift/api/pull/XXXX //TODO: - Update once PR is opened' + api-approved.openshift.io: https://github.com/openshift/api/pull/2171 api.openshift.io/filename-cvo-runlevel: "0000_80" api.openshift.io/filename-operator: machine-config api.openshift.io/filename-ordering: "01" @@ -112,7 +111,7 @@ spec: description: |- configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates - the new machine config against the current machine config. //TODO: check this is only the desired config version + the new machine config against the current machine config. properties: desired: description: |- @@ -149,6 +148,9 @@ spec: description: pinnedImageSets holds the desired pinned image sets that this node should pin and pull. items: + description: |- + MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node + should pin and pull. properties: name: description: |- @@ -295,9 +297,12 @@ spec: pinnedImageSets: description: |- pinnedImageSets describes the current and desired pinned image sets for this node. - The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' - The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' + The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. + The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. items: + description: MachineConfigNodeStatusPinnedImageSet holds information + about the current and desired pinned image sets for the current + observed machine config node. properties: currentGeneration: description: currentGeneration is the generation of the pinned diff --git a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index 21d776c2a33..829f87971fd 100644 --- a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -402,7 +402,7 @@ var map_MachineConfigNodeSpec = map[string]string{ "": "MachineConfigNodeSpec describes the MachineConfigNode we are managing.", "node": "node contains a reference to the node for this machine config node.", "pool": "pool contains a reference to the machine config pool that this machine config node's referenced node belongs to.", - "configVersion": "configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. //TODO: check this is only the desired config version", + "configVersion": "configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config.", "pinnedImageSets": "pinnedImageSets holds the desired pinned image sets that this node should pin and pull.", } @@ -420,6 +420,7 @@ func (MachineConfigNodeSpecMachineConfigVersion) SwaggerDoc() map[string]string } var map_MachineConfigNodeSpecPinnedImageSet = map[string]string{ + "": "MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node should pin and pull.", "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", } @@ -432,7 +433,7 @@ var map_MachineConfigNodeStatus = map[string]string{ "conditions": "conditions represent the observations of a machine config node's current state.", "observedGeneration": "observedGeneration represents the generation observed by the controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec.", "configVersion": "configVersion describes the current and desired machine config for this node. The current version represents the current machine config for the node and is updated after a successful update. The desired version represents the machine config the node will attempt to update to. This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists.", - "pinnedImageSets": "pinnedImageSets describes the current and desired pinned image sets for this node. The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set' The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. //TODO: see if 'version' should be 'pinned image set'", + "pinnedImageSets": "pinnedImageSets describes the current and desired pinned image sets for this node. The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node.", } func (MachineConfigNodeStatus) SwaggerDoc() map[string]string { @@ -440,7 +441,7 @@ func (MachineConfigNodeStatus) SwaggerDoc() map[string]string { } var map_MachineConfigNodeStatusMachineConfigVersion = map[string]string{ - "": "MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will monitor the upgrade process. When the current and desired versions do not match, //TODO: check if this is meant to be a repeat of the previous line the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", + "": "MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will monitor the upgrade process. When the current and desired versions do not match, the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", "current": "current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", "desired": "desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", } @@ -450,6 +451,7 @@ func (MachineConfigNodeStatusMachineConfigVersion) SwaggerDoc() map[string]strin } var map_MachineConfigNodeStatusPinnedImageSet = map[string]string{ + "": "MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current observed machine config node.", "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", "currentGeneration": "currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node.", "desiredGeneration": "desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node.", From 369015f3699ec7d2bd0e59c129d250284a3c4b87 Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Tue, 28 Jan 2025 10:27:16 -0500 Subject: [PATCH 4/9] update rfc1123 validation --- .../v1/types_machineconfignode.go | 57 ++++++------ ...achineconfignodes-CustomNoUpgrade.crd.yaml | 87 +++++++++++++------ ...neconfignodes-DevPreviewNoUpgrade.crd.yaml | 87 +++++++++++++------ ...econfignodes-TechPreviewNoUpgrade.crd.yaml | 87 +++++++++++++------ .../MachineConfigNodes.yaml | 87 +++++++++++++------ .../v1/zz_generated.swagger_doc_generated.go | 12 +-- 6 files changed, 272 insertions(+), 145 deletions(-) diff --git a/machineconfiguration/v1/types_machineconfignode.go b/machineconfiguration/v1/types_machineconfignode.go index 1d5b582e87f..f1b8f5f624c 100644 --- a/machineconfiguration/v1/types_machineconfignode.go +++ b/machineconfiguration/v1/types_machineconfignode.go @@ -98,11 +98,11 @@ type MachineConfigNodeSpec struct { // or modifies in some way type MCOObjectReference struct { // name is the object name. - // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - // It may consist of only alphanumeric characters, hyphens (-) and periods (.) - // and must be at most 253 characters in length. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + // with an alphanumeric character, and be at most 253 characters in length. // +kubebuilder:validation:MaxLength:=253 - // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." // +required Name string `json:"name"` } @@ -142,11 +142,11 @@ type MachineConfigNodeStatus struct { // +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) ? has(self.desiredGeneration): true",message="desired generation must be defined if last failed generation is defined" type MachineConfigNodeStatusPinnedImageSet struct { // name is the name of the pinned image set. - // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - // It may consist of only alphanumeric characters, hyphens (-) and periods (.) - // and must be at most 253 characters in length. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + // with an alphanumeric character, and be at most 253 characters in length. // +kubebuilder:validation:MaxLength:=253 - // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." // +required Name string `json:"name"` // currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. @@ -175,21 +175,22 @@ type MachineConfigNodeStatusMachineConfigVersion struct { // current is the name of the machine config currently in use on the node. // This value is updated once the machine config daemon has completed the update of the configuration for the node. // This value should match the desired version unless an upgrade is in progress. - // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - // It may consist of only alphanumeric characters, hyphens (-) and periods (.) - // and must be at most 253 characters in length. - // +kubebuilder:validation:MaxLength=253 - // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + // with an alphanumeric character, and be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." // +optional Current string `json:"current"` // desired is the MachineConfig the node wants to upgrade to. // This value gets set in the machine config node status once the machine config has been validated // against the current machine config. - // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - // It may consist of only alphanumeric characters, hyphens (-) and periods (.) - // and must be at most 253 characters in length. - // +kubebuilder:validation:MaxLength=253 - // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // This value should match the desired version unless an upgrade is in progress. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + // with an alphanumeric character, and be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." // +required Desired string `json:"desired"` } @@ -203,11 +204,12 @@ type MachineConfigNodeSpecMachineConfigVersion struct { // This value is set when the machine config pool generates a new version of its rendered configuration. // When this value is changed, the machine config daemon starts the node upgrade process. // This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. - // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - // It may consist of only alphanumeric characters, hyphens (-) and periods (.) - // and must be at most 253 characters in length. - // +kubebuilder:validation:MaxLength=253 - // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // This value should match the desired version unless an upgrade is in progress. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + // with an alphanumeric character, and be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." // +required Desired string `json:"desired"` } @@ -216,11 +218,12 @@ type MachineConfigNodeSpecMachineConfigVersion struct { // should pin and pull. type MachineConfigNodeSpecPinnedImageSet struct { // name is the name of the pinned image set. - // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - // It may consist of only alphanumeric characters, hyphens (-) and periods (.) - // and must be at most 253 characters in length. + // This value should match the desired version unless an upgrade is in progress. + // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + // with an alphanumeric character, and be at most 253 characters in length. // +kubebuilder:validation:MaxLength:=253 - // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$` + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." // +required Name string `json:"name"` } diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml index 4c56ed62076..4513fbf7125 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml @@ -119,12 +119,17 @@ spec: This value is set when the machine config pool generates a new version of its rendered configuration. When this value is changed, the machine config daemon starts the node upgrade process. This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - desired type: object @@ -135,12 +140,16 @@ spec: name: description: |- name is the object name. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -155,12 +164,17 @@ spec: name: description: |- name is the name of the pinned image set. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -177,12 +191,16 @@ spec: name: description: |- name is the object name. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -268,23 +286,32 @@ spec: current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' desired: description: |- desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - desired type: object @@ -334,12 +361,16 @@ spec: name: description: |- name is the name of the pinned image set. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml index 1cf0cee1e95..bad37619547 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml @@ -119,12 +119,17 @@ spec: This value is set when the machine config pool generates a new version of its rendered configuration. When this value is changed, the machine config daemon starts the node upgrade process. This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - desired type: object @@ -135,12 +140,16 @@ spec: name: description: |- name is the object name. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -155,12 +164,17 @@ spec: name: description: |- name is the name of the pinned image set. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -177,12 +191,16 @@ spec: name: description: |- name is the object name. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -268,23 +286,32 @@ spec: current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' desired: description: |- desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - desired type: object @@ -334,12 +361,16 @@ spec: name: description: |- name is the name of the pinned image set. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml index f8b8d8d499a..08d647be68b 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml @@ -119,12 +119,17 @@ spec: This value is set when the machine config pool generates a new version of its rendered configuration. When this value is changed, the machine config daemon starts the node upgrade process. This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - desired type: object @@ -135,12 +140,16 @@ spec: name: description: |- name is the object name. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -155,12 +164,17 @@ spec: name: description: |- name is the name of the pinned image set. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -177,12 +191,16 @@ spec: name: description: |- name is the object name. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -268,23 +286,32 @@ spec: current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' desired: description: |- desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - desired type: object @@ -334,12 +361,16 @@ spec: name: description: |- name is the name of the pinned image set. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml index e078ac2cb5d..55feafbd734 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml @@ -119,12 +119,17 @@ spec: This value is set when the machine config pool generates a new version of its rendered configuration. When this value is changed, the machine config daemon starts the node upgrade process. This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - desired type: object @@ -135,12 +140,16 @@ spec: name: description: |- name is the object name. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -155,12 +164,17 @@ spec: name: description: |- name is the name of the pinned image set. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -177,12 +191,16 @@ spec: name: description: |- name is the object name. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object @@ -268,23 +286,32 @@ spec: current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' desired: description: |- desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + This value should match the desired version unless an upgrade is in progress. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - desired type: object @@ -334,12 +361,16 @@ spec: name: description: |- name is the name of the pinned image set. - Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - It may consist of only alphanumeric characters, hyphens (-) and periods (.) - and must be at most 253 characters in length. + Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting + of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end + with an alphanumeric character, and be at most 253 characters in length. maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' required: - name type: object diff --git a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index 829f87971fd..0fc9fd80a72 100644 --- a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -370,7 +370,7 @@ func (PoolSynchronizerStatus) SwaggerDoc() map[string]string { var map_MCOObjectReference = map[string]string{ "": "MCOObjectReference holds information about an object the MCO either owns or modifies in some way", - "name": "name is the object name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", + "name": "name is the object name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", } func (MCOObjectReference) SwaggerDoc() map[string]string { @@ -412,7 +412,7 @@ func (MachineConfigNodeSpec) SwaggerDoc() map[string]string { var map_MachineConfigNodeSpecMachineConfigVersion = map[string]string{ "": "MachineConfigNodeSpecMachineConfigVersion holds the desired config version for the current observed machine config node. When Current is not equal to Desired; the MachineConfigOperator is in an upgrade phase and the machine config node will take account of upgrade related events. Otherwise they will be ignored given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", - "desired": "desired is the name of the machine config that the the node should be upgraded to. This value is set when the machine config pool generates a new version of its rendered configuration. When this value is changed, the machine config daemon starts the node upgrade process. This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", + "desired": "desired is the name of the machine config that the the node should be upgraded to. This value is set when the machine config pool generates a new version of its rendered configuration. When this value is changed, the machine config daemon starts the node upgrade process. This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", } func (MachineConfigNodeSpecMachineConfigVersion) SwaggerDoc() map[string]string { @@ -421,7 +421,7 @@ func (MachineConfigNodeSpecMachineConfigVersion) SwaggerDoc() map[string]string var map_MachineConfigNodeSpecPinnedImageSet = map[string]string{ "": "MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node should pin and pull.", - "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", + "name": "name is the name of the pinned image set. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", } func (MachineConfigNodeSpecPinnedImageSet) SwaggerDoc() map[string]string { @@ -442,8 +442,8 @@ func (MachineConfigNodeStatus) SwaggerDoc() map[string]string { var map_MachineConfigNodeStatusMachineConfigVersion = map[string]string{ "": "MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will monitor the upgrade process. When the current and desired versions do not match, the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", - "current": "current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", - "desired": "desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", + "current": "current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", + "desired": "desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", } func (MachineConfigNodeStatusMachineConfigVersion) SwaggerDoc() map[string]string { @@ -452,7 +452,7 @@ func (MachineConfigNodeStatusMachineConfigVersion) SwaggerDoc() map[string]strin var map_MachineConfigNodeStatusPinnedImageSet = map[string]string{ "": "MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current observed machine config node.", - "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) It may consist of only alphanumeric characters, hyphens (-) and periods (.) and must be at most 253 characters in length.", + "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", "currentGeneration": "currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node.", "desiredGeneration": "desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node.", "lastFailedGeneration": "lastFailedGeneration is the generation of the most recent pinned image set that failed to be pulled and pinned on this node.", From 5977184cd5d974ccbc9caa53d630e0e64da0a6c0 Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Thu, 30 Jan 2025 15:56:48 -0500 Subject: [PATCH 5/9] update descriptions, types, and validation --- .../v1/types_machineconfignode.go | 20 ++++++++++++--- ...achineconfignodes-CustomNoUpgrade.crd.yaml | 25 ++++++++++++++++--- ...neconfignodes-DevPreviewNoUpgrade.crd.yaml | 25 ++++++++++++++++--- ...econfignodes-TechPreviewNoUpgrade.crd.yaml | 25 ++++++++++++++++--- .../v1/zz_generated.deepcopy.go | 18 ++++++++++++- .../MachineConfigNodes.yaml | 25 ++++++++++++++++--- .../v1/zz_generated.swagger_doc_generated.go | 11 +++++++- 7 files changed, 127 insertions(+), 22 deletions(-) diff --git a/machineconfiguration/v1/types_machineconfignode.go b/machineconfiguration/v1/types_machineconfignode.go index f1b8f5f624c..b2f32009440 100644 --- a/machineconfiguration/v1/types_machineconfignode.go +++ b/machineconfiguration/v1/types_machineconfignode.go @@ -86,7 +86,7 @@ type MachineConfigNodeSpec struct { // +required ConfigVersion MachineConfigNodeSpecMachineConfigVersion `json:"configVersion"` - // pinnedImageSets holds the desired pinned image sets that this node should pin and pull. + // pinnedImageSets is a user defined value that holds the names of the desired pinned image sets that the node should pull and pin. // +listType=map // +listMapKey=name // +kubebuilder:validation:MaxItems=100 @@ -118,8 +118,10 @@ type MachineConfigNodeStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // observedGeneration represents the generation observed by the controller. // This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. - // +required - ObservedGeneration int64 `json:"observedGeneration"` + // +kubebuilder:validation:XValidation:rule="self >= oldSelf", message="observedGeneration must not move backwards" + // +kubebuilder:validation:Minimum=0 + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` // configVersion describes the current and desired machine config for this node. // The current version represents the current machine config for the node and is updated after a successful update. // The desired version represents the machine config the node will attempt to update to. @@ -162,8 +164,10 @@ type MachineConfigNodeStatusPinnedImageSet struct { LastFailedGeneration int32 `json:"lastFailedGeneration,omitempty"` // lastFailedGenerationErrors is a list of errors why the lastFailed generation failed to be pulled and pinned. // +kubebuilder:validation:MaxItems=10 + // +listType=map + // +listMapKey=message // +optional - LastFailedGenerationErrors []string `json:"lastFailedGenerationErrors,omitempty"` + LastFailedGenerationErrors []MachineConfigNodeStatusPinnedImageSetError `json:"lastFailedGenerationErrors,omitempty"` } // MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. @@ -228,8 +232,16 @@ type MachineConfigNodeSpecPinnedImageSet struct { Name string `json:"name"` } +// MachineConfigNodeStatusPinnedImageSetError holds information on the the errors associated with failed attempts at pulling and pinning images +type MachineConfigNodeStatusPinnedImageSetError struct { + // message is the message of the pinned image error. + // +required + Message string `json:"message"` +} + // StateProgress is each possible state for each possible MachineConfigNodeType // UpgradeProgression Kind will only use the "MachinConfigPoolUpdate..." types for example +// +enum type StateProgress string const ( diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml index 4513fbf7125..4c3defbb2f9 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml @@ -154,8 +154,9 @@ spec: - name type: object pinnedImageSets: - description: pinnedImageSets holds the desired pinned image sets that - this node should pin and pull. + description: pinnedImageSets is a user defined value that holds the + names of the desired pinned image sets that the node should pull + and pin. items: description: |- MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node @@ -320,7 +321,11 @@ spec: observedGeneration represents the generation observed by the controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. format: int64 + minimum: 0 type: integer + x-kubernetes-validations: + - message: observedGeneration must not move backwards + rule: self >= oldSelf pinnedImageSets: description: |- pinnedImageSets describes the current and desired pinned image sets for this node. @@ -355,9 +360,22 @@ spec: description: lastFailedGenerationErrors is a list of errors why the lastFailed generation failed to be pulled and pinned. items: - type: string + description: MachineConfigNodeStatusPinnedImageSetError holds + information on the the errors associated with failed attempts + at pulling and pinning images + properties: + message: + description: message is the message of the pinned image + error. + type: string + required: + - message + type: object maxItems: 10 type: array + x-kubernetes-list-map-keys: + - message + x-kubernetes-list-type: map name: description: |- name is the name of the pinned image set. @@ -393,7 +411,6 @@ spec: x-kubernetes-list-type: map required: - configVersion - - observedGeneration type: object required: - spec diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml index bad37619547..8fb465ad98f 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml @@ -154,8 +154,9 @@ spec: - name type: object pinnedImageSets: - description: pinnedImageSets holds the desired pinned image sets that - this node should pin and pull. + description: pinnedImageSets is a user defined value that holds the + names of the desired pinned image sets that the node should pull + and pin. items: description: |- MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node @@ -320,7 +321,11 @@ spec: observedGeneration represents the generation observed by the controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. format: int64 + minimum: 0 type: integer + x-kubernetes-validations: + - message: observedGeneration must not move backwards + rule: self >= oldSelf pinnedImageSets: description: |- pinnedImageSets describes the current and desired pinned image sets for this node. @@ -355,9 +360,22 @@ spec: description: lastFailedGenerationErrors is a list of errors why the lastFailed generation failed to be pulled and pinned. items: - type: string + description: MachineConfigNodeStatusPinnedImageSetError holds + information on the the errors associated with failed attempts + at pulling and pinning images + properties: + message: + description: message is the message of the pinned image + error. + type: string + required: + - message + type: object maxItems: 10 type: array + x-kubernetes-list-map-keys: + - message + x-kubernetes-list-type: map name: description: |- name is the name of the pinned image set. @@ -393,7 +411,6 @@ spec: x-kubernetes-list-type: map required: - configVersion - - observedGeneration type: object required: - spec diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml index 08d647be68b..5edcfbbc538 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml @@ -154,8 +154,9 @@ spec: - name type: object pinnedImageSets: - description: pinnedImageSets holds the desired pinned image sets that - this node should pin and pull. + description: pinnedImageSets is a user defined value that holds the + names of the desired pinned image sets that the node should pull + and pin. items: description: |- MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node @@ -320,7 +321,11 @@ spec: observedGeneration represents the generation observed by the controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. format: int64 + minimum: 0 type: integer + x-kubernetes-validations: + - message: observedGeneration must not move backwards + rule: self >= oldSelf pinnedImageSets: description: |- pinnedImageSets describes the current and desired pinned image sets for this node. @@ -355,9 +360,22 @@ spec: description: lastFailedGenerationErrors is a list of errors why the lastFailed generation failed to be pulled and pinned. items: - type: string + description: MachineConfigNodeStatusPinnedImageSetError holds + information on the the errors associated with failed attempts + at pulling and pinning images + properties: + message: + description: message is the message of the pinned image + error. + type: string + required: + - message + type: object maxItems: 10 type: array + x-kubernetes-list-map-keys: + - message + x-kubernetes-list-type: map name: description: |- name is the name of the pinned image set. @@ -393,7 +411,6 @@ spec: x-kubernetes-list-type: map required: - configVersion - - observedGeneration type: object required: - spec diff --git a/machineconfiguration/v1/zz_generated.deepcopy.go b/machineconfiguration/v1/zz_generated.deepcopy.go index c4a50491e29..fadf6f25fcd 100644 --- a/machineconfiguration/v1/zz_generated.deepcopy.go +++ b/machineconfiguration/v1/zz_generated.deepcopy.go @@ -834,7 +834,7 @@ func (in *MachineConfigNodeStatusPinnedImageSet) DeepCopyInto(out *MachineConfig *out = *in if in.LastFailedGenerationErrors != nil { in, out := &in.LastFailedGenerationErrors, &out.LastFailedGenerationErrors - *out = make([]string, len(*in)) + *out = make([]MachineConfigNodeStatusPinnedImageSetError, len(*in)) copy(*out, *in) } return @@ -850,6 +850,22 @@ func (in *MachineConfigNodeStatusPinnedImageSet) DeepCopy() *MachineConfigNodeSt return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeStatusPinnedImageSetError) DeepCopyInto(out *MachineConfigNodeStatusPinnedImageSetError) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeStatusPinnedImageSetError. +func (in *MachineConfigNodeStatusPinnedImageSetError) DeepCopy() *MachineConfigNodeStatusPinnedImageSetError { + if in == nil { + return nil + } + out := new(MachineConfigNodeStatusPinnedImageSetError) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineConfigPool) DeepCopyInto(out *MachineConfigPool) { *out = *in diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml index 55feafbd734..7439c60f246 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml @@ -154,8 +154,9 @@ spec: - name type: object pinnedImageSets: - description: pinnedImageSets holds the desired pinned image sets that - this node should pin and pull. + description: pinnedImageSets is a user defined value that holds the + names of the desired pinned image sets that the node should pull + and pin. items: description: |- MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node @@ -320,7 +321,11 @@ spec: observedGeneration represents the generation observed by the controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. format: int64 + minimum: 0 type: integer + x-kubernetes-validations: + - message: observedGeneration must not move backwards + rule: self >= oldSelf pinnedImageSets: description: |- pinnedImageSets describes the current and desired pinned image sets for this node. @@ -355,9 +360,22 @@ spec: description: lastFailedGenerationErrors is a list of errors why the lastFailed generation failed to be pulled and pinned. items: - type: string + description: MachineConfigNodeStatusPinnedImageSetError holds + information on the the errors associated with failed attempts + at pulling and pinning images + properties: + message: + description: message is the message of the pinned image + error. + type: string + required: + - message + type: object maxItems: 10 type: array + x-kubernetes-list-map-keys: + - message + x-kubernetes-list-type: map name: description: |- name is the name of the pinned image set. @@ -393,7 +411,6 @@ spec: x-kubernetes-list-type: map required: - configVersion - - observedGeneration type: object required: - spec diff --git a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index 0fc9fd80a72..a2a7fdb481e 100644 --- a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -403,7 +403,7 @@ var map_MachineConfigNodeSpec = map[string]string{ "node": "node contains a reference to the node for this machine config node.", "pool": "pool contains a reference to the machine config pool that this machine config node's referenced node belongs to.", "configVersion": "configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config.", - "pinnedImageSets": "pinnedImageSets holds the desired pinned image sets that this node should pin and pull.", + "pinnedImageSets": "pinnedImageSets is a user defined value that holds the names of the desired pinned image sets that the node should pull and pin.", } func (MachineConfigNodeSpec) SwaggerDoc() map[string]string { @@ -463,6 +463,15 @@ func (MachineConfigNodeStatusPinnedImageSet) SwaggerDoc() map[string]string { return map_MachineConfigNodeStatusPinnedImageSet } +var map_MachineConfigNodeStatusPinnedImageSetError = map[string]string{ + "": "MachineConfigNodeStatusPinnedImageSetError holds information on the the errors associated with failed attempts at pulling and pinning images", + "message": "message is the message of the pinned image error.", +} + +func (MachineConfigNodeStatusPinnedImageSetError) SwaggerDoc() map[string]string { + return map_MachineConfigNodeStatusPinnedImageSetError +} + var map_MachineConfigReference = map[string]string{ "": "Refers to the name of a rendered MachineConfig (e.g., \"rendered-worker-ec40d2965ff81bce7cd7a7e82a680739\", etc.): the build targets this MachineConfig, this is often used to tell us whether we need an update.", "name": "name is the name of the rendered MachineConfig object. This value should be between 10 and 253 characters, and must contain only lowercase alphanumeric characters, hyphens and periods, and should start and end with an alphanumeric character.", From 8bb354ef7d32fe6db0c9e3b09a263faaafa7378d Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Mon, 3 Feb 2025 12:22:59 -0500 Subject: [PATCH 6/9] update doc comments --- .../v1/types_machineconfignode.go | 28 +++++++++-------- ...achineconfignodes-CustomNoUpgrade.crd.yaml | 31 +++++++++---------- ...neconfignodes-DevPreviewNoUpgrade.crd.yaml | 31 +++++++++---------- ...econfignodes-TechPreviewNoUpgrade.crd.yaml | 31 +++++++++---------- .../MachineConfigNodes.yaml | 31 +++++++++---------- .../v1/zz_generated.swagger_doc_generated.go | 16 +++++----- 6 files changed, 83 insertions(+), 85 deletions(-) diff --git a/machineconfiguration/v1/types_machineconfignode.go b/machineconfiguration/v1/types_machineconfignode.go index b2f32009440..6841ae24ff7 100644 --- a/machineconfiguration/v1/types_machineconfignode.go +++ b/machineconfiguration/v1/types_machineconfignode.go @@ -84,9 +84,11 @@ type MachineConfigNodeSpec struct { // The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates // the new machine config against the current machine config. // +required + // TODO: Potentially remove since it might be redundant. There may need to be some changes to how ObservedGeneration is updated if this field + // is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. ConfigVersion MachineConfigNodeSpecMachineConfigVersion `json:"configVersion"` - // pinnedImageSets is a user defined value that holds the names of the desired pinned image sets that the node should pull and pin. + // pinnedImageSets is a user defined value that holds the names of the desired image sets that the node should pull and pin. // +listType=map // +listMapKey=name // +kubebuilder:validation:MaxItems=100 @@ -97,7 +99,8 @@ type MachineConfigNodeSpec struct { // MCOObjectReference holds information about an object the MCO either owns // or modifies in some way type MCOObjectReference struct { - // name is the object name. + // name is the name of the object being referenced. For example, this can represent a pool + // or node name. // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting // of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end // with an alphanumeric character, and be at most 253 characters in length. @@ -115,22 +118,18 @@ type MachineConfigNodeStatus struct { // +listType=map // +listMapKey=type // +optional + // TODO: add max length validation. Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` - // observedGeneration represents the generation observed by the controller. + // observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. // This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. // +kubebuilder:validation:XValidation:rule="self >= oldSelf", message="observedGeneration must not move backwards" // +kubebuilder:validation:Minimum=0 // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` - // configVersion describes the current and desired machine config for this node. - // The current version represents the current machine config for the node and is updated after a successful update. - // The desired version represents the machine config the node will attempt to update to. - // This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + // configVersion describes the current and desired machine config version for this node. // +required ConfigVersion MachineConfigNodeStatusMachineConfigVersion `json:"configVersion"` // pinnedImageSets describes the current and desired pinned image sets for this node. - // The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. - // The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. // +listType=map // +listMapKey=name // +kubebuilder:validation:MaxItems=100 @@ -140,7 +139,7 @@ type MachineConfigNodeStatus struct { // MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current observed machine config node. // +kubebuilder:validation:XValidation:rule="has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true",message="desired generation must be greater than or equal to the current generation" -// +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true",message="desired generation must be greater than last failed generation" +// +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true",message="desired generation must be greater than or equal to last failed generation" // +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) ? has(self.desiredGeneration): true",message="desired generation must be defined if last failed generation is defined" type MachineConfigNodeStatusPinnedImageSet struct { // name is the name of the pinned image set. @@ -162,7 +161,7 @@ type MachineConfigNodeStatusPinnedImageSet struct { // +kubebuilder:validation:Minimum=0 // +optional LastFailedGeneration int32 `json:"lastFailedGeneration,omitempty"` - // lastFailedGenerationErrors is a list of errors why the lastFailed generation failed to be pulled and pinned. + // lastFailedGenerationErrors is a list of errors explaining why the lastFailed generation failed to be pulled and pinned. // +kubebuilder:validation:MaxItems=10 // +listType=map // +listMapKey=message @@ -174,7 +173,8 @@ type MachineConfigNodeStatusPinnedImageSet struct { // When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will // monitor the upgrade process. // When the current and desired versions do not match, the machine config node will ignore these events given that certain operations -// happen both during the MCO's upgrade mode and the daily operations mode. +// happen both during the MCO's upgrade mode and the daily operations mode. //TODO: Check if this should instead say *do* match to be consistent +// with comment on lines 204-205. type MachineConfigNodeStatusMachineConfigVersion struct { // current is the name of the machine config currently in use on the node. // This value is updated once the machine config daemon has completed the update of the configuration for the node. @@ -236,14 +236,16 @@ type MachineConfigNodeSpecPinnedImageSet struct { type MachineConfigNodeStatusPinnedImageSetError struct { // message is the message of the pinned image error. // +required + // TODO: Add max length. Message string `json:"message"` } // StateProgress is each possible state for each possible MachineConfigNodeType -// UpgradeProgression Kind will only use the "MachinConfigPoolUpdate..." types for example +// UpgradeProgression Kind will only use the "MachinConfigPoolUpdate..." types for example //TODO: figure out how to make comment more relevant. // +enum type StateProgress string +// TODO: Trim down to only helpful statues, prioritizing OCL status needs. Relevant PR: https://github.com/openshift/api/pull/1596 const ( // MachineConfigNodeUpdatePrepared describes a machine that is preparing in the daemon to trigger an update MachineConfigNodeUpdatePrepared StateProgress = "UpdatePrepared" diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml index 4c3defbb2f9..d125e0aef76 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml @@ -112,6 +112,7 @@ spec: configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. + is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. properties: desired: description: |- @@ -139,7 +140,8 @@ spec: properties: name: description: |- - name is the object name. + name is the name of the object being referenced. For example, this can represent a pool + or node name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length. @@ -155,8 +157,7 @@ spec: type: object pinnedImageSets: description: pinnedImageSets is a user defined value that holds the - names of the desired pinned image sets that the node should pull - and pin. + names of the desired image sets that the node should pull and pin. items: description: |- MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node @@ -191,7 +192,8 @@ spec: properties: name: description: |- - name is the object name. + name is the name of the object being referenced. For example, this can represent a pool + or node name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length. @@ -276,11 +278,8 @@ spec: - type x-kubernetes-list-type: map configVersion: - description: |- - configVersion describes the current and desired machine config for this node. - The current version represents the current machine config for the node and is updated after a successful update. - The desired version represents the machine config the node will attempt to update to. - This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + description: configVersion describes the current and desired machine + config version for this node. properties: current: description: |- @@ -318,7 +317,7 @@ spec: type: object observedGeneration: description: |- - observedGeneration represents the generation observed by the controller. + observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. format: int64 minimum: 0 @@ -327,10 +326,8 @@ spec: - message: observedGeneration must not move backwards rule: self >= oldSelf pinnedImageSets: - description: |- - pinnedImageSets describes the current and desired pinned image sets for this node. - The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. - The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. + description: pinnedImageSets describes the current and desired pinned + image sets for this node. items: description: MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current @@ -358,7 +355,8 @@ spec: type: integer lastFailedGenerationErrors: description: lastFailedGenerationErrors is a list of errors - why the lastFailed generation failed to be pulled and pinned. + explaining why the lastFailed generation failed to be pulled + and pinned. items: description: MachineConfigNodeStatusPinnedImageSetError holds information on the the errors associated with failed attempts @@ -397,7 +395,8 @@ spec: current generation rule: 'has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true' - - message: desired generation must be greater than last failed generation + - message: desired generation must be greater than or equal to last + failed generation rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true' - message: desired generation must be defined if last failed generation diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml index 8fb465ad98f..ccab1a20363 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml @@ -112,6 +112,7 @@ spec: configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. + is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. properties: desired: description: |- @@ -139,7 +140,8 @@ spec: properties: name: description: |- - name is the object name. + name is the name of the object being referenced. For example, this can represent a pool + or node name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length. @@ -155,8 +157,7 @@ spec: type: object pinnedImageSets: description: pinnedImageSets is a user defined value that holds the - names of the desired pinned image sets that the node should pull - and pin. + names of the desired image sets that the node should pull and pin. items: description: |- MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node @@ -191,7 +192,8 @@ spec: properties: name: description: |- - name is the object name. + name is the name of the object being referenced. For example, this can represent a pool + or node name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length. @@ -276,11 +278,8 @@ spec: - type x-kubernetes-list-type: map configVersion: - description: |- - configVersion describes the current and desired machine config for this node. - The current version represents the current machine config for the node and is updated after a successful update. - The desired version represents the machine config the node will attempt to update to. - This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + description: configVersion describes the current and desired machine + config version for this node. properties: current: description: |- @@ -318,7 +317,7 @@ spec: type: object observedGeneration: description: |- - observedGeneration represents the generation observed by the controller. + observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. format: int64 minimum: 0 @@ -327,10 +326,8 @@ spec: - message: observedGeneration must not move backwards rule: self >= oldSelf pinnedImageSets: - description: |- - pinnedImageSets describes the current and desired pinned image sets for this node. - The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. - The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. + description: pinnedImageSets describes the current and desired pinned + image sets for this node. items: description: MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current @@ -358,7 +355,8 @@ spec: type: integer lastFailedGenerationErrors: description: lastFailedGenerationErrors is a list of errors - why the lastFailed generation failed to be pulled and pinned. + explaining why the lastFailed generation failed to be pulled + and pinned. items: description: MachineConfigNodeStatusPinnedImageSetError holds information on the the errors associated with failed attempts @@ -397,7 +395,8 @@ spec: current generation rule: 'has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true' - - message: desired generation must be greater than last failed generation + - message: desired generation must be greater than or equal to last + failed generation rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true' - message: desired generation must be defined if last failed generation diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml index 5edcfbbc538..b8d7232efea 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml @@ -112,6 +112,7 @@ spec: configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. + is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. properties: desired: description: |- @@ -139,7 +140,8 @@ spec: properties: name: description: |- - name is the object name. + name is the name of the object being referenced. For example, this can represent a pool + or node name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length. @@ -155,8 +157,7 @@ spec: type: object pinnedImageSets: description: pinnedImageSets is a user defined value that holds the - names of the desired pinned image sets that the node should pull - and pin. + names of the desired image sets that the node should pull and pin. items: description: |- MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node @@ -191,7 +192,8 @@ spec: properties: name: description: |- - name is the object name. + name is the name of the object being referenced. For example, this can represent a pool + or node name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length. @@ -276,11 +278,8 @@ spec: - type x-kubernetes-list-type: map configVersion: - description: |- - configVersion describes the current and desired machine config for this node. - The current version represents the current machine config for the node and is updated after a successful update. - The desired version represents the machine config the node will attempt to update to. - This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + description: configVersion describes the current and desired machine + config version for this node. properties: current: description: |- @@ -318,7 +317,7 @@ spec: type: object observedGeneration: description: |- - observedGeneration represents the generation observed by the controller. + observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. format: int64 minimum: 0 @@ -327,10 +326,8 @@ spec: - message: observedGeneration must not move backwards rule: self >= oldSelf pinnedImageSets: - description: |- - pinnedImageSets describes the current and desired pinned image sets for this node. - The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. - The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. + description: pinnedImageSets describes the current and desired pinned + image sets for this node. items: description: MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current @@ -358,7 +355,8 @@ spec: type: integer lastFailedGenerationErrors: description: lastFailedGenerationErrors is a list of errors - why the lastFailed generation failed to be pulled and pinned. + explaining why the lastFailed generation failed to be pulled + and pinned. items: description: MachineConfigNodeStatusPinnedImageSetError holds information on the the errors associated with failed attempts @@ -397,7 +395,8 @@ spec: current generation rule: 'has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true' - - message: desired generation must be greater than last failed generation + - message: desired generation must be greater than or equal to last + failed generation rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true' - message: desired generation must be defined if last failed generation diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml index 7439c60f246..0c8f42d8c9f 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml @@ -112,6 +112,7 @@ spec: configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. + is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. properties: desired: description: |- @@ -139,7 +140,8 @@ spec: properties: name: description: |- - name is the object name. + name is the name of the object being referenced. For example, this can represent a pool + or node name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length. @@ -155,8 +157,7 @@ spec: type: object pinnedImageSets: description: pinnedImageSets is a user defined value that holds the - names of the desired pinned image sets that the node should pull - and pin. + names of the desired image sets that the node should pull and pin. items: description: |- MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node @@ -191,7 +192,8 @@ spec: properties: name: description: |- - name is the object name. + name is the name of the object being referenced. For example, this can represent a pool + or node name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length. @@ -276,11 +278,8 @@ spec: - type x-kubernetes-list-type: map configVersion: - description: |- - configVersion describes the current and desired machine config for this node. - The current version represents the current machine config for the node and is updated after a successful update. - The desired version represents the machine config the node will attempt to update to. - This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists. + description: configVersion describes the current and desired machine + config version for this node. properties: current: description: |- @@ -318,7 +317,7 @@ spec: type: object observedGeneration: description: |- - observedGeneration represents the generation observed by the controller. + observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. format: int64 minimum: 0 @@ -327,10 +326,8 @@ spec: - message: observedGeneration must not move backwards rule: self >= oldSelf pinnedImageSets: - description: |- - pinnedImageSets describes the current and desired pinned image sets for this node. - The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. - The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node. + description: pinnedImageSets describes the current and desired pinned + image sets for this node. items: description: MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current @@ -358,7 +355,8 @@ spec: type: integer lastFailedGenerationErrors: description: lastFailedGenerationErrors is a list of errors - why the lastFailed generation failed to be pulled and pinned. + explaining why the lastFailed generation failed to be pulled + and pinned. items: description: MachineConfigNodeStatusPinnedImageSetError holds information on the the errors associated with failed attempts @@ -397,7 +395,8 @@ spec: current generation rule: 'has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true' - - message: desired generation must be greater than last failed generation + - message: desired generation must be greater than or equal to last + failed generation rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true' - message: desired generation must be defined if last failed generation diff --git a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index a2a7fdb481e..7597a7f9ff6 100644 --- a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -370,7 +370,7 @@ func (PoolSynchronizerStatus) SwaggerDoc() map[string]string { var map_MCOObjectReference = map[string]string{ "": "MCOObjectReference holds information about an object the MCO either owns or modifies in some way", - "name": "name is the object name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", + "name": "name is the name of the object being referenced. For example, this can represent a pool or node name. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", } func (MCOObjectReference) SwaggerDoc() map[string]string { @@ -402,8 +402,8 @@ var map_MachineConfigNodeSpec = map[string]string{ "": "MachineConfigNodeSpec describes the MachineConfigNode we are managing.", "node": "node contains a reference to the node for this machine config node.", "pool": "pool contains a reference to the machine config pool that this machine config node's referenced node belongs to.", - "configVersion": "configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config.", - "pinnedImageSets": "pinnedImageSets is a user defined value that holds the names of the desired pinned image sets that the node should pull and pin.", + "configVersion": "configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. is consolidated with MachineConfigNodeStatus.ConfigVersion.Current.", + "pinnedImageSets": "pinnedImageSets is a user defined value that holds the names of the desired image sets that the node should pull and pin.", } func (MachineConfigNodeSpec) SwaggerDoc() map[string]string { @@ -431,9 +431,9 @@ func (MachineConfigNodeSpecPinnedImageSet) SwaggerDoc() map[string]string { var map_MachineConfigNodeStatus = map[string]string{ "": "MachineConfigNodeStatus holds the reported information on a particular machine config node.", "conditions": "conditions represent the observations of a machine config node's current state.", - "observedGeneration": "observedGeneration represents the generation observed by the controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec.", - "configVersion": "configVersion describes the current and desired machine config for this node. The current version represents the current machine config for the node and is updated after a successful update. The desired version represents the machine config the node will attempt to update to. This desired machine config has been compared to the current machine config and has been validated by the machine config operator as one that is valid and that exists.", - "pinnedImageSets": "pinnedImageSets describes the current and desired pinned image sets for this node. The current version is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. The desired version is the generation of the pinned image set that is targeted to be pulled and pinned on this node.", + "observedGeneration": "observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec.", + "configVersion": "configVersion describes the current and desired machine config version for this node.", + "pinnedImageSets": "pinnedImageSets describes the current and desired pinned image sets for this node.", } func (MachineConfigNodeStatus) SwaggerDoc() map[string]string { @@ -441,7 +441,7 @@ func (MachineConfigNodeStatus) SwaggerDoc() map[string]string { } var map_MachineConfigNodeStatusMachineConfigVersion = map[string]string{ - "": "MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will monitor the upgrade process. When the current and desired versions do not match, the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", + "": "MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will monitor the upgrade process. When the current and desired versions do not match, the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode. //TODO: Check if this should instead say *do* match to be consistent with comment on lines 204-205.", "current": "current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", "desired": "desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", } @@ -456,7 +456,7 @@ var map_MachineConfigNodeStatusPinnedImageSet = map[string]string{ "currentGeneration": "currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node.", "desiredGeneration": "desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node.", "lastFailedGeneration": "lastFailedGeneration is the generation of the most recent pinned image set that failed to be pulled and pinned on this node.", - "lastFailedGenerationErrors": "lastFailedGenerationErrors is a list of errors why the lastFailed generation failed to be pulled and pinned.", + "lastFailedGenerationErrors": "lastFailedGenerationErrors is a list of errors explaining why the lastFailed generation failed to be pulled and pinned.", } func (MachineConfigNodeStatusPinnedImageSet) SwaggerDoc() map[string]string { From a838189b3804ce15cf743923bbfe0ae6e4599db4 Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Tue, 4 Feb 2025 14:33:27 -0500 Subject: [PATCH 7/9] update maxitems for lists --- machineconfiguration/v1/types_machineconfignode.go | 8 ++++++-- ...-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml | 2 ++ ...fig_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml | 2 ++ ...ig_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml | 2 ++ .../MachineConfigNodes.yaml | 2 ++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/machineconfiguration/v1/types_machineconfignode.go b/machineconfiguration/v1/types_machineconfignode.go index 6841ae24ff7..a4dd4e868d6 100644 --- a/machineconfiguration/v1/types_machineconfignode.go +++ b/machineconfiguration/v1/types_machineconfignode.go @@ -65,7 +65,9 @@ type MachineConfigNodeList struct { metav1.ListMeta `json:"metadata"` // items contains a collection of MachineConfigNode resources. + // +kubebuilder:validation:MaxItems=100000 // +optional + // TODO: Decide on an appropriate maxItems value for this list of MachineConfigNodes. There is a 1:1 ratio between # of nodes & MCN objects. Items []MachineConfigNode `json:"items"` } @@ -117,8 +119,9 @@ type MachineConfigNodeStatus struct { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +kubebuilder:validation:MaxItems=15 // +optional - // TODO: add max length validation. + // TODO: Reevaluate maxItems value as status are trimmed down/API structure is updated. Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. // This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. @@ -235,8 +238,9 @@ type MachineConfigNodeSpecPinnedImageSet struct { // MachineConfigNodeStatusPinnedImageSetError holds information on the the errors associated with failed attempts at pulling and pinning images type MachineConfigNodeStatusPinnedImageSetError struct { // message is the message of the pinned image error. + // +kubebuilder:validation:MaxLength=2048 // +required - // TODO: Add max length. + // TODO: Update MaxLength value once this API design has been reevaluated. Message string `json:"message"` } diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml index d125e0aef76..24113383f5f 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml @@ -273,6 +273,7 @@ spec: - status - type type: object + maxItems: 15 type: array x-kubernetes-list-map-keys: - type @@ -365,6 +366,7 @@ spec: message: description: message is the message of the pinned image error. + maxLength: 2048 type: string required: - message diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml index ccab1a20363..c6c81dd8726 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml @@ -273,6 +273,7 @@ spec: - status - type type: object + maxItems: 15 type: array x-kubernetes-list-map-keys: - type @@ -365,6 +366,7 @@ spec: message: description: message is the message of the pinned image error. + maxLength: 2048 type: string required: - message diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml index b8d7232efea..0c8dcbf376a 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml @@ -273,6 +273,7 @@ spec: - status - type type: object + maxItems: 15 type: array x-kubernetes-list-map-keys: - type @@ -365,6 +366,7 @@ spec: message: description: message is the message of the pinned image error. + maxLength: 2048 type: string required: - message diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml index 0c8f42d8c9f..7c1ce3106e6 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml @@ -273,6 +273,7 @@ spec: - status - type type: object + maxItems: 15 type: array x-kubernetes-list-map-keys: - type @@ -365,6 +366,7 @@ spec: message: description: message is the message of the pinned image error. + maxLength: 2048 type: string required: - message From 9d9b456e7a0f1dd4df34e7cce2883c16474fdaf0 Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Thu, 6 Feb 2025 12:47:06 -0500 Subject: [PATCH 8/9] update descriptions --- .../v1/types_machineconfignode.go | 19 ++++++++----------- ...achineconfignodes-CustomNoUpgrade.crd.yaml | 1 - ...neconfignodes-DevPreviewNoUpgrade.crd.yaml | 1 - ...econfignodes-TechPreviewNoUpgrade.crd.yaml | 1 - .../MachineConfigNodes.yaml | 1 - .../v1/zz_generated.swagger_doc_generated.go | 6 +++--- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/machineconfiguration/v1/types_machineconfignode.go b/machineconfiguration/v1/types_machineconfignode.go index a4dd4e868d6..247997e4fa5 100644 --- a/machineconfiguration/v1/types_machineconfignode.go +++ b/machineconfiguration/v1/types_machineconfignode.go @@ -86,8 +86,7 @@ type MachineConfigNodeSpec struct { // The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates // the new machine config against the current machine config. // +required - // TODO: Potentially remove since it might be redundant. There may need to be some changes to how ObservedGeneration is updated if this field - // is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. + // TODO: Potentially remove in favor of/consolidate with MachineConfigNodeStatus.ConfigVersion.Current. Changes to this field may require updates to how ObservedGeneration is updated. ConfigVersion MachineConfigNodeSpecMachineConfigVersion `json:"configVersion"` // pinnedImageSets is a user defined value that holds the names of the desired image sets that the node should pull and pin. @@ -121,7 +120,7 @@ type MachineConfigNodeStatus struct { // +listMapKey=type // +kubebuilder:validation:MaxItems=15 // +optional - // TODO: Reevaluate maxItems value as status are trimmed down/API structure is updated. + // TODO: Reevaluate maxItems value as statuses are trimmed down/API structure is updated. Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. // This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. @@ -173,11 +172,10 @@ type MachineConfigNodeStatusPinnedImageSet struct { } // MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. -// When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will +// When the current and desired versions do not matched, the machine config pool is processing an upgrade and the machine config node will // monitor the upgrade process. -// When the current and desired versions do not match, the machine config node will ignore these events given that certain operations -// happen both during the MCO's upgrade mode and the daily operations mode. //TODO: Check if this should instead say *do* match to be consistent -// with comment on lines 204-205. +// When the current and desired versions do match, the machine config node will ignore these events given that certain operations +// happen both during the MCO's upgrade mode and the daily operations mode. //TODO: Check correctness of description. type MachineConfigNodeStatusMachineConfigVersion struct { // current is the name of the machine config currently in use on the node. // This value is updated once the machine config daemon has completed the update of the configuration for the node. @@ -203,8 +201,8 @@ type MachineConfigNodeStatusMachineConfigVersion struct { } // MachineConfigNodeSpecMachineConfigVersion holds the desired config version for the current observed machine config node. -// When Current is not equal to Desired; the MachineConfigOperator is in an upgrade phase and the machine config node will -// take account of upgrade related events. Otherwise they will be ignored given that certain operations +// When Current is not equal to Desired, the MachineConfigOperator is in an upgrade phase and the machine config node will +// take account of upgrade related events. Otherwise, they will be ignored given that certain operations // happen both during the MCO's upgrade mode and the daily operations mode. type MachineConfigNodeSpecMachineConfigVersion struct { // desired is the name of the machine config that the the node should be upgraded to. @@ -244,8 +242,7 @@ type MachineConfigNodeStatusPinnedImageSetError struct { Message string `json:"message"` } -// StateProgress is each possible state for each possible MachineConfigNodeType -// UpgradeProgression Kind will only use the "MachinConfigPoolUpdate..." types for example //TODO: figure out how to make comment more relevant. +// StateProgress highlights the possible states for each possible MachineConfigNodeType to be tracked in Conditions. // +enum type StateProgress string diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml index 24113383f5f..f99523c0ec6 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml @@ -112,7 +112,6 @@ spec: configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. - is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. properties: desired: description: |- diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml index c6c81dd8726..79ea879a6d0 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml @@ -112,7 +112,6 @@ spec: configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. - is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. properties: desired: description: |- diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml index 0c8dcbf376a..6babbf4e8ef 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml @@ -112,7 +112,6 @@ spec: configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. - is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. properties: desired: description: |- diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml index 7c1ce3106e6..5efa400fd81 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml @@ -112,7 +112,6 @@ spec: configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. - is consolidated with MachineConfigNodeStatus.ConfigVersion.Current. properties: desired: description: |- diff --git a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index 7597a7f9ff6..14c2052797e 100644 --- a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -402,7 +402,7 @@ var map_MachineConfigNodeSpec = map[string]string{ "": "MachineConfigNodeSpec describes the MachineConfigNode we are managing.", "node": "node contains a reference to the node for this machine config node.", "pool": "pool contains a reference to the machine config pool that this machine config node's referenced node belongs to.", - "configVersion": "configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config. is consolidated with MachineConfigNodeStatus.ConfigVersion.Current.", + "configVersion": "configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to. This gets set before the machine config operator validates the new machine config against the current machine config.", "pinnedImageSets": "pinnedImageSets is a user defined value that holds the names of the desired image sets that the node should pull and pin.", } @@ -411,7 +411,7 @@ func (MachineConfigNodeSpec) SwaggerDoc() map[string]string { } var map_MachineConfigNodeSpecMachineConfigVersion = map[string]string{ - "": "MachineConfigNodeSpecMachineConfigVersion holds the desired config version for the current observed machine config node. When Current is not equal to Desired; the MachineConfigOperator is in an upgrade phase and the machine config node will take account of upgrade related events. Otherwise they will be ignored given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", + "": "MachineConfigNodeSpecMachineConfigVersion holds the desired config version for the current observed machine config node. When Current is not equal to Desired, the MachineConfigOperator is in an upgrade phase and the machine config node will take account of upgrade related events. Otherwise, they will be ignored given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", "desired": "desired is the name of the machine config that the the node should be upgraded to. This value is set when the machine config pool generates a new version of its rendered configuration. When this value is changed, the machine config daemon starts the node upgrade process. This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", } @@ -441,7 +441,7 @@ func (MachineConfigNodeStatus) SwaggerDoc() map[string]string { } var map_MachineConfigNodeStatusMachineConfigVersion = map[string]string{ - "": "MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. When the current and desired versions are not matched, the machine config pool is processing an upgrade and the machine config node will monitor the upgrade process. When the current and desired versions do not match, the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode. //TODO: Check if this should instead say *do* match to be consistent with comment on lines 204-205.", + "": "MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. When the current and desired versions do not matched, the machine config pool is processing an upgrade and the machine config node will monitor the upgrade process. When the current and desired versions do match, the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode. //TODO: Check correctness of description.", "current": "current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", "desired": "desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", } From 8f08686533189e3e7b65e383135db034bc2fae77 Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Wed, 12 Feb 2025 09:58:20 -0500 Subject: [PATCH 9/9] update PIS section of MCN object --- .../v1/types_machineconfignode.go | 19 +++---- ...achineconfignodes-CustomNoUpgrade.crd.yaml | 54 ++++++------------- ...neconfignodes-DevPreviewNoUpgrade.crd.yaml | 54 ++++++------------- ...econfignodes-TechPreviewNoUpgrade.crd.yaml | 54 ++++++------------- .../v1/zz_generated.deepcopy.go | 9 +--- .../MachineConfigNodes.yaml | 54 ++++++------------- .../v1/zz_generated.swagger_doc_generated.go | 11 ++-- 7 files changed, 82 insertions(+), 173 deletions(-) diff --git a/machineconfiguration/v1/types_machineconfignode.go b/machineconfiguration/v1/types_machineconfignode.go index 247997e4fa5..7ff19044de9 100644 --- a/machineconfiguration/v1/types_machineconfignode.go +++ b/machineconfiguration/v1/types_machineconfignode.go @@ -141,8 +141,7 @@ type MachineConfigNodeStatus struct { // MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current observed machine config node. // +kubebuilder:validation:XValidation:rule="has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true",message="desired generation must be greater than or equal to the current generation" -// +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true",message="desired generation must be greater than or equal to last failed generation" -// +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) ? has(self.desiredGeneration): true",message="desired generation must be defined if last failed generation is defined" +// +kubebuilder:validation:XValidation:rule="has(self.desiredGeneration) && has(self.currentGeneration) && self.desiredGeneration != self.currentGeneration ? has(self.lastSeenError) : true",message="error must be populated on image pull and pin failure" type MachineConfigNodeStatusPinnedImageSet struct { // name is the name of the pinned image set. // Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting @@ -153,22 +152,20 @@ type MachineConfigNodeStatusPinnedImageSet struct { // +required Name string `json:"name"` // currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. + // +kubebuilder:validation:XValidation:rule="self >= oldSelf", message="currentGeneration must not move backwards" + // +kubebuilder:validation:Minimum=0 // +optional CurrentGeneration int32 `json:"currentGeneration,omitempty"` // desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node. + // +kubebuilder:validation:XValidation:rule="self >= oldSelf", message="desiredGeneration must not move backwards" // +kubebuilder:validation:Minimum=0 // +optional DesiredGeneration int32 `json:"desiredGeneration,omitempty"` - // lastFailedGeneration is the generation of the most recent pinned image set that failed to be pulled and pinned on this node. - // +kubebuilder:validation:Minimum=0 - // +optional - LastFailedGeneration int32 `json:"lastFailedGeneration,omitempty"` - // lastFailedGenerationErrors is a list of errors explaining why the lastFailed generation failed to be pulled and pinned. - // +kubebuilder:validation:MaxItems=10 - // +listType=map - // +listMapKey=message + // lastSeenError is the error explaining why the desired images failed to be pulled and pinned. + // The error is an empty string if the image pull and pin is successful. + // +kubebuilder:validation:MaxLength=3276 // +optional - LastFailedGenerationErrors []MachineConfigNodeStatusPinnedImageSetError `json:"lastFailedGenerationErrors,omitempty"` + LastSeenError string `json:"lastSeenError,omitempty"` } // MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml index f99523c0ec6..6ed7b5720d8 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml @@ -338,7 +338,11 @@ spec: image set that has most recently been successfully pulled and pinned on this node. format: int32 + minimum: 0 type: integer + x-kubernetes-validations: + - message: currentGeneration must not move backwards + rule: self >= oldSelf desiredGeneration: description: desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this @@ -346,35 +350,15 @@ spec: format: int32 minimum: 0 type: integer - lastFailedGeneration: - description: lastFailedGeneration is the generation of the most - recent pinned image set that failed to be pulled and pinned - on this node. - format: int32 - minimum: 0 - type: integer - lastFailedGenerationErrors: - description: lastFailedGenerationErrors is a list of errors - explaining why the lastFailed generation failed to be pulled - and pinned. - items: - description: MachineConfigNodeStatusPinnedImageSetError holds - information on the the errors associated with failed attempts - at pulling and pinning images - properties: - message: - description: message is the message of the pinned image - error. - maxLength: 2048 - type: string - required: - - message - type: object - maxItems: 10 - type: array - x-kubernetes-list-map-keys: - - message - x-kubernetes-list-type: map + x-kubernetes-validations: + - message: desiredGeneration must not move backwards + rule: self >= oldSelf + lastSeenError: + description: |- + lastSeenError is the error explaining why the desired images failed to be pulled and pinned. + The error is an empty string if the image pull and pin is successful. + maxLength: 3276 + type: string name: description: |- name is the name of the pinned image set. @@ -396,14 +380,10 @@ spec: current generation rule: 'has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true' - - message: desired generation must be greater than or equal to last - failed generation - rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) - ? self.desiredGeneration >= self.lastFailedGeneration : true' - - message: desired generation must be defined if last failed generation - is defined - rule: 'has(self.lastFailedGeneration) ? has(self.desiredGeneration): - true' + - message: error must be populated on image pull and pin failure + rule: 'has(self.desiredGeneration) && has(self.currentGeneration) + && self.desiredGeneration != self.currentGeneration ? has(self.lastSeenError) + : true' maxItems: 100 type: array x-kubernetes-list-map-keys: diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml index 79ea879a6d0..1ec54bda796 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml @@ -338,7 +338,11 @@ spec: image set that has most recently been successfully pulled and pinned on this node. format: int32 + minimum: 0 type: integer + x-kubernetes-validations: + - message: currentGeneration must not move backwards + rule: self >= oldSelf desiredGeneration: description: desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this @@ -346,35 +350,15 @@ spec: format: int32 minimum: 0 type: integer - lastFailedGeneration: - description: lastFailedGeneration is the generation of the most - recent pinned image set that failed to be pulled and pinned - on this node. - format: int32 - minimum: 0 - type: integer - lastFailedGenerationErrors: - description: lastFailedGenerationErrors is a list of errors - explaining why the lastFailed generation failed to be pulled - and pinned. - items: - description: MachineConfigNodeStatusPinnedImageSetError holds - information on the the errors associated with failed attempts - at pulling and pinning images - properties: - message: - description: message is the message of the pinned image - error. - maxLength: 2048 - type: string - required: - - message - type: object - maxItems: 10 - type: array - x-kubernetes-list-map-keys: - - message - x-kubernetes-list-type: map + x-kubernetes-validations: + - message: desiredGeneration must not move backwards + rule: self >= oldSelf + lastSeenError: + description: |- + lastSeenError is the error explaining why the desired images failed to be pulled and pinned. + The error is an empty string if the image pull and pin is successful. + maxLength: 3276 + type: string name: description: |- name is the name of the pinned image set. @@ -396,14 +380,10 @@ spec: current generation rule: 'has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true' - - message: desired generation must be greater than or equal to last - failed generation - rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) - ? self.desiredGeneration >= self.lastFailedGeneration : true' - - message: desired generation must be defined if last failed generation - is defined - rule: 'has(self.lastFailedGeneration) ? has(self.desiredGeneration): - true' + - message: error must be populated on image pull and pin failure + rule: 'has(self.desiredGeneration) && has(self.currentGeneration) + && self.desiredGeneration != self.currentGeneration ? has(self.lastSeenError) + : true' maxItems: 100 type: array x-kubernetes-list-map-keys: diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml index 6babbf4e8ef..1a46f0c38f1 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml @@ -338,7 +338,11 @@ spec: image set that has most recently been successfully pulled and pinned on this node. format: int32 + minimum: 0 type: integer + x-kubernetes-validations: + - message: currentGeneration must not move backwards + rule: self >= oldSelf desiredGeneration: description: desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this @@ -346,35 +350,15 @@ spec: format: int32 minimum: 0 type: integer - lastFailedGeneration: - description: lastFailedGeneration is the generation of the most - recent pinned image set that failed to be pulled and pinned - on this node. - format: int32 - minimum: 0 - type: integer - lastFailedGenerationErrors: - description: lastFailedGenerationErrors is a list of errors - explaining why the lastFailed generation failed to be pulled - and pinned. - items: - description: MachineConfigNodeStatusPinnedImageSetError holds - information on the the errors associated with failed attempts - at pulling and pinning images - properties: - message: - description: message is the message of the pinned image - error. - maxLength: 2048 - type: string - required: - - message - type: object - maxItems: 10 - type: array - x-kubernetes-list-map-keys: - - message - x-kubernetes-list-type: map + x-kubernetes-validations: + - message: desiredGeneration must not move backwards + rule: self >= oldSelf + lastSeenError: + description: |- + lastSeenError is the error explaining why the desired images failed to be pulled and pinned. + The error is an empty string if the image pull and pin is successful. + maxLength: 3276 + type: string name: description: |- name is the name of the pinned image set. @@ -396,14 +380,10 @@ spec: current generation rule: 'has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true' - - message: desired generation must be greater than or equal to last - failed generation - rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) - ? self.desiredGeneration >= self.lastFailedGeneration : true' - - message: desired generation must be defined if last failed generation - is defined - rule: 'has(self.lastFailedGeneration) ? has(self.desiredGeneration): - true' + - message: error must be populated on image pull and pin failure + rule: 'has(self.desiredGeneration) && has(self.currentGeneration) + && self.desiredGeneration != self.currentGeneration ? has(self.lastSeenError) + : true' maxItems: 100 type: array x-kubernetes-list-map-keys: diff --git a/machineconfiguration/v1/zz_generated.deepcopy.go b/machineconfiguration/v1/zz_generated.deepcopy.go index fadf6f25fcd..c90b5db692c 100644 --- a/machineconfiguration/v1/zz_generated.deepcopy.go +++ b/machineconfiguration/v1/zz_generated.deepcopy.go @@ -796,9 +796,7 @@ func (in *MachineConfigNodeStatus) DeepCopyInto(out *MachineConfigNodeStatus) { if in.PinnedImageSets != nil { in, out := &in.PinnedImageSets, &out.PinnedImageSets *out = make([]MachineConfigNodeStatusPinnedImageSet, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + copy(*out, *in) } return } @@ -832,11 +830,6 @@ func (in *MachineConfigNodeStatusMachineConfigVersion) DeepCopy() *MachineConfig // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineConfigNodeStatusPinnedImageSet) DeepCopyInto(out *MachineConfigNodeStatusPinnedImageSet) { *out = *in - if in.LastFailedGenerationErrors != nil { - in, out := &in.LastFailedGenerationErrors, &out.LastFailedGenerationErrors - *out = make([]MachineConfigNodeStatusPinnedImageSetError, len(*in)) - copy(*out, *in) - } return } diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml index 5efa400fd81..4e8bcb566e5 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml @@ -338,7 +338,11 @@ spec: image set that has most recently been successfully pulled and pinned on this node. format: int32 + minimum: 0 type: integer + x-kubernetes-validations: + - message: currentGeneration must not move backwards + rule: self >= oldSelf desiredGeneration: description: desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this @@ -346,35 +350,15 @@ spec: format: int32 minimum: 0 type: integer - lastFailedGeneration: - description: lastFailedGeneration is the generation of the most - recent pinned image set that failed to be pulled and pinned - on this node. - format: int32 - minimum: 0 - type: integer - lastFailedGenerationErrors: - description: lastFailedGenerationErrors is a list of errors - explaining why the lastFailed generation failed to be pulled - and pinned. - items: - description: MachineConfigNodeStatusPinnedImageSetError holds - information on the the errors associated with failed attempts - at pulling and pinning images - properties: - message: - description: message is the message of the pinned image - error. - maxLength: 2048 - type: string - required: - - message - type: object - maxItems: 10 - type: array - x-kubernetes-list-map-keys: - - message - x-kubernetes-list-type: map + x-kubernetes-validations: + - message: desiredGeneration must not move backwards + rule: self >= oldSelf + lastSeenError: + description: |- + lastSeenError is the error explaining why the desired images failed to be pulled and pinned. + The error is an empty string if the image pull and pin is successful. + maxLength: 3276 + type: string name: description: |- name is the name of the pinned image set. @@ -396,14 +380,10 @@ spec: current generation rule: 'has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true' - - message: desired generation must be greater than or equal to last - failed generation - rule: 'has(self.lastFailedGeneration) && has(self.desiredGeneration) - ? self.desiredGeneration >= self.lastFailedGeneration : true' - - message: desired generation must be defined if last failed generation - is defined - rule: 'has(self.lastFailedGeneration) ? has(self.desiredGeneration): - true' + - message: error must be populated on image pull and pin failure + rule: 'has(self.desiredGeneration) && has(self.currentGeneration) + && self.desiredGeneration != self.currentGeneration ? has(self.lastSeenError) + : true' maxItems: 100 type: array x-kubernetes-list-map-keys: diff --git a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index 14c2052797e..4c3a1b36dfe 100644 --- a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -451,12 +451,11 @@ func (MachineConfigNodeStatusMachineConfigVersion) SwaggerDoc() map[string]strin } var map_MachineConfigNodeStatusPinnedImageSet = map[string]string{ - "": "MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current observed machine config node.", - "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", - "currentGeneration": "currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node.", - "desiredGeneration": "desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node.", - "lastFailedGeneration": "lastFailedGeneration is the generation of the most recent pinned image set that failed to be pulled and pinned on this node.", - "lastFailedGenerationErrors": "lastFailedGenerationErrors is a list of errors explaining why the lastFailed generation failed to be pulled and pinned.", + "": "MachineConfigNodeStatusPinnedImageSet holds information about the current and desired pinned image sets for the current observed machine config node.", + "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), start and end with an alphanumeric character, and be at most 253 characters in length.", + "currentGeneration": "currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node.", + "desiredGeneration": "desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node.", + "lastSeenError": "lastSeenError is the error explaining why the desired images failed to be pulled and pinned. The error is an empty string if the image pull and pin is successful.", } func (MachineConfigNodeStatusPinnedImageSet) SwaggerDoc() map[string]string {