Skip to content

Commit e52b545

Browse files
committed
machine_config: add ManagedBootImages status
1 parent cedb279 commit e52b545

File tree

8 files changed

+408
-12
lines changed

8 files changed

+408
-12
lines changed

openapi/generated_openapi/zz_generated.openapi.go

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30042,7 +30042,7 @@
3004230042
"type": "string"
3004330043
},
3004430044
"managedBootImages": {
30045-
"description": "managedBootImages allows configuration for the management of boot images for machine resources within the cluster. This configuration allows users to select resources that should be updated to the latest boot images during cluster upgrades, ensuring that new machines always boot with the current cluster version's boot image. When omitted, no boot images will be updated.",
30045+
"description": "managedBootImages allows configuration for the management of boot images for machine resources within the cluster. This configuration allows users to select resources that should be updated to the latest boot images during cluster upgrades, ensuring that new machines always boot with the current cluster version's boot image. When omitted, the MCO will will use cluster defaults, which may vary between releases.",
3004630046
"default": {},
3004730047
"$ref": "#/definitions/com.github.openshift.api.operator.v1.ManagedBootImages"
3004830048
},
@@ -30092,6 +30092,11 @@
3009230092
"x-kubernetes-patch-merge-key": "type",
3009330093
"x-kubernetes-patch-strategy": "merge"
3009430094
},
30095+
"managedBootImagesStatus": {
30096+
"description": "managedBootImagesStatus reflects what the latest cluster-validated boot image configuration is and will be used by Machine Config Controller while performing boot image updates.",
30097+
"default": {},
30098+
"$ref": "#/definitions/com.github.openshift.api.operator.v1.ManagedBootImages"
30099+
},
3009530100
"nodeDisruptionPolicyStatus": {
3009630101
"description": "nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine Config Daemon during future node updates.",
3009730102
"default": {},

operator/v1/types_machineconfiguration.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ type MachineConfigurationSpec struct {
4141
// managedBootImages allows configuration for the management of boot images for machine
4242
// resources within the cluster. This configuration allows users to select resources that should
4343
// be updated to the latest boot images during cluster upgrades, ensuring that new machines
44-
// always boot with the current cluster version's boot image. When omitted, no boot images
45-
// will be updated.
44+
// always boot with the current cluster version's boot image. When omitted, the MCO will
45+
// will use cluster defaults, which may vary between releases.
4646
// +openshift:enable:FeatureGate=ManagedBootImages
4747
// +optional
4848
ManagedBootImages ManagedBootImages `json:"managedBootImages"`
@@ -96,6 +96,12 @@ type MachineConfigurationStatus struct {
9696
// +openshift:enable:FeatureGate=NodeDisruptionPolicy
9797
// +optional
9898
NodeDisruptionPolicyStatus NodeDisruptionPolicyStatus `json:"nodeDisruptionPolicyStatus"`
99+
100+
// managedBootImagesStatus reflects what the latest cluster-validated boot image configuration is
101+
// and will be used by Machine Config Controller while performing boot image updates.
102+
// +openshift:enable:FeatureGate=ManagedBootImages
103+
// +optional
104+
ManagedBootImagesStatus ManagedBootImages `json:"managedBootImagesStatus"`
99105
}
100106

101107
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -122,6 +128,7 @@ type ManagedBootImages struct {
122128
// +listType=map
123129
// +listMapKey=resource
124130
// +listMapKey=apiGroup
131+
// +kubebuilder:validation:MaxItems=5
125132
MachineManagers []MachineManager `json:"machineManagers"`
126133
}
127134

operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations.crd.yaml

Lines changed: 127 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ spec:
7777
managedBootImages allows configuration for the management of boot images for machine
7878
resources within the cluster. This configuration allows users to select resources that should
7979
be updated to the latest boot images during cluster upgrades, ensuring that new machines
80-
always boot with the current cluster version's boot image. When omitted, no boot images
81-
will be updated.
80+
always boot with the current cluster version's boot image. When omitted, the MCO will
81+
will use cluster defaults, which may vary between releases.
8282
properties:
8383
machineManagers:
8484
description: |-
@@ -192,6 +192,7 @@ spec:
192192
- resource
193193
- selection
194194
type: object
195+
maxItems: 5
195196
type: array
196197
x-kubernetes-list-map-keys:
197198
- resource
@@ -705,6 +706,130 @@ spec:
705706
x-kubernetes-list-map-keys:
706707
- type
707708
x-kubernetes-list-type: map
709+
managedBootImagesStatus:
710+
description: |-
711+
managedBootImagesStatus reflects what the latest cluster-validated boot image configuration is
712+
and will be used by Machine Config Controller while performing boot image updates.
713+
properties:
714+
machineManagers:
715+
description: |-
716+
machineManagers can be used to register machine management resources for boot image updates. The Machine Config Operator
717+
will watch for changes to this list. Only one entry is permitted per type of machine management resource.
718+
items:
719+
description: |-
720+
MachineManager describes a target machine resource that is registered for boot image updates. It stores identifying information
721+
such as the resource type and the API Group of the resource. It also provides granular control via the selection field.
722+
properties:
723+
apiGroup:
724+
description: |-
725+
apiGroup is name of the APIGroup that the machine management resource belongs to.
726+
The only current valid value is machine.openshift.io.
727+
machine.openshift.io means that the machine manager will only register resources that belong to OpenShift machine API group.
728+
enum:
729+
- machine.openshift.io
730+
type: string
731+
resource:
732+
description: |-
733+
resource is the machine management resource's type.
734+
The only current valid value is machinesets.
735+
machinesets means that the machine manager will only register resources of the kind MachineSet.
736+
enum:
737+
- machinesets
738+
type: string
739+
selection:
740+
description: selection allows granular control of the machine
741+
management resources that will be registered for boot
742+
image updates.
743+
properties:
744+
mode:
745+
description: |-
746+
mode determines how machine managers will be selected for updates.
747+
Valid values are All and Partial.
748+
All means that every resource matched by the machine manager will be updated.
749+
Partial requires specified selector(s) and allows customisation of which resources matched by the machine manager will be updated.
750+
None means that every resource matched by the machine manager will not be updated.
751+
enum:
752+
- All
753+
- Partial
754+
- None
755+
type: string
756+
partial:
757+
description: |-
758+
partial provides label selector(s) that can be used to match machine management resources.
759+
Only permitted when mode is set to "Partial".
760+
properties:
761+
machineResourceSelector:
762+
description: machineResourceSelector is a label
763+
selector that can be used to select machine resources
764+
like MachineSets.
765+
properties:
766+
matchExpressions:
767+
description: matchExpressions is a list of label
768+
selector requirements. The requirements are
769+
ANDed.
770+
items:
771+
description: |-
772+
A label selector requirement is a selector that contains values, a key, and an operator that
773+
relates the key and values.
774+
properties:
775+
key:
776+
description: key is the label key that
777+
the selector applies to.
778+
type: string
779+
operator:
780+
description: |-
781+
operator represents a key's relationship to a set of values.
782+
Valid operators are In, NotIn, Exists and DoesNotExist.
783+
type: string
784+
values:
785+
description: |-
786+
values is an array of string values. If the operator is In or NotIn,
787+
the values array must be non-empty. If the operator is Exists or DoesNotExist,
788+
the values array must be empty. This array is replaced during a strategic
789+
merge patch.
790+
items:
791+
type: string
792+
type: array
793+
x-kubernetes-list-type: atomic
794+
required:
795+
- key
796+
- operator
797+
type: object
798+
type: array
799+
x-kubernetes-list-type: atomic
800+
matchLabels:
801+
additionalProperties:
802+
type: string
803+
description: |-
804+
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
805+
map is equivalent to an element of matchExpressions, whose key field is "key", the
806+
operator is "In", and the values array contains only "value". The requirements are ANDed.
807+
type: object
808+
type: object
809+
x-kubernetes-map-type: atomic
810+
required:
811+
- machineResourceSelector
812+
type: object
813+
required:
814+
- mode
815+
type: object
816+
x-kubernetes-validations:
817+
- message: Partial is required when type is partial, and
818+
forbidden otherwise
819+
rule: 'has(self.mode) && self.mode == ''Partial'' ? has(self.partial)
820+
: !has(self.partial)'
821+
required:
822+
- apiGroup
823+
- resource
824+
- selection
825+
type: object
826+
maxItems: 5
827+
type: array
828+
x-kubernetes-list-map-keys:
829+
- resource
830+
- apiGroup
831+
x-kubernetes-list-type: map
832+
type: object
708833
nodeDisruptionPolicyStatus:
709834
description: |-
710835
nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are,

operator/v1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)