Skip to content

Commit 3d7abe9

Browse files
Merge pull request #2256 from isabella-janssen/tombstone-pis-in-mcn-spec
NO ISSUE: Tombstone `Spec.PinnedImageSets` in MCN v1alpha1 API
2 parents c36b6ae + ca3a239 commit 3d7abe9

14 files changed

+31
-372
lines changed

Diff for: machineconfiguration/v1alpha1/tests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml

-41
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,6 @@ tests:
8080
node:
8181
name: foobar
8282
expectedError: "spec.configVersion: Required value, <nil>: Invalid value: \"null\""
83-
- name: Should be able to create a MachineConfigNode with a PinnedImageSet
84-
initial: |
85-
apiVersion: machineconfiguration.openshift.io/v1alpha1
86-
kind: MachineConfigNode
87-
metadata:
88-
name: foobar
89-
spec:
90-
node:
91-
name: foobar
92-
pool:
93-
name: worker
94-
configVersion:
95-
desired: rendered-worker-abc
96-
pinnedImageSets:
97-
- name: test-pinned-image-set
98-
expected: |
99-
apiVersion: machineconfiguration.openshift.io/v1alpha1
100-
kind: MachineConfigNode
101-
metadata:
102-
name: foobar
103-
spec:
104-
node:
105-
name: foobar
106-
pool:
107-
name: worker
108-
configVersion:
109-
desired: rendered-worker-abc
110-
pinnedImageSets:
111-
- name: test-pinned-image-set
11283
onUpdate:
11384
- name: PinnedImageSet desired generation must be greater than or equal to the current generation
11485
initial: |
@@ -123,8 +94,6 @@ tests:
12394
name: worker
12495
configVersion:
12596
desired: rendered-worker-abc
126-
pinnedImageSets:
127-
- name: test-pinned-image-set
12897
status:
12998
observedGeneration: 1
13099
configVersion:
@@ -145,8 +114,6 @@ tests:
145114
name: worker
146115
configVersion:
147116
desired: rendered-worker-abc
148-
pinnedImageSets:
149-
- name: test-pinned-image-set
150117
status:
151118
observedGeneration: 1
152119
configVersion:
@@ -169,8 +136,6 @@ tests:
169136
name: worker
170137
configVersion:
171138
desired: rendered-worker-abc
172-
pinnedImageSets:
173-
- name: test-pinned-image-set
174139
status:
175140
observedGeneration: 4
176141
configVersion:
@@ -191,8 +156,6 @@ tests:
191156
name: worker
192157
configVersion:
193158
desired: rendered-worker-abc
194-
pinnedImageSets:
195-
- name: test-pinned-image-set
196159
status:
197160
observedGeneration: 5
198161
configVersion:
@@ -216,8 +179,6 @@ tests:
216179
name: worker
217180
configVersion:
218181
desired: rendered-worker-abc
219-
pinnedImageSets:
220-
- name: test-pinned-image-set
221182
status:
222183
observedGeneration: 4
223184
configVersion:
@@ -238,8 +199,6 @@ tests:
238199
name: worker
239200
configVersion:
240201
desired: rendered-worker-abc
241-
pinnedImageSets:
242-
- name: test-pinned-image-set
243202
status:
244203
observedGeneration: 5
245204
configVersion:

Diff for: machineconfiguration/v1alpha1/types_machineconfignode.go

+17-12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
// +kubebuilder:object:root=true
1111
// +kubebuilder:resource:path=machineconfignodes,scope=Cluster
1212
// +kubebuilder:subresource:status
13-
// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2201
13+
// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2256
1414
// +openshift:file-pattern=cvoRunLevel=0000_80,operatorName=machine-config,operatorOrdering=01
1515
// +openshift:enable:FeatureGate=MachineConfigNodes
1616
// +kubebuilder:printcolumn:name="PoolName",type="string",JSONPath=.spec.pool.name,priority=0
@@ -104,7 +104,10 @@ type MachineConfigNodeSpec struct {
104104
// +listMapKey=name
105105
// +kubebuilder:validation:MaxItems=100
106106
// +optional
107-
PinnedImageSets []MachineConfigNodeSpecPinnedImageSet `json:"pinnedImageSets,omitempty"`
107+
// Tombstone: Functionality to correctly and consistely populate this field was not implemented in the MCO, so
108+
// when applying a PIS, this field is not being updated. Since this field is not being used, it is being removed
109+
// before this API is GAed.
110+
// PinnedImageSets []MachineConfigNodeSpecPinnedImageSet `json:"pinnedImageSets,omitempty"`
108111
}
109112

110113
// MachineConfigNodeStatus holds the reported information on a particular machine config node.
@@ -218,18 +221,20 @@ type MachineConfigNodeSpecMachineConfigVersion struct {
218221
Desired string `json:"desired"`
219222
}
220223

224+
// Tombstone: This struct defines the type of `Spec.PinnedImageSets`, which is being removed. Therefore, this field
225+
// is also being tombstoned.
221226
// MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node
222227
// should pin and pull.
223-
type MachineConfigNodeSpecPinnedImageSet struct {
224-
// name is the name of the pinned image set.
225-
// Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting
226-
// of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end
227-
// with an alphanumeric character, and be at most 253 characters in length.
228-
// +kubebuilder:validation:MaxLength:=253
229-
// +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."
230-
// +required
231-
Name string `json:"name"`
232-
}
228+
// type MachineConfigNodeSpecPinnedImageSet struct {
229+
// // name is the name of the pinned image set.
230+
// // Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting
231+
// // of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end
232+
// // with an alphanumeric character, and be at most 253 characters in length.
233+
// // +kubebuilder:validation:MaxLength:=253
234+
// // +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."
235+
// // +required
236+
// Name string `json:"name"`
237+
// }
233238

234239
// StateProgress is each possible state for each possible MachineConfigNodeType
235240
// Please note: These conditions are subject to change. Both additions and deletions may be made.

Diff for: machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-CustomNoUpgrade.crd.yaml

+1-30
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
api-approved.openshift.io: https://github.com/openshift/api/pull/2201
5+
api-approved.openshift.io: https://github.com/openshift/api/pull/2256
66
api.openshift.io/merged-by-featuregates: "true"
77
include.release.openshift.io/ibm-cloud-managed: "true"
88
include.release.openshift.io/self-managed-high-availability: "true"
@@ -145,35 +145,6 @@ spec:
145145
required:
146146
- name
147147
type: object
148-
pinnedImageSets:
149-
description: pinnedImageSets is a user defined value that holds the
150-
names of the desired image sets that the node should pull and pin.
151-
items:
152-
description: |-
153-
MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node
154-
should pin and pull.
155-
properties:
156-
name:
157-
description: |-
158-
name is the name of the pinned image set.
159-
Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting
160-
of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end
161-
with an alphanumeric character, and be at most 253 characters in length.
162-
maxLength: 253
163-
type: string
164-
x-kubernetes-validations:
165-
- message: a lowercase RFC 1123 subdomain must consist of lower
166-
case alphanumeric characters, '-' or '.', and must start
167-
and end with an alphanumeric character.
168-
rule: '!format.dns1123Subdomain().validate(self).hasValue()'
169-
required:
170-
- name
171-
type: object
172-
maxItems: 100
173-
type: array
174-
x-kubernetes-list-map-keys:
175-
- name
176-
x-kubernetes-list-type: map
177148
pool:
178149
description: |-
179150
pool contains a reference to the machine config pool that this machine config node's

Diff for: machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-DevPreviewNoUpgrade.crd.yaml

+1-30
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
api-approved.openshift.io: https://github.com/openshift/api/pull/2201
5+
api-approved.openshift.io: https://github.com/openshift/api/pull/2256
66
api.openshift.io/merged-by-featuregates: "true"
77
include.release.openshift.io/ibm-cloud-managed: "true"
88
include.release.openshift.io/self-managed-high-availability: "true"
@@ -145,35 +145,6 @@ spec:
145145
required:
146146
- name
147147
type: object
148-
pinnedImageSets:
149-
description: pinnedImageSets is a user defined value that holds the
150-
names of the desired image sets that the node should pull and pin.
151-
items:
152-
description: |-
153-
MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node
154-
should pin and pull.
155-
properties:
156-
name:
157-
description: |-
158-
name is the name of the pinned image set.
159-
Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting
160-
of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end
161-
with an alphanumeric character, and be at most 253 characters in length.
162-
maxLength: 253
163-
type: string
164-
x-kubernetes-validations:
165-
- message: a lowercase RFC 1123 subdomain must consist of lower
166-
case alphanumeric characters, '-' or '.', and must start
167-
and end with an alphanumeric character.
168-
rule: '!format.dns1123Subdomain().validate(self).hasValue()'
169-
required:
170-
- name
171-
type: object
172-
maxItems: 100
173-
type: array
174-
x-kubernetes-list-map-keys:
175-
- name
176-
x-kubernetes-list-type: map
177148
pool:
178149
description: |-
179150
pool contains a reference to the machine config pool that this machine config node's

Diff for: machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-TechPreviewNoUpgrade.crd.yaml

+1-30
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
api-approved.openshift.io: https://github.com/openshift/api/pull/2201
5+
api-approved.openshift.io: https://github.com/openshift/api/pull/2256
66
api.openshift.io/merged-by-featuregates: "true"
77
include.release.openshift.io/ibm-cloud-managed: "true"
88
include.release.openshift.io/self-managed-high-availability: "true"
@@ -145,35 +145,6 @@ spec:
145145
required:
146146
- name
147147
type: object
148-
pinnedImageSets:
149-
description: pinnedImageSets is a user defined value that holds the
150-
names of the desired image sets that the node should pull and pin.
151-
items:
152-
description: |-
153-
MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node
154-
should pin and pull.
155-
properties:
156-
name:
157-
description: |-
158-
name is the name of the pinned image set.
159-
Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting
160-
of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end
161-
with an alphanumeric character, and be at most 253 characters in length.
162-
maxLength: 253
163-
type: string
164-
x-kubernetes-validations:
165-
- message: a lowercase RFC 1123 subdomain must consist of lower
166-
case alphanumeric characters, '-' or '.', and must start
167-
and end with an alphanumeric character.
168-
rule: '!format.dns1123Subdomain().validate(self).hasValue()'
169-
required:
170-
- name
171-
type: object
172-
maxItems: 100
173-
type: array
174-
x-kubernetes-list-map-keys:
175-
- name
176-
x-kubernetes-list-type: map
177148
pool:
178149
description: |-
179150
pool contains a reference to the machine config pool that this machine config node's

Diff for: machineconfiguration/v1alpha1/zz_generated.deepcopy.go

+1-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: machineconfiguration/v1alpha1/zz_generated.featuregated-crd-manifests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
machineconfignodes.machineconfiguration.openshift.io:
22
Annotations: {}
3-
ApprovedPRNumber: https://github.com/openshift/api/pull/2201
3+
ApprovedPRNumber: https://github.com/openshift/api/pull/2256
44
CRDName: machineconfignodes.machineconfiguration.openshift.io
55
Capability: ""
66
Category: ""

Diff for: machineconfiguration/v1alpha1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/MachineConfigNodes.yaml

+1-30
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
api-approved.openshift.io: https://github.com/openshift/api/pull/2201
5+
api-approved.openshift.io: https://github.com/openshift/api/pull/2256
66
api.openshift.io/filename-cvo-runlevel: "0000_80"
77
api.openshift.io/filename-operator: machine-config
88
api.openshift.io/filename-ordering: "01"
@@ -145,35 +145,6 @@ spec:
145145
required:
146146
- name
147147
type: object
148-
pinnedImageSets:
149-
description: pinnedImageSets is a user defined value that holds the
150-
names of the desired image sets that the node should pull and pin.
151-
items:
152-
description: |-
153-
MachineConfigNodeSpecPinnedImageSet holds information on the desired pinned image sets that the current observed machine config node
154-
should pin and pull.
155-
properties:
156-
name:
157-
description: |-
158-
name is the name of the pinned image set.
159-
Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting
160-
of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end
161-
with an alphanumeric character, and be at most 253 characters in length.
162-
maxLength: 253
163-
type: string
164-
x-kubernetes-validations:
165-
- message: a lowercase RFC 1123 subdomain must consist of lower
166-
case alphanumeric characters, '-' or '.', and must start
167-
and end with an alphanumeric character.
168-
rule: '!format.dns1123Subdomain().validate(self).hasValue()'
169-
required:
170-
- name
171-
type: object
172-
maxItems: 100
173-
type: array
174-
x-kubernetes-list-map-keys:
175-
- name
176-
x-kubernetes-list-type: map
177148
pool:
178149
description: |-
179150
pool contains a reference to the machine config pool that this machine config node's

0 commit comments

Comments
 (0)