Skip to content

Commit

Permalink
add boot images update opt-in & mcp degrade type
Browse files Browse the repository at this point in the history
  • Loading branch information
djoshy committed Nov 28, 2023
1 parent e1845c5 commit 1688711
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 1 deletion.
3 changes: 3 additions & 0 deletions machineconfiguration/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,9 @@ const (
// MachineConfigPoolRenderDegraded means the rendered configuration for the pool cannot be generated because of an error
MachineConfigPoolRenderDegraded MachineConfigPoolConditionType = "RenderDegraded"

// MachineConfigPoolMachineSetDegraded means the machineset reconciliation for the pool could not be completed because of an error
MachineConfigPoolMachineSetDegraded MachineConfigPoolConditionType = "MachineSetDegraded"

// MachineConfigPoolDegraded is the overall status of the pool based, today, on whether we fail with NodeDegraded or RenderDegraded
MachineConfigPoolDegraded MachineConfigPoolConditionType = "Degraded"

Expand Down
50 changes: 49 additions & 1 deletion openapi/generated_openapi/zz_generated.openapi.go

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

27 changes: 27 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -27931,6 +27931,11 @@
"description": "logLevel is an intent based logging for an overall component. It does not give fine grained control, but it is a simple way to manage coarse grained logging choices that operators have to interpret for their operands.\n\nValid values are: \"Normal\", \"Debug\", \"Trace\", \"TraceAll\". Defaults to \"Normal\".",
"type": "string"
},
"managedBootImageConfig": {
"description": "managedBootImageConfigData contains configuration data for the bootimages management feature",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.ManagedBootImageConfig"
},
"managementState": {
"description": "managementState indicates whether and how the operator should manage the component",
"type": "string",
Expand Down Expand Up @@ -28013,6 +28018,28 @@
}
}
},
"com.github.openshift.api.operator.v1.ManagedBootImageConfig": {
"description": "ManagedBootImageConfig contains configuration data for the bootimages management feature",
"type": "object",
"properties": {
"matchSelector": {
"description": "matchSelector specifies a label selector for MachinesSets that will be managed by this mechanism",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
},
"mode": {
"description": "mode has three settings: enabled - MCO will manage all machinesets matchSelector - MCO will manage machinesets that match with the label selector disabled - MCO will not manage any machinesets If unset, mode will default to disabled",
"type": "string"
}
},
"x-kubernetes-unions": [
{
"discriminator": "mode",
"fields-to-discriminateBy": {
"matchSelector": "MatchSelector"
}
}
]
},
"com.github.openshift.api.operator.v1.MyOperatorResource": {
"description": "MyOperatorResource is an example operator configuration type\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.",
"type": "object",
Expand Down
44 changes: 44 additions & 0 deletions operator/v1/0000_80_machine-config-operator_01_config.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,50 @@ spec:
- Debug
- Trace
- TraceAll
managedBootImageConfig:
description: managedBootImageConfigData contains configuration data for the bootimages management feature
type: object
required:
- mode
properties:
matchSelector:
description: matchSelector specifies a label selector for MachinesSets that will be managed by this mechanism
type: object
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
type: array
items:
description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
type: object
required:
- key
- operator
properties:
key:
description: key is the label key that the selector applies to.
type: string
operator:
description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
type: array
items:
type: string
matchLabels:
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
additionalProperties:
type: string
x-kubernetes-map-type: atomic
mode:
description: 'mode has three settings: enabled - MCO will manage all machinesets matchSelector - MCO will manage machinesets that match with the label selector disabled - MCO will not manage any machinesets If unset, mode will default to disabled'
type: string
enum:
- Enabled
- Selected
- MatchSelector
managementState:
description: managementState indicates whether and how the operator should manage the component
type: string
Expand Down
22 changes: 22 additions & 0 deletions operator/v1/types_machineconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ type MachineConfigurationSpec struct {
StaticPodOperatorSpec `json:",inline"`

// TODO(jkyros): This is where we put our knobs and dials

// managedBootImageConfigData contains configuration data for the bootimages management feature
// +optional
ManagedBootImageConfig ManagedBootImageConfig `json:"managedBootImageConfig,omitempty"`
}

type MachineConfigurationStatus struct {
Expand All @@ -56,3 +60,21 @@ type MachineConfigurationList struct {
// Items contains the items
Items []MachineConfiguration `json:"items"`
}

// ManagedBootImageConfig contains configuration data for the bootimages management feature
// +union
type ManagedBootImageConfig struct {
// mode has three settings:
// enabled - MCO will manage all machinesets
// matchSelector - MCO will manage machinesets that match with the label selector
// disabled - MCO will not manage any machinesets
// If unset, mode will default to disabled
// +unionDiscriminator
// +kubebuilder:validation:Enum:="Enabled";"Selected";"MatchSelector"
// +kubebuilder:validation:Required
Mode string `json:"mode,omitempty"`

// matchSelector specifies a label selector for MachinesSets that will be managed by this mechanism
// +optional
MatchSelector *metav1.LabelSelector `json:"matchSelector,omitempty"`
}
22 changes: 22 additions & 0 deletions operator/v1/zz_generated.deepcopy.go

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

18 changes: 18 additions & 0 deletions operator/v1/zz_generated.swagger_doc_generated.go

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

0 comments on commit 1688711

Please sign in to comment.