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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions features.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
| KMSEncryptionProvider| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| MachineAPIMigration| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| ManagedBootImagesAzure| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| ManagedBootImagesCPMS| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| ManagedBootImagesvSphere| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| MaxUnavailableStatefulSet| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| MinimumKubeletVersion| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand Down
8 changes: 8 additions & 0 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ var (
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGateManagedBootImagesCPMS = newFeatureGate("ManagedBootImagesCPMS").
reportProblemsToJiraComponent("MachineConfigOperator").
contactPerson("djoshy").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1818").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGateBootImageSkewEnforcement = newFeatureGate("BootImageSkewEnforcement").
reportProblemsToJiraComponent("MachineConfigOperator").
contactPerson("djoshy").
Expand Down
4 changes: 2 additions & 2 deletions openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -31216,7 +31216,7 @@
"default": ""
},
"resource": {
"description": "resource is the machine management resource's type. The only current valid value is machinesets. machinesets means that the machine manager will only register resources of the kind MachineSet.",
"description": "resource is the machine management resource's type. Valid values are machinesets and controlplanemachinesets. machinesets means that the machine manager will only register resources of the kind MachineSet. controlplanemachinesets means that the machine manager will only register resources of the kind ControlPlaneMachineSet.",
"type": "string",
"default": ""
},
Expand All @@ -31234,7 +31234,7 @@
],
"properties": {
"mode": {
"description": "mode determines how machine managers will be selected for updates. Valid values are All and Partial. All means that every resource matched by the machine manager will be updated. Partial requires specified selector(s) and allows customisation of which resources matched by the machine manager will be updated. None means that every resource matched by the machine manager will not be updated.",
"description": "mode determines how machine managers will be selected for updates. Valid values are All, Partial and None. All means that every resource matched by the machine manager will be updated. Partial requires specified selector(s) and allows customisation of which resources matched by the machine manager will be updated. Partial is not permitted for the controlplanemachinesets resource type as they are a singleton within the cluster. None means that every resource matched by the machine manager will not be updated.",
"type": "string",
"default": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "MachineConfiguration"
crdName: machineconfigurations.operator.openshift.io
featureGates:
- ManagedBootImages
- ManagedBootImagesCPMS
tests:
onCreate:
- name: Should be able to create a minimal MachineConfiguration
initial: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec: {} # No spec is required for a MachineConfiguration
expected: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
logLevel: Normal
operatorLogLevel: Normal
- name: Should be able to create an empty ManagedBootImages configuration knob
initial: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
managedBootImages:
machineManagers: []
expected: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
logLevel: Normal
operatorLogLevel: Normal
managedBootImages:
machineManagers: []
- name: Should be able to create a ManagedBootImages configuration knob that opts in all ControlPlaneMachineSets
initial: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
managedBootImages:
machineManagers:
- resource: controlplanemachinesets
apiGroup: machine.openshift.io
selection:
mode: All
expected: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
logLevel: Normal
operatorLogLevel: Normal
managedBootImages:
machineManagers:
- resource: controlplanemachinesets
apiGroup: machine.openshift.io
selection:
mode: All
- name: Should be able to create a ManagedBootImages configuration knob that opts in no ControlPlaneMachineSets
initial: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
managedBootImages:
machineManagers:
- resource: controlplanemachinesets
apiGroup: machine.openshift.io
selection:
mode: None
expected: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
logLevel: Normal
operatorLogLevel: Normal
managedBootImages:
machineManagers:
- resource: controlplanemachinesets
apiGroup: machine.openshift.io
selection:
mode: None
- name: Should not be able to create a ManagedBootImages configuration knob that opts in ControlPlaneMachineSets in partial mode
initial: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
managedBootImages:
machineManagers:
- resource: controlplanemachinesets
apiGroup: machine.openshift.io
selection:
mode: Partial
partial:
machineResourceSelector:
matchLabels: {}
expectedError: "Only All or None selection mode is permitted for ControlPlaneMachineSets"
- name: Only one unique pair of resource/apigroup is allowed in machineManagers
initial: |
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
managedBootImages:
machineManagers:
- resource: controlplanemachinesets
apiGroup: machine.openshift.io
selection:
mode: None
- resource: controlplanemachinesets
apiGroup: machine.openshift.io
selection:
mode: All
expectedError: "spec.managedBootImages.machineManagers[1]: Duplicate value: map[string]interface {}{\"apiGroup\":\"machine.openshift.io\", \"resource\":\"controlplanemachinesets\"}"
14 changes: 10 additions & 4 deletions operator/v1/types_machineconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,12 @@ type ManagedBootImages struct {

// MachineManager describes a target machine resource that is registered for boot image updates. It stores identifying information
// such as the resource type and the API Group of the resource. It also provides granular control via the selection field.
// +openshift:validation:FeatureGateAwareXValidation:requiredFeatureGate=ManagedBootImages;ManagedBootImagesCPMS,rule="self.resource != 'controlplanemachinesets' || self.selection.mode == 'All' || self.selection.mode == 'None'", message="Only All or None selection mode is permitted for ControlPlaneMachineSets"
type MachineManager struct {
// resource is the machine management resource's type.
// The only current valid value is machinesets.
// Valid values are machinesets and controlplanemachinesets.
// machinesets means that the machine manager will only register resources of the kind MachineSet.
// controlplanemachinesets means that the machine manager will only register resources of the kind ControlPlaneMachineSet.
// +required
Resource MachineManagerMachineSetsResourceType `json:"resource"`

Expand All @@ -388,9 +390,10 @@ type MachineManager struct {
// +union
type MachineManagerSelector struct {
// mode determines how machine managers will be selected for updates.
// Valid values are All and Partial.
// Valid values are All, Partial and None.
// All means that every resource matched by the machine manager will be updated.
// Partial requires specified selector(s) and allows customisation of which resources matched by the machine manager will be updated.
// Partial is not permitted for the controlplanemachinesets resource type as they are a singleton within the cluster.
// None means that every resource matched by the machine manager will not be updated.
// +unionDiscriminator
// +required
Expand Down Expand Up @@ -427,12 +430,15 @@ const (

// MachineManagerManagedResourceType is a string enum used in the MachineManager type to describe the resource
// type to be registered.
// +kubebuilder:validation:Enum:="machinesets"
// +openshift:validation:FeatureGateAwareEnum:requiredFeatureGate=ManagedBootImages,enum=machinesets
// +openshift:validation:FeatureGateAwareEnum:requiredFeatureGate=ManagedBootImages;ManagedBootImagesCPMS,enum=machinesets;controlplanemachinesets
type MachineManagerMachineSetsResourceType string

const (
// MachineSets represent the MachineSet resource type, which manage a group of machines and belong to the Openshift machine API group.
MachineSets MachineManagerMachineSetsResourceType = "machinesets"
// ControlPlaneMachineSets represent the ControlPlaneMachineSets resource type, which manage a group of control-plane machines and belong to the Openshift machine API group.
ControlPlaneMachineSets MachineManagerMachineSetsResourceType = "controlplanemachinesets"
)

// MachineManagerManagedAPIGroupType is a string enum used in in the MachineManager type to describe the APIGroup
Expand All @@ -442,7 +448,7 @@ type MachineManagerMachineSetsAPIGroupType string

const (
// MachineAPI represent the traditional MAPI Group that a machineset may belong to.
// This feature only supports MAPI machinesets at this time.
// This feature only supports MAPI machinesets and controlplanemachinesets at this time.
MachineAPI MachineManagerMachineSetsAPIGroupType = "machine.openshift.io"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,12 @@ spec:
resource:
description: |-
resource is the machine management resource's type.
The only current valid value is machinesets.
Valid values are machinesets and controlplanemachinesets.
machinesets means that the machine manager will only register resources of the kind MachineSet.
controlplanemachinesets means that the machine manager will only register resources of the kind ControlPlaneMachineSet.
enum:
- machinesets
- controlplanemachinesets
type: string
selection:
description: selection allows granular control of the machine
Expand All @@ -241,9 +243,10 @@ spec:
mode:
description: |-
mode determines how machine managers will be selected for updates.
Valid values are All and Partial.
Valid values are All, Partial and None.
All means that every resource matched by the machine manager will be updated.
Partial requires specified selector(s) and allows customisation of which resources matched by the machine manager will be updated.
Partial is not permitted for the controlplanemachinesets resource type as they are a singleton within the cluster.
None means that every resource matched by the machine manager will not be updated.
enum:
- All
Expand Down Expand Up @@ -320,6 +323,11 @@ spec:
- resource
- selection
type: object
x-kubernetes-validations:
- message: Only All or None selection mode is permitted for
ControlPlaneMachineSets
rule: self.resource != 'controlplanemachinesets' || self.selection.mode
== 'All' || self.selection.mode == 'None'
maxItems: 5
type: array
x-kubernetes-list-map-keys:
Expand Down Expand Up @@ -993,10 +1001,12 @@ spec:
resource:
description: |-
resource is the machine management resource's type.
The only current valid value is machinesets.
Valid values are machinesets and controlplanemachinesets.
machinesets means that the machine manager will only register resources of the kind MachineSet.
controlplanemachinesets means that the machine manager will only register resources of the kind ControlPlaneMachineSet.
enum:
- machinesets
- controlplanemachinesets
type: string
selection:
description: selection allows granular control of the machine
Expand All @@ -1006,9 +1016,10 @@ spec:
mode:
description: |-
mode determines how machine managers will be selected for updates.
Valid values are All and Partial.
Valid values are All, Partial and None.
All means that every resource matched by the machine manager will be updated.
Partial requires specified selector(s) and allows customisation of which resources matched by the machine manager will be updated.
Partial is not permitted for the controlplanemachinesets resource type as they are a singleton within the cluster.
None means that every resource matched by the machine manager will not be updated.
enum:
- All
Expand Down Expand Up @@ -1085,6 +1096,11 @@ spec:
- resource
- selection
type: object
x-kubernetes-validations:
- message: Only All or None selection mode is permitted for
ControlPlaneMachineSets
rule: self.resource != 'controlplanemachinesets' || self.selection.mode
== 'All' || self.selection.mode == 'None'
maxItems: 5
type: array
x-kubernetes-list-map-keys:
Expand Down
Loading