From 80984beb7fb3e3d1a6300896175fb5483317f08d Mon Sep 17 00:00:00 2001 From: Yu Qi Zhang Date: Tue, 19 Mar 2024 22:24:57 -0400 Subject: [PATCH 1/3] add tech preview NodeDisruptionPolicy to MachineConfiguration Add a new sub-spec/status to the MachineConfiguration operator object, which will allow users to specify actions to take when small MachineConfig updates happen to the cluster. This will be behind a NodeDisruptionPolicy featuregate, and will be managed and consumed by the Machine Config Operator in-cluster. --- config/v1/feature_gates.go | 7 + .../generated_openapi/zz_generated.openapi.go | 470 +++++-- openapi/openapi.json | 261 +++- ...review.machineconfiguration.testsuite.yaml | 195 +++ operator/v1/types_machineconfiguration.go | 213 +++- ...ineconfigurations-CustomNoUpgrade.crd.yaml | 1057 ++++++++++++++-- ..._01_machineconfigurations-Default.crd.yaml | 157 +-- ...nfigurations-TechPreviewNoUpgrade.crd.yaml | 1057 ++++++++++++++-- operator/v1/zz_generated.deepcopy.go | 216 +++- ..._generated.featuregated-crd-manifests.yaml | 1 + .../AAA_ungated.yaml | 157 +-- .../ManagedBootImages.yaml | 157 +-- .../NodeDisruptionPolicy.yaml | 1103 +++++++++++++++++ .../v1/zz_generated.swagger_doc_generated.go | 100 +- .../featureGate-Hypershift-Default.yaml | 3 + ...eGate-Hypershift-TechPreviewNoUpgrade.yaml | 3 + .../featureGate-SelfManagedHA-Default.yaml | 3 + ...te-SelfManagedHA-TechPreviewNoUpgrade.yaml | 3 + .../featureGate-SingleNode-Default.yaml | 3 + ...eGate-SingleNode-TechPreviewNoUpgrade.yaml | 3 + 20 files changed, 4511 insertions(+), 658 deletions(-) create mode 100644 operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml diff --git a/config/v1/feature_gates.go b/config/v1/feature_gates.go index 79ab5c63157..d7f0b65939c 100644 --- a/config/v1/feature_gates.go +++ b/config/v1/feature_gates.go @@ -553,4 +553,11 @@ var ( productScope(ocpSpecific). enableIn(TechPreviewNoUpgrade). mustRegister() + + FeatureGateNodeDisruptionPolicy = newFeatureGate("NodeDisruptionPolicy"). + reportProblemsToJiraComponent("MachineConfigOperator"). + contactPerson("jerzhang"). + productScope(ocpSpecific). + enableIn(TechPreviewNoUpgrade). + mustRegister() ) diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 33efff5c013..15a5cf2f045 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -975,6 +975,13 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/operator/v1.NetworkMigration": schema_openshift_api_operator_v1_NetworkMigration(ref), "github.com/openshift/api/operator/v1.NetworkSpec": schema_openshift_api_operator_v1_NetworkSpec(ref), "github.com/openshift/api/operator/v1.NetworkStatus": schema_openshift_api_operator_v1_NetworkStatus(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction": schema_openshift_api_operator_v1_NodeDisruptionPolicyAction(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyClusterStatus": schema_openshift_api_operator_v1_NodeDisruptionPolicyClusterStatus(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyConfig": schema_openshift_api_operator_v1_NodeDisruptionPolicyConfig(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile": schema_openshift_api_operator_v1_NodeDisruptionPolicyFile(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey": schema_openshift_api_operator_v1_NodeDisruptionPolicySSHKey(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatus": schema_openshift_api_operator_v1_NodeDisruptionPolicyStatus(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit": schema_openshift_api_operator_v1_NodeDisruptionPolicyUnit(ref), "github.com/openshift/api/operator/v1.NodePlacement": schema_openshift_api_operator_v1_NodePlacement(ref), "github.com/openshift/api/operator/v1.NodePortStrategy": schema_openshift_api_operator_v1_NodePortStrategy(ref), "github.com/openshift/api/operator/v1.NodeStatus": schema_openshift_api_operator_v1_NodeStatus(ref), @@ -1002,7 +1009,9 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/operator/v1.ProviderLoadBalancerParameters": schema_openshift_api_operator_v1_ProviderLoadBalancerParameters(ref), "github.com/openshift/api/operator/v1.ProxyConfig": schema_openshift_api_operator_v1_ProxyConfig(ref), "github.com/openshift/api/operator/v1.QuickStarts": schema_openshift_api_operator_v1_QuickStarts(ref), + "github.com/openshift/api/operator/v1.ReloadService": schema_openshift_api_operator_v1_ReloadService(ref), "github.com/openshift/api/operator/v1.ResourceAttributesAccessReview": schema_openshift_api_operator_v1_ResourceAttributesAccessReview(ref), + "github.com/openshift/api/operator/v1.RestartService": schema_openshift_api_operator_v1_RestartService(ref), "github.com/openshift/api/operator/v1.RouteAdmissionPolicy": schema_openshift_api_operator_v1_RouteAdmissionPolicy(ref), "github.com/openshift/api/operator/v1.SFlowConfig": schema_openshift_api_operator_v1_SFlowConfig(ref), "github.com/openshift/api/operator/v1.Server": schema_openshift_api_operator_v1_Server(ref), @@ -49210,12 +49219,19 @@ func schema_openshift_api_operator_v1_MachineConfigurationSpec(ref common.Refere Ref: ref("github.com/openshift/api/operator/v1.ManagedBootImages"), }, }, + "nodeDisruptionPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDisruptionPolicy allows an admin to set granular node disruption actions for MachineConfig-based updates, such as drains, service reloads, etc. Specifying this will allow for less downtime when doing small configuration updates to the cluster. This configuration has no effect on cluster upgrades which will still incur node disruption where required.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyConfig"), + }, + }, }, Required: []string{"managementState", "forceRedeploymentReason"}, }, }, Dependencies: []string{ - "github.com/openshift/api/operator/v1.ManagedBootImages", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + "github.com/openshift/api/operator/v1.ManagedBootImages", "github.com/openshift/api/operator/v1.NodeDisruptionPolicyConfig", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } @@ -49225,20 +49241,15 @@ func schema_openshift_api_operator_v1_MachineConfigurationStatus(ref common.Refe SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "observedGeneration is the last generation change you've dealt with", - Type: []string{"integer"}, - Format: "int64", - }, - }, "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-map-keys": []interface{}{ "type", }, - "x-kubernetes-list-type": "map", + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", }, }, SchemaProps: spec.SchemaProps{ @@ -49248,88 +49259,31 @@ func schema_openshift_api_operator_v1_MachineConfigurationStatus(ref common.Refe Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.OperatorCondition"), - }, - }, - }, - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version is the level this availability applies to", - Type: []string{"string"}, - Format: "", - }, - }, - "readyReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "readyReplicas indicates how many replicas are ready and at the desired state", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "generations": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.GenerationStatus"), + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), }, }, }, }, }, - "latestAvailableRevision": { + "observedGeneration": { SchemaProps: spec.SchemaProps{ - Description: "latestAvailableRevision is the deploymentID of the most recent deployment", + Description: "observedGeneration is the last generation change you've dealt with", Type: []string{"integer"}, - Format: "int32", - }, - }, - "latestAvailableRevisionReason": { - SchemaProps: spec.SchemaProps{ - Description: "latestAvailableRevisionReason describe the detailed reason for the most recent deployment", - Type: []string{"string"}, - Format: "", + Format: "int64", }, }, - "nodeStatuses": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "nodeName", - }, - "x-kubernetes-list-type": "map", - }, - }, + "nodeDisruptionPolicyStatus": { SchemaProps: spec.SchemaProps{ - Description: "nodeStatuses track the deployment values and errors across individual nodes", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeStatus"), - }, - }, - }, + Description: "nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine Config Daemon during future node updates.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatus"), }, }, }, - Required: []string{"readyReplicas"}, }, }, Dependencies: []string{ - "github.com/openshift/api/operator/v1.GenerationStatus", "github.com/openshift/api/operator/v1.NodeStatus", "github.com/openshift/api/operator/v1.OperatorCondition"}, + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, } } @@ -50023,6 +49977,328 @@ func schema_openshift_api_operator_v1_NetworkStatus(ref common.ReferenceCallback } } +func schema_openshift_api_operator_v1_NodeDisruptionPolicyAction(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "reload": { + SchemaProps: spec.SchemaProps{ + Description: "reload specifies the service to reload, only valid if type is reload", + Ref: ref("github.com/openshift/api/operator/v1.ReloadService"), + }, + }, + "restart": { + SchemaProps: spec.SchemaProps{ + Description: "restart specifies the service to restart, only valid if type is restart", + Ref: ref("github.com/openshift/api/operator/v1.RestartService"), + }, + }, + }, + Required: []string{"type"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "type", + "fields-to-discriminateBy": map[string]interface{}{ + "reload": "Reload", + "restart": "Restart", + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.ReloadService", "github.com/openshift/api/operator/v1.RestartService"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicyClusterStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeDisruptionPolicyClusterStatus is the type for the status object, rendered by the controller as a merge of cluster defaults and user provided policies", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "files": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "path", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "files is a list of MachineConfig file definitions and actions to take to changes on those paths", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile"), + }, + }, + }, + }, + }, + "units": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "units is a list MachineConfig unit definitions and actions to take on changes to those services", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit"), + }, + }, + }, + }, + }, + "sshkey": { + SchemaProps: spec.SchemaProps{ + Description: "sshkey is the overall sshkey MachineConfig definition", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile", "github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey", "github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicyConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeDisruptionPolicyConfig is the overall spec definition for files/units/sshkeys", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "files": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "path", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "files is a list of MachineConfig file definitions and actions to take to changes on those paths This list supports a maximum of 50 entries.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile"), + }, + }, + }, + }, + }, + "units": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "units is a list MachineConfig unit definitions and actions to take on changes to those services This list supports a maximum of 50 entries.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit"), + }, + }, + }, + }, + }, + "sshkey": { + SchemaProps: spec.SchemaProps{ + Description: "sshkey maps to the ignition.sshkeys field in the MachineConfig object, definition an action for this will apply to all sshkey changes in the cluster", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile", "github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey", "github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicyFile(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeDisruptionPolicyFile is a file entry and corresponding actions to take", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Description: "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "actions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"), + }, + }, + }, + }, + }, + }, + Required: []string{"path", "actions"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicySSHKey(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeDisruptionPolicySSHKey is actions to take for any SSHKey change", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "actions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"), + }, + }, + }, + }, + }, + }, + Required: []string{"actions"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicyStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clusterPolicies": { + SchemaProps: spec.SchemaProps{ + Description: "clusterPolicies is a merge of cluster default and user provided node disruption policies.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyClusterStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyClusterStatus"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicyUnit(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeDisruptionPolicyUnit is a systemd unit name and corresponding actions to take", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name represents the service name of a systemd service managed through a MachineConfig Actions specified will be applied for changes to the named service. Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "actions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"), + }, + }, + }, + }, + }, + }, + Required: []string{"name", "actions"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"}, + } +} + func schema_openshift_api_operator_v1_NodePlacement(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -51335,6 +51611,28 @@ func schema_openshift_api_operator_v1_QuickStarts(ref common.ReferenceCallback) } } +func schema_openshift_api_operator_v1_ReloadService(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ReloadService allows the user to specify the services to be reloaded", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "serviceName": { + SchemaProps: spec.SchemaProps{ + Description: "serviceName is the full name (e.g. crio.service) of the service to be reloaded Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"serviceName"}, + }, + }, + } +} + func schema_openshift_api_operator_v1_ResourceAttributesAccessReview(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -51378,6 +51676,28 @@ func schema_openshift_api_operator_v1_ResourceAttributesAccessReview(ref common. } } +func schema_openshift_api_operator_v1_RestartService(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RestartService allows the user to specify the services to be restarted", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "serviceName": { + SchemaProps: spec.SchemaProps{ + Description: "serviceName is the full name (e.g. crio.service) of the service to be restarted Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"serviceName"}, + }, + }, + } +} + func schema_openshift_api_operator_v1_RouteAdmissionPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/openapi/openapi.json b/openapi/openapi.json index 9d885c38910..c457f9516d9 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -28734,6 +28734,11 @@ "type": "string", "default": "" }, + "nodeDisruptionPolicy": { + "description": "nodeDisruptionPolicy allows an admin to set granular node disruption actions for MachineConfig-based updates, such as drains, service reloads, etc. Specifying this will allow for less downtime when doing small configuration updates to the cluster. This configuration has no effect on cluster upgrades which will still incur node disruption where required.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig" + }, "observedConfig": { "description": "observedConfig holds a sparse config that controller has observed from the cluster state. It exists in spec because it is an input to the level for the operator", "default": {}, @@ -28757,66 +28762,30 @@ }, "com.github.openshift.api.operator.v1.MachineConfigurationStatus": { "type": "object", - "required": [ - "readyReplicas" - ], "properties": { "conditions": { "description": "conditions is a list of conditions and their status", "type": "array", "items": { "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.OperatorCondition" + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" }, "x-kubernetes-list-map-keys": [ "type" ], - "x-kubernetes-list-type": "map" - }, - "generations": { - "description": "generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.", - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.GenerationStatus" - }, - "x-kubernetes-list-type": "atomic" - }, - "latestAvailableRevision": { - "description": "latestAvailableRevision is the deploymentID of the most recent deployment", - "type": "integer", - "format": "int32" - }, - "latestAvailableRevisionReason": { - "description": "latestAvailableRevisionReason describe the detailed reason for the most recent deployment", - "type": "string" + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" }, - "nodeStatuses": { - "description": "nodeStatuses track the deployment values and errors across individual nodes", - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeStatus" - }, - "x-kubernetes-list-map-keys": [ - "nodeName" - ], - "x-kubernetes-list-type": "map" + "nodeDisruptionPolicyStatus": { + "description": "nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine Config Daemon during future node updates.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatus" }, "observedGeneration": { "description": "observedGeneration is the last generation change you've dealt with", "type": "integer", "format": "int64" - }, - "readyReplicas": { - "description": "readyReplicas indicates how many replicas are ready and at the desired state", - "type": "integer", - "format": "int32", - "default": 0 - }, - "version": { - "description": "version is the level this availability applies to", - "type": "string" } } }, @@ -29226,6 +29195,182 @@ } } }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "reload": { + "description": "reload specifies the service to reload, only valid if type is reload", + "$ref": "#/definitions/com.github.openshift.api.operator.v1.ReloadService" + }, + "restart": { + "description": "restart specifies the service to restart, only valid if type is restart", + "$ref": "#/definitions/com.github.openshift.api.operator.v1.RestartService" + }, + "type": { + "description": "type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", + "type": "string", + "default": "" + } + }, + "x-kubernetes-unions": [ + { + "discriminator": "type", + "fields-to-discriminateBy": { + "reload": "Reload", + "restart": "Restart" + } + } + ] + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyClusterStatus": { + "description": "NodeDisruptionPolicyClusterStatus is the type for the status object, rendered by the controller as a merge of cluster defaults and user provided policies", + "type": "object", + "properties": { + "files": { + "description": "files is a list of MachineConfig file definitions and actions to take to changes on those paths", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyFile" + }, + "x-kubernetes-list-map-keys": [ + "path" + ], + "x-kubernetes-list-type": "map" + }, + "sshkey": { + "description": "sshkey is the overall sshkey MachineConfig definition", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySSHKey" + }, + "units": { + "description": "units is a list MachineConfig unit definitions and actions to take on changes to those services", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyUnit" + }, + "x-kubernetes-list-map-keys": [ + "name" + ], + "x-kubernetes-list-type": "map" + } + } + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig": { + "description": "NodeDisruptionPolicyConfig is the overall spec definition for files/units/sshkeys", + "type": "object", + "properties": { + "files": { + "description": "files is a list of MachineConfig file definitions and actions to take to changes on those paths This list supports a maximum of 50 entries.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyFile" + }, + "x-kubernetes-list-map-keys": [ + "path" + ], + "x-kubernetes-list-type": "map" + }, + "sshkey": { + "description": "sshkey maps to the ignition.sshkeys field in the MachineConfig object, definition an action for this will apply to all sshkey changes in the cluster", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySSHKey" + }, + "units": { + "description": "units is a list MachineConfig unit definitions and actions to take on changes to those services This list supports a maximum of 50 entries.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyUnit" + }, + "x-kubernetes-list-map-keys": [ + "name" + ], + "x-kubernetes-list-type": "map" + } + } + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyFile": { + "description": "NodeDisruptionPolicyFile is a file entry and corresponding actions to take", + "type": "object", + "required": [ + "path", + "actions" + ], + "properties": { + "actions": { + "description": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction" + }, + "x-kubernetes-list-type": "atomic" + }, + "path": { + "description": "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicySSHKey": { + "description": "NodeDisruptionPolicySSHKey is actions to take for any SSHKey change", + "type": "object", + "required": [ + "actions" + ], + "properties": { + "actions": { + "description": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction" + }, + "x-kubernetes-list-type": "atomic" + } + } + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatus": { + "type": "object", + "properties": { + "clusterPolicies": { + "description": "clusterPolicies is a merge of cluster default and user provided node disruption policies.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyClusterStatus" + } + } + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyUnit": { + "description": "NodeDisruptionPolicyUnit is a systemd unit name and corresponding actions to take", + "type": "object", + "required": [ + "name", + "actions" + ], + "properties": { + "actions": { + "description": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction" + }, + "x-kubernetes-list-type": "atomic" + }, + "name": { + "description": "name represents the service name of a systemd service managed through a MachineConfig Actions specified will be applied for changes to the named service. Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.operator.v1.NodePlacement": { "description": "NodePlacement describes node scheduling configuration for an ingress controller.", "type": "object", @@ -30004,6 +30149,20 @@ } } }, + "com.github.openshift.api.operator.v1.ReloadService": { + "description": "ReloadService allows the user to specify the services to be reloaded", + "type": "object", + "required": [ + "serviceName" + ], + "properties": { + "serviceName": { + "description": "serviceName is the full name (e.g. crio.service) of the service to be reloaded Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.operator.v1.ResourceAttributesAccessReview": { "description": "ResourceAttributesAccessReview defines the visibility of the perspective depending on the access review checks. `required` and `missing` can work together esp. in the case where the cluster admin wants to show another perspective to users without specific permissions. Out of `required` and `missing` atleast one property should be non-empty.", "type": "object", @@ -30026,6 +30185,20 @@ } } }, + "com.github.openshift.api.operator.v1.RestartService": { + "description": "RestartService allows the user to specify the services to be restarted", + "type": "object", + "required": [ + "serviceName" + ], + "properties": { + "serviceName": { + "description": "serviceName is the full name (e.g. crio.service) of the service to be restarted Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.operator.v1.RouteAdmissionPolicy": { "description": "RouteAdmissionPolicy is an admission policy for allowing new route claims.", "type": "object", diff --git a/operator/v1/techpreview.machineconfiguration.testsuite.yaml b/operator/v1/techpreview.machineconfiguration.testsuite.yaml index 99ef43c90fa..8ef865413de 100644 --- a/operator/v1/techpreview.machineconfiguration.testsuite.yaml +++ b/operator/v1/techpreview.machineconfiguration.testsuite.yaml @@ -115,3 +115,198 @@ tests: selection: mode: All expectedError: "spec.managedBootImages.machineManagers[1]: Duplicate value: map[string]interface {}{\"apiGroup\":\"machine.openshift.io\", \"resource\":\"machinesets\"}" + - name: Should be able to create a valid node disruption policy + initial: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: my.service + units: + - name: "my.service" + actions: + - type: Restart + restart: + serviceName: my-other.service + sshkey: + actions: + - type: None + expected: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + logLevel: Normal + operatorLogLevel: Normal + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: my.service + units: + - name: "my.service" + actions: + - type: Restart + restart: + serviceName: my-other.service + sshkey: + actions: + - type: None + - name: Should be able to define a node disruption policy with multiple entries of the same type + initial: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: my.service + - path: "/etc/my-other-file" + actions: + - type: Drain + - type: Restart + restart: + serviceName: my.service + expected: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + logLevel: Normal + operatorLogLevel: Normal + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: my.service + - path: "/etc/my-other-file" + actions: + - type: Drain + - type: Restart + restart: + serviceName: my.service + - name: Node disruption policies with duplicate file entries should fail + initial: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: my.service + - path: "/etc/my-file" + actions: + - type: Drain + - type: Reload + reload: + serviceName: my.service + expectedError: "spec.nodeDisruptionPolicy.files[1]: Duplicate value: map[string]interface {}{\"path\":\"/etc/my-file\"}" + - name: Node disruption policies that specify a reload action should fail if you don't specify the reload field + initial: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + expectedError: "Reload is required when type is reload, and forbidden otherwise" + - name: Node disruption policies that specify a reboot action should not allow other actions in the list + initial: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: Reboot + - type: DaemonReload + expectedError: "Reboot action can only be specified standalone, as it will override any other actions" + - name: Node disruption policies that specify a service that has a valid name prefix + initial: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: .service + expectedError: "Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" + - name: Node disruption policies that specify a service name that ends with a correct extension + initial: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: serv.ice + expectedError: "Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." + - name: Should be able to define a node disruption policy that has a service name which has multiple permitted special characters + initial: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: a:b_c-d\.e.swap + - path: "/etc/my-other-file" + actions: + - type: Drain + - type: Restart + restart: + serviceName: a.b.c.d.e.snapshot + expected: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + logLevel: Normal + operatorLogLevel: Normal + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: a:b_c-d\.e.swap + - path: "/etc/my-other-file" + actions: + - type: Drain + - type: Restart + restart: + serviceName: a.b.c.d.e.snapshot \ No newline at end of file diff --git a/operator/v1/types_machineconfiguration.go b/operator/v1/types_machineconfiguration.go index 2487fc1beb2..8828ff771dc 100644 --- a/operator/v1/types_machineconfiguration.go +++ b/operator/v1/types_machineconfiguration.go @@ -46,12 +46,33 @@ type MachineConfigurationSpec struct { // +openshift:enable:FeatureGate=ManagedBootImages // +optional ManagedBootImages ManagedBootImages `json:"managedBootImages"` + + // nodeDisruptionPolicy allows an admin to set granular node disruption actions for + // MachineConfig-based updates, such as drains, service reloads, etc. Specifying this will allow + // for less downtime when doing small configuration updates to the cluster. This configuration + // has no effect on cluster upgrades which will still incur node disruption where required. + // +openshift:enable:FeatureGate=NodeDisruptionPolicy + // +optional + NodeDisruptionPolicy NodeDisruptionPolicyConfig `json:"nodeDisruptionPolicy"` } type MachineConfigurationStatus struct { - StaticPodOperatorStatus `json:",inline"` + // conditions is a list of conditions and their status + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + + // observedGeneration is the last generation change you've dealt with + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` - // TODO(jkyros): This is where we can put additional bespoke status fields + // nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, + // and will be used by the Machine Config Daemon during future node updates. + // +openshift:enable:FeatureGate=NodeDisruptionPolicy + // +optional + NodeDisruptionPolicyStatus NodeDisruptionPolicyStatus `json:"nodeDisruptionPolicyStatus"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -158,3 +179,191 @@ const ( // This feature only supports MAPI machinesets at this time. MachineAPI MachineManagerMachineSetsAPIGroupType = "machine.openshift.io" ) + +type NodeDisruptionPolicyStatus struct { + // clusterPolicies is a merge of cluster default and user provided node disruption policies. + // +optional + ClusterPolicies NodeDisruptionPolicyClusterStatus `json:"clusterPolicies"` +} + +// NodeDisruptionPolicyConfig is the overall spec definition for files/units/sshkeys +type NodeDisruptionPolicyConfig struct { + // files is a list of MachineConfig file definitions and actions to take to changes on those paths + // This list supports a maximum of 50 entries. + // +optional + // +listType=map + // +listMapKey=path + // +kubebuilder:validation:MaxItems=50 + Files []NodeDisruptionPolicyFile `json:"files"` + // units is a list MachineConfig unit definitions and actions to take on changes to those services + // This list supports a maximum of 50 entries. + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=50 + Units []NodeDisruptionPolicyUnit `json:"units"` + // sshkey maps to the ignition.sshkeys field in the MachineConfig object, definition an action for this + // will apply to all sshkey changes in the cluster + // +optional + SSHKey NodeDisruptionPolicySSHKey `json:"sshkey"` +} + +// NodeDisruptionPolicyClusterStatus is the type for the status object, rendered by the controller as a +// merge of cluster defaults and user provided policies +type NodeDisruptionPolicyClusterStatus struct { + // files is a list of MachineConfig file definitions and actions to take to changes on those paths + // +optional + // +listType=map + // +listMapKey=path + // +kubebuilder:validation:MaxItems=100 + Files []NodeDisruptionPolicyFile `json:"files,omitempty"` + // units is a list MachineConfig unit definitions and actions to take on changes to those services + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=100 + Units []NodeDisruptionPolicyUnit `json:"units,omitempty"` + // sshkey is the overall sshkey MachineConfig definition + // +optional + SSHKey NodeDisruptionPolicySSHKey `json:"sshkey,omitempty"` +} + +// NodeDisruptionPolicyFile is a file entry and corresponding actions to take +type NodeDisruptionPolicyFile struct { + // path is the location of the file being managed through a MachineConfig. + // Actions specified will be applied when changes to the file at the path + // configured in this field. + // +kubebuilder:validation:Required + Path string `json:"path"` + // actions represents the series of commands to be executed on changes to the file at + // the corresponding file path. Actions will be applied in the order that + // they are set in this list. If there are other incoming changes to other MachineConfig + // entries in the same update that require a reboot, the reboot will supercede these actions. + // Valid actions are Reboot, Drain, Reload, DaemonReload and None. + // The Reboot action and the None action cannot be used in conjunction with any of the other actions. + // This list supports a maximum of 10 entries. + // +kubebuilder:validation:Required + // +listType=atomic + // +kubebuilder:validation:MaxItems=10 + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='Reboot') ? size(self) == 1 : true", message="Reboot action can only be specified standalone, as it will override any other actions" + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='None') ? size(self) == 1 : true", message="None action can only be specified standalone, as it will override any other actions" + Actions []NodeDisruptionPolicyAction `json:"actions"` +} + +// NodeDisruptionPolicyUnit is a systemd unit name and corresponding actions to take +type NodeDisruptionPolicyUnit struct { + // name represents the service name of a systemd service managed through a MachineConfig + // Actions specified will be applied for changes to the named service. + // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. + // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". + // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". + // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" + // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." + // +kubebuilder:validation:Required + // +kubebuilder:validation:MaxLength=255 + Name string `json:"name"` + + // actions represents the series of commands to be executed on changes to the file at + // the corresponding file path. Actions will be applied in the order that + // they are set in this list. If there are other incoming changes to other MachineConfig + // entries in the same update that require a reboot, the reboot will supercede these actions. + // Valid actions are Reboot, Drain, Reload, DaemonReload and None. + // The Reboot action and the None action cannot be used in conjunction with any of the other actions. + // This list supports a maximum of 10 entries. + // +kubebuilder:validation:Required + // +listType=atomic + // +kubebuilder:validation:MaxItems=10 + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='Reboot') ? size(self) == 1 : true", message="Reboot action can only be specified standalone, as it will override any other actions" + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='None') ? size(self) == 1 : true", message="None action can only be specified standalone, as it will override any other actions" + Actions []NodeDisruptionPolicyAction `json:"actions"` +} + +// NodeDisruptionPolicySSHKey is actions to take for any SSHKey change +type NodeDisruptionPolicySSHKey struct { + // actions represents the series of commands to be executed on changes to the file at + // the corresponding file path. Actions will be applied in the order that + // they are set in this list. If there are other incoming changes to other MachineConfig + // entries in the same update that require a reboot, the reboot will supercede these actions. + // Valid actions are Reboot, Drain, Reload, DaemonReload and None. + // The Reboot action and the None action cannot be used in conjunction with any of the other actions. + // This list supports a maximum of 10 entries. + // +kubebuilder:validation:Required + // +listType=atomic + // +kubebuilder:validation:MaxItems=10 + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='Reboot') ? size(self) == 1 : true", message="Reboot action can only be specified standalone, as it will override any other actions" + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='None') ? size(self) == 1 : true", message="None action can only be specified standalone, as it will override any other actions" + Actions []NodeDisruptionPolicyAction `json:"actions"` +} + +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Reload' ? has(self.reload) : !has(self.reload)",message="Reload is required when type is reload, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Restart' ? has(self.restart) : !has(self.restart)",message="Restart is required when type is restart, and forbidden otherwise" +// +union +type NodeDisruptionPolicyAction struct { + // type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed + // Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special + // reload/restart requires a corresponding service target specified in the reload/restart field. + // Other values require no further configuration + // +unionDiscriminator + // +kubebuilder:validation:Required + Type NodeDisruptionPolicyActionType `json:"type"` + // reload specifies the service to reload, only valid if type is reload + // +optional + Reload *ReloadService `json:"reload,omitempty"` + // restart specifies the service to restart, only valid if type is restart + // +optional + Restart *RestartService `json:"restart,omitempty"` +} + +// ReloadService allows the user to specify the services to be reloaded +type ReloadService struct { + // serviceName is the full name (e.g. crio.service) of the service to be reloaded + // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. + // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". + // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". + // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" + // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." + // +kubebuilder:validation:Required + // +kubebuilder:validation:MaxLength=255 + ServiceName string `json:"serviceName"` +} + +// RestartService allows the user to specify the services to be restarted +type RestartService struct { + // serviceName is the full name (e.g. crio.service) of the service to be restarted + // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. + // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". + // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". + // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" + // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." + // +kubebuilder:validation:Required + // +kubebuilder:validation:MaxLength=255 + ServiceName string `json:"serviceName"` +} + +// NodeDisruptionPolicyActionType is a string enum used in a NodeDisruptionPolicyAction object. They describe an action to be performed. +// +kubebuilder:validation:Enum:="Reboot";"Drain";"Reload";"Restart";"DaemonReload";"None";"Special" +type NodeDisruptionPolicyActionType string + +const ( + // Reboot represents an action that will cause nodes to be rebooted. This is the default action by the MCO + // if a reboot policy is not found for a change/update being performed by the MCO. + Reboot NodeDisruptionPolicyActionType = "Reboot" + + // Drain represents an action that will cause nodes to be drained of their workloads. + Drain NodeDisruptionPolicyActionType = "Drain" + + // Reload represents an action that will cause nodes to reload the service described by the Target field. + Reload NodeDisruptionPolicyActionType = "Reload" + + // Restart represents an action that will cause nodes to restart the service described by the Target field. + Restart NodeDisruptionPolicyActionType = "Restart" + + // DaemonReload represents an action that TBD + DaemonReload NodeDisruptionPolicyActionType = "DaemonReload" + + // None represents an action that no handling is required by the MCO. + None NodeDisruptionPolicyActionType = "None" + + // Special represents an action that is internal to the MCO, and is not allowed in user defined NodeDisruption policies. + Special NodeDisruptionPolicyActionType = "Special" +) diff --git a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml index c493e302c8d..4584c007c38 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml @@ -208,6 +208,454 @@ spec: should manage the component pattern: ^(Managed|Unmanaged|Force|Removed)$ type: string + nodeDisruptionPolicy: + description: nodeDisruptionPolicy allows an admin to set granular + node disruption actions for MachineConfig-based updates, such as + drains, service reloads, etc. Specifying this will allow for less + downtime when doing small configuration updates to the cluster. + This configuration has no effect on cluster upgrades which will + still incur node disruption where required. + properties: + files: + description: files is a list of MachineConfig file definitions + and actions to take to changes on those paths This list supports + a maximum of 50 entries. + items: + description: NodeDisruptionPolicyFile is a file entry and corresponding + actions to take + properties: + actions: + description: actions represents the series of commands to + be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that they + are set in this list. If there are other incoming changes + to other MachineConfig entries in the same update that + require a reboot, the reboot will supercede these actions. + Valid actions are Reboot, Drain, Reload, DaemonReload + and None. The Reboot action and the None action cannot + be used in conjunction with any of the other actions. + This list supports a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) + : !has(self.reload)' + - message: Restart is required when type is restart, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' ? + has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) == + 1 : true' + path: + description: path is the location of the file being managed + through a MachineConfig. Actions specified will be applied + when changes to the file at the path configured in this + field. + type: string + required: + - actions + - path + type: object + maxItems: 50 + type: array + x-kubernetes-list-map-keys: + - path + x-kubernetes-list-type: map + sshkey: + description: sshkey maps to the ignition.sshkeys field in the + MachineConfig object, definition an action for this will apply + to all sshkey changes in the cluster + properties: + actions: + description: actions represents the series of commands to + be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that they + are set in this list. If there are other incoming changes + to other MachineConfig entries in the same update that require + a reboot, the reboot will supercede these actions. Valid + actions are Reboot, Drain, Reload, DaemonReload and None. + The Reboot action and the None action cannot be used in + conjunction with any of the other actions. This list supports + a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded Service + names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, where + ${SERVICETYPE} must be one of ".service", ".socket", + ".device", ".mount", ".automount", ".swap", + ".target", ".path", ".timer",".snapshot", ".slice" + or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted Service + names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, where + ${SERVICETYPE} must be one of ".service", ".socket", + ".device", ".mount", ".automount", ".swap", + ".target", ".path", ".timer",".snapshot", ".slice" + or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and forbidden + otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) + : !has(self.reload)' + - message: Restart is required when type is restart, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) + : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) == + 1 : true' + - message: None action can only be specified standalone, as + it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) == + 1 : true' + required: + - actions + type: object + units: + description: units is a list MachineConfig unit definitions and + actions to take on changes to those services This list supports + a maximum of 50 entries. + items: + description: NodeDisruptionPolicyUnit is a systemd unit name + and corresponding actions to take + properties: + actions: + description: actions represents the series of commands to + be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that they + are set in this list. If there are other incoming changes + to other MachineConfig entries in the same update that + require a reboot, the reboot will supercede these actions. + Valid actions are Reboot, Drain, Reload, DaemonReload + and None. The Reboot action and the None action cannot + be used in conjunction with any of the other actions. + This list supports a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) + : !has(self.reload)' + - message: Restart is required when type is restart, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' ? + has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) == + 1 : true' + name: + description: name represents the service name of a systemd + service managed through a MachineConfig Actions specified + will be applied for changes to the named service. Service + names should be of the format ${NAME}${SERVICETYPE} and + can up to 255 characters long. ${NAME} must be atleast + 1 character long and can only consist of alphabets, digits, + ":", "-", "_", ".", and "\". ${SERVICETYPE} must be one + of ".service", ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" + or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected format + is ${NAME}${SERVICETYPE}, where {NAME} must be atleast + 1 character long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. Expected + format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} + must be one of ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - actions + - name + type: object + maxItems: 50 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object observedConfig: description: observedConfig holds a sparse config that controller has observed from the cluster state. It exists in spec because @@ -254,137 +702,532 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: OperatorCondition is just the standard condition fields. + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" 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. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + 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 - generations: - description: generations are used to determine when an item needs - to be reconciled or has changed in a way that needs a reaction. - items: - description: GenerationStatus keeps track of the generation for - a given resource so that decisions about forced updates can be - made. - properties: - group: - description: group is the group of the thing you're tracking - type: string - hash: - description: hash is an optional field set for resources without - generation that are content sensitive like secrets and configmaps - type: string - lastGeneration: - description: lastGeneration is the last generation of the workload - controller involved - format: int64 - type: integer - name: - description: name is the name of the thing you're tracking - type: string - namespace: - description: namespace is where the thing you're tracking is - type: string - resource: - description: resource is the resource type of the thing you're - tracking - type: string - type: object - type: array - x-kubernetes-list-type: atomic - latestAvailableRevision: - description: latestAvailableRevision is the deploymentID of the most - recent deployment - format: int32 - type: integer - latestAvailableRevisionReason: - description: latestAvailableRevisionReason describe the detailed reason - for the most recent deployment - type: string - nodeStatuses: - description: nodeStatuses track the deployment values and errors across - individual nodes - items: - description: NodeStatus provides information about the current state - of a particular node managed by this operator. - properties: - currentRevision: - description: currentRevision is the generation of the most recently - successful deployment - format: int32 - type: integer - lastFailedCount: - description: lastFailedCount is how often the installer pod - of the last failed revision failed. - type: integer - lastFailedReason: - description: lastFailedReason is a machine readable failure - reason string. - type: string - lastFailedRevision: - description: lastFailedRevision is the generation of the deployment - we tried and failed to deploy. - format: int32 - type: integer - lastFailedRevisionErrors: - description: lastFailedRevisionErrors is a list of human readable - errors during the failed deployment referenced in lastFailedRevision. - items: - type: string - type: array - x-kubernetes-list-type: atomic - lastFailedTime: - description: lastFailedTime is the time the last failed revision - failed the last time. - format: date-time - type: string - lastFallbackCount: - description: lastFallbackCount is how often a fallback to a - previous revision happened. - type: integer - nodeName: - description: nodeName is the name of the node - type: string - targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply - format: int32 - type: integer - required: - - nodeName - type: object - type: array - x-kubernetes-list-map-keys: - - nodeName - x-kubernetes-list-type: map + nodeDisruptionPolicyStatus: + description: nodeDisruptionPolicyStatus status reflects what the latest + cluster-validated policies are, and will be used by the Machine + Config Daemon during future node updates. + properties: + clusterPolicies: + description: clusterPolicies is a merge of cluster default and + user provided node disruption policies. + properties: + files: + description: files is a list of MachineConfig file definitions + and actions to take to changes on those paths + items: + description: NodeDisruptionPolicyFile is a file entry and + corresponding actions to take + properties: + actions: + description: actions represents the series of commands + to be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that + they are set in this list. If there are other incoming + changes to other MachineConfig entries in the same + update that require a reboot, the reboot will supercede + these actions. Valid actions are Reboot, Drain, Reload, + DaemonReload and None. The Reboot action and the None + action cannot be used in conjunction with any of the + other actions. This list supports a maximum of 10 + entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + reloaded Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to + restart, only valid if type is restart + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + restarted Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that + will be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' + ? has(self.reload) : !has(self.reload)' + - message: Restart is required when type is restart, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' + ? has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) + == 1 : true' + path: + description: path is the location of the file being + managed through a MachineConfig. Actions specified + will be applied when changes to the file at the path + configured in this field. + type: string + required: + - actions + - path + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - path + x-kubernetes-list-type: map + sshkey: + description: sshkey is the overall sshkey MachineConfig definition + properties: + actions: + description: actions represents the series of commands + to be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that + they are set in this list. If there are other incoming + changes to other MachineConfig entries in the same update + that require a reboot, the reboot will supercede these + actions. Valid actions are Reboot, Drain, Reload, DaemonReload + and None. The Reboot action and the None action cannot + be used in conjunction with any of the other actions. + This list supports a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\". ${SERVICETYPE} must be one of + ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", + ".timer", ".snapshot", ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\". ${SERVICETYPE} must be one of + ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", + ".timer", ".snapshot", ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? + has(self.reload) : !has(self.reload)' + - message: Restart is required when type is restart, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' + ? has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) + == 1 : true' + required: + - actions + type: object + units: + description: units is a list MachineConfig unit definitions + and actions to take on changes to those services + items: + description: NodeDisruptionPolicyUnit is a systemd unit + name and corresponding actions to take + properties: + actions: + description: actions represents the series of commands + to be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that + they are set in this list. If there are other incoming + changes to other MachineConfig entries in the same + update that require a reboot, the reboot will supercede + these actions. Valid actions are Reboot, Drain, Reload, + DaemonReload and None. The Reboot action and the None + action cannot be used in conjunction with any of the + other actions. This list supports a maximum of 10 + entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + reloaded Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to + restart, only valid if type is restart + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + restarted Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that + will be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' + ? has(self.reload) : !has(self.reload)' + - message: Restart is required when type is restart, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' + ? has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) + == 1 : true' + name: + description: name represents the service name of a systemd + service managed through a MachineConfig Actions specified + will be applied for changes to the named service. + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\". ${SERVICETYPE} + must be one of ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", ".timer", + ".snapshot", ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. Expected + format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} + must be one of ".service", ".socket", ".device", + ".mount", ".automount", ".swap", ".target", ".path", + ".timer",".snapshot", ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - actions + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + type: object observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer - readyReplicas: - description: readyReplicas indicates how many replicas are ready and - at the desired state - format: int32 - type: integer - version: - description: version is the level this availability applies to - type: string type: object required: - spec diff --git a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-Default.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-Default.crd.yaml index 8fd0c546df6..7ddaf40ff19 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-Default.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-Default.crd.yaml @@ -120,137 +120,80 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: OperatorCondition is just the standard condition fields. + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" 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. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + 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 - generations: - description: generations are used to determine when an item needs - to be reconciled or has changed in a way that needs a reaction. - items: - description: GenerationStatus keeps track of the generation for - a given resource so that decisions about forced updates can be - made. - properties: - group: - description: group is the group of the thing you're tracking - type: string - hash: - description: hash is an optional field set for resources without - generation that are content sensitive like secrets and configmaps - type: string - lastGeneration: - description: lastGeneration is the last generation of the workload - controller involved - format: int64 - type: integer - name: - description: name is the name of the thing you're tracking - type: string - namespace: - description: namespace is where the thing you're tracking is - type: string - resource: - description: resource is the resource type of the thing you're - tracking - type: string - type: object - type: array - x-kubernetes-list-type: atomic - latestAvailableRevision: - description: latestAvailableRevision is the deploymentID of the most - recent deployment - format: int32 - type: integer - latestAvailableRevisionReason: - description: latestAvailableRevisionReason describe the detailed reason - for the most recent deployment - type: string - nodeStatuses: - description: nodeStatuses track the deployment values and errors across - individual nodes - items: - description: NodeStatus provides information about the current state - of a particular node managed by this operator. - properties: - currentRevision: - description: currentRevision is the generation of the most recently - successful deployment - format: int32 - type: integer - lastFailedCount: - description: lastFailedCount is how often the installer pod - of the last failed revision failed. - type: integer - lastFailedReason: - description: lastFailedReason is a machine readable failure - reason string. - type: string - lastFailedRevision: - description: lastFailedRevision is the generation of the deployment - we tried and failed to deploy. - format: int32 - type: integer - lastFailedRevisionErrors: - description: lastFailedRevisionErrors is a list of human readable - errors during the failed deployment referenced in lastFailedRevision. - items: - type: string - type: array - x-kubernetes-list-type: atomic - lastFailedTime: - description: lastFailedTime is the time the last failed revision - failed the last time. - format: date-time - type: string - lastFallbackCount: - description: lastFallbackCount is how often a fallback to a - previous revision happened. - type: integer - nodeName: - description: nodeName is the name of the node - type: string - targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply - format: int32 - type: integer - required: - - nodeName - type: object - type: array - x-kubernetes-list-map-keys: - - nodeName - x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer - readyReplicas: - description: readyReplicas indicates how many replicas are ready and - at the desired state - format: int32 - type: integer - version: - description: version is the level this availability applies to - type: string type: object required: - spec diff --git a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml index af978be9510..1b276f5a1ad 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml @@ -208,6 +208,454 @@ spec: should manage the component pattern: ^(Managed|Unmanaged|Force|Removed)$ type: string + nodeDisruptionPolicy: + description: nodeDisruptionPolicy allows an admin to set granular + node disruption actions for MachineConfig-based updates, such as + drains, service reloads, etc. Specifying this will allow for less + downtime when doing small configuration updates to the cluster. + This configuration has no effect on cluster upgrades which will + still incur node disruption where required. + properties: + files: + description: files is a list of MachineConfig file definitions + and actions to take to changes on those paths This list supports + a maximum of 50 entries. + items: + description: NodeDisruptionPolicyFile is a file entry and corresponding + actions to take + properties: + actions: + description: actions represents the series of commands to + be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that they + are set in this list. If there are other incoming changes + to other MachineConfig entries in the same update that + require a reboot, the reboot will supercede these actions. + Valid actions are Reboot, Drain, Reload, DaemonReload + and None. The Reboot action and the None action cannot + be used in conjunction with any of the other actions. + This list supports a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) + : !has(self.reload)' + - message: Restart is required when type is restart, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' ? + has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) == + 1 : true' + path: + description: path is the location of the file being managed + through a MachineConfig. Actions specified will be applied + when changes to the file at the path configured in this + field. + type: string + required: + - actions + - path + type: object + maxItems: 50 + type: array + x-kubernetes-list-map-keys: + - path + x-kubernetes-list-type: map + sshkey: + description: sshkey maps to the ignition.sshkeys field in the + MachineConfig object, definition an action for this will apply + to all sshkey changes in the cluster + properties: + actions: + description: actions represents the series of commands to + be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that they + are set in this list. If there are other incoming changes + to other MachineConfig entries in the same update that require + a reboot, the reboot will supercede these actions. Valid + actions are Reboot, Drain, Reload, DaemonReload and None. + The Reboot action and the None action cannot be used in + conjunction with any of the other actions. This list supports + a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded Service + names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, where + ${SERVICETYPE} must be one of ".service", ".socket", + ".device", ".mount", ".automount", ".swap", + ".target", ".path", ".timer",".snapshot", ".slice" + or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted Service + names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, where + ${SERVICETYPE} must be one of ".service", ".socket", + ".device", ".mount", ".automount", ".swap", + ".target", ".path", ".timer",".snapshot", ".slice" + or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and forbidden + otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) + : !has(self.reload)' + - message: Restart is required when type is restart, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) + : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) == + 1 : true' + - message: None action can only be specified standalone, as + it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) == + 1 : true' + required: + - actions + type: object + units: + description: units is a list MachineConfig unit definitions and + actions to take on changes to those services This list supports + a maximum of 50 entries. + items: + description: NodeDisruptionPolicyUnit is a systemd unit name + and corresponding actions to take + properties: + actions: + description: actions represents the series of commands to + be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that they + are set in this list. If there are other incoming changes + to other MachineConfig entries in the same update that + require a reboot, the reboot will supercede these actions. + Valid actions are Reboot, Drain, Reload, DaemonReload + and None. The Reboot action and the None action cannot + be used in conjunction with any of the other actions. + This list supports a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) + : !has(self.reload)' + - message: Restart is required when type is restart, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' ? + has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) == + 1 : true' + name: + description: name represents the service name of a systemd + service managed through a MachineConfig Actions specified + will be applied for changes to the named service. Service + names should be of the format ${NAME}${SERVICETYPE} and + can up to 255 characters long. ${NAME} must be atleast + 1 character long and can only consist of alphabets, digits, + ":", "-", "_", ".", and "\". ${SERVICETYPE} must be one + of ".service", ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" + or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected format + is ${NAME}${SERVICETYPE}, where {NAME} must be atleast + 1 character long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. Expected + format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} + must be one of ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - actions + - name + type: object + maxItems: 50 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object observedConfig: description: observedConfig holds a sparse config that controller has observed from the cluster state. It exists in spec because @@ -254,137 +702,532 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: OperatorCondition is just the standard condition fields. + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" 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. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + 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 - generations: - description: generations are used to determine when an item needs - to be reconciled or has changed in a way that needs a reaction. - items: - description: GenerationStatus keeps track of the generation for - a given resource so that decisions about forced updates can be - made. - properties: - group: - description: group is the group of the thing you're tracking - type: string - hash: - description: hash is an optional field set for resources without - generation that are content sensitive like secrets and configmaps - type: string - lastGeneration: - description: lastGeneration is the last generation of the workload - controller involved - format: int64 - type: integer - name: - description: name is the name of the thing you're tracking - type: string - namespace: - description: namespace is where the thing you're tracking is - type: string - resource: - description: resource is the resource type of the thing you're - tracking - type: string - type: object - type: array - x-kubernetes-list-type: atomic - latestAvailableRevision: - description: latestAvailableRevision is the deploymentID of the most - recent deployment - format: int32 - type: integer - latestAvailableRevisionReason: - description: latestAvailableRevisionReason describe the detailed reason - for the most recent deployment - type: string - nodeStatuses: - description: nodeStatuses track the deployment values and errors across - individual nodes - items: - description: NodeStatus provides information about the current state - of a particular node managed by this operator. - properties: - currentRevision: - description: currentRevision is the generation of the most recently - successful deployment - format: int32 - type: integer - lastFailedCount: - description: lastFailedCount is how often the installer pod - of the last failed revision failed. - type: integer - lastFailedReason: - description: lastFailedReason is a machine readable failure - reason string. - type: string - lastFailedRevision: - description: lastFailedRevision is the generation of the deployment - we tried and failed to deploy. - format: int32 - type: integer - lastFailedRevisionErrors: - description: lastFailedRevisionErrors is a list of human readable - errors during the failed deployment referenced in lastFailedRevision. - items: - type: string - type: array - x-kubernetes-list-type: atomic - lastFailedTime: - description: lastFailedTime is the time the last failed revision - failed the last time. - format: date-time - type: string - lastFallbackCount: - description: lastFallbackCount is how often a fallback to a - previous revision happened. - type: integer - nodeName: - description: nodeName is the name of the node - type: string - targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply - format: int32 - type: integer - required: - - nodeName - type: object - type: array - x-kubernetes-list-map-keys: - - nodeName - x-kubernetes-list-type: map + nodeDisruptionPolicyStatus: + description: nodeDisruptionPolicyStatus status reflects what the latest + cluster-validated policies are, and will be used by the Machine + Config Daemon during future node updates. + properties: + clusterPolicies: + description: clusterPolicies is a merge of cluster default and + user provided node disruption policies. + properties: + files: + description: files is a list of MachineConfig file definitions + and actions to take to changes on those paths + items: + description: NodeDisruptionPolicyFile is a file entry and + corresponding actions to take + properties: + actions: + description: actions represents the series of commands + to be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that + they are set in this list. If there are other incoming + changes to other MachineConfig entries in the same + update that require a reboot, the reboot will supercede + these actions. Valid actions are Reboot, Drain, Reload, + DaemonReload and None. The Reboot action and the None + action cannot be used in conjunction with any of the + other actions. This list supports a maximum of 10 + entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + reloaded Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to + restart, only valid if type is restart + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + restarted Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that + will be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' + ? has(self.reload) : !has(self.reload)' + - message: Restart is required when type is restart, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' + ? has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) + == 1 : true' + path: + description: path is the location of the file being + managed through a MachineConfig. Actions specified + will be applied when changes to the file at the path + configured in this field. + type: string + required: + - actions + - path + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - path + x-kubernetes-list-type: map + sshkey: + description: sshkey is the overall sshkey MachineConfig definition + properties: + actions: + description: actions represents the series of commands + to be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that + they are set in this list. If there are other incoming + changes to other MachineConfig entries in the same update + that require a reboot, the reboot will supercede these + actions. Valid actions are Reboot, Drain, Reload, DaemonReload + and None. The Reboot action and the None action cannot + be used in conjunction with any of the other actions. + This list supports a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\". ${SERVICETYPE} must be one of + ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", + ".timer", ".snapshot", ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\". ${SERVICETYPE} must be one of + ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", + ".timer", ".snapshot", ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? + has(self.reload) : !has(self.reload)' + - message: Restart is required when type is restart, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' + ? has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) + == 1 : true' + required: + - actions + type: object + units: + description: units is a list MachineConfig unit definitions + and actions to take on changes to those services + items: + description: NodeDisruptionPolicyUnit is a systemd unit + name and corresponding actions to take + properties: + actions: + description: actions represents the series of commands + to be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that + they are set in this list. If there are other incoming + changes to other MachineConfig entries in the same + update that require a reboot, the reboot will supercede + these actions. Valid actions are Reboot, Drain, Reload, + DaemonReload and None. The Reboot action and the None + action cannot be used in conjunction with any of the + other actions. This list supports a maximum of 10 + entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + reloaded Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to + restart, only valid if type is restart + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + restarted Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that + will be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' + ? has(self.reload) : !has(self.reload)' + - message: Restart is required when type is restart, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' + ? has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) + == 1 : true' + name: + description: name represents the service name of a systemd + service managed through a MachineConfig Actions specified + will be applied for changes to the named service. + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\". ${SERVICETYPE} + must be one of ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", ".timer", + ".snapshot", ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. Expected + format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} + must be one of ".service", ".socket", ".device", + ".mount", ".automount", ".swap", ".target", ".path", + ".timer",".snapshot", ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - actions + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + type: object observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer - readyReplicas: - description: readyReplicas indicates how many replicas are ready and - at the desired state - format: int32 - type: integer - version: - description: version is the level this availability applies to - type: string type: object required: - spec diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index aa05f328d62..83e9ea8d180 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -2936,6 +2936,7 @@ func (in *MachineConfigurationSpec) DeepCopyInto(out *MachineConfigurationSpec) *out = *in in.StaticPodOperatorSpec.DeepCopyInto(&out.StaticPodOperatorSpec) in.ManagedBootImages.DeepCopyInto(&out.ManagedBootImages) + in.NodeDisruptionPolicy.DeepCopyInto(&out.NodeDisruptionPolicy) return } @@ -2952,7 +2953,14 @@ func (in *MachineConfigurationSpec) DeepCopy() *MachineConfigurationSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineConfigurationStatus) DeepCopyInto(out *MachineConfigurationStatus) { *out = *in - in.StaticPodOperatorStatus.DeepCopyInto(&out.StaticPodOperatorStatus) + 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]) + } + } + in.NodeDisruptionPolicyStatus.DeepCopyInto(&out.NodeDisruptionPolicyStatus) return } @@ -3271,6 +3279,180 @@ func (in *NetworkStatus) DeepCopy() *NetworkStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicyAction) DeepCopyInto(out *NodeDisruptionPolicyAction) { + *out = *in + if in.Reload != nil { + in, out := &in.Reload, &out.Reload + *out = new(ReloadService) + **out = **in + } + if in.Restart != nil { + in, out := &in.Restart, &out.Restart + *out = new(RestartService) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyAction. +func (in *NodeDisruptionPolicyAction) DeepCopy() *NodeDisruptionPolicyAction { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicyAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicyClusterStatus) DeepCopyInto(out *NodeDisruptionPolicyClusterStatus) { + *out = *in + if in.Files != nil { + in, out := &in.Files, &out.Files + *out = make([]NodeDisruptionPolicyFile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Units != nil { + in, out := &in.Units, &out.Units + *out = make([]NodeDisruptionPolicyUnit, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.SSHKey.DeepCopyInto(&out.SSHKey) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyClusterStatus. +func (in *NodeDisruptionPolicyClusterStatus) DeepCopy() *NodeDisruptionPolicyClusterStatus { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicyClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicyConfig) DeepCopyInto(out *NodeDisruptionPolicyConfig) { + *out = *in + if in.Files != nil { + in, out := &in.Files, &out.Files + *out = make([]NodeDisruptionPolicyFile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Units != nil { + in, out := &in.Units, &out.Units + *out = make([]NodeDisruptionPolicyUnit, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.SSHKey.DeepCopyInto(&out.SSHKey) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyConfig. +func (in *NodeDisruptionPolicyConfig) DeepCopy() *NodeDisruptionPolicyConfig { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicyConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicyFile) DeepCopyInto(out *NodeDisruptionPolicyFile) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make([]NodeDisruptionPolicyAction, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyFile. +func (in *NodeDisruptionPolicyFile) DeepCopy() *NodeDisruptionPolicyFile { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicyFile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicySSHKey) DeepCopyInto(out *NodeDisruptionPolicySSHKey) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make([]NodeDisruptionPolicyAction, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicySSHKey. +func (in *NodeDisruptionPolicySSHKey) DeepCopy() *NodeDisruptionPolicySSHKey { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicySSHKey) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicyStatus) DeepCopyInto(out *NodeDisruptionPolicyStatus) { + *out = *in + in.ClusterPolicies.DeepCopyInto(&out.ClusterPolicies) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyStatus. +func (in *NodeDisruptionPolicyStatus) DeepCopy() *NodeDisruptionPolicyStatus { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicyStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicyUnit) DeepCopyInto(out *NodeDisruptionPolicyUnit) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make([]NodeDisruptionPolicyAction, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyUnit. +func (in *NodeDisruptionPolicyUnit) DeepCopy() *NodeDisruptionPolicyUnit { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicyUnit) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodePlacement) DeepCopyInto(out *NodePlacement) { *out = *in @@ -3947,6 +4129,22 @@ func (in *QuickStarts) DeepCopy() *QuickStarts { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReloadService) DeepCopyInto(out *ReloadService) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReloadService. +func (in *ReloadService) DeepCopy() *ReloadService { + if in == nil { + return nil + } + out := new(ReloadService) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceAttributesAccessReview) DeepCopyInto(out *ResourceAttributesAccessReview) { *out = *in @@ -3973,6 +4171,22 @@ func (in *ResourceAttributesAccessReview) DeepCopy() *ResourceAttributesAccessRe return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestartService) DeepCopyInto(out *RestartService) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestartService. +func (in *RestartService) DeepCopy() *RestartService { + if in == nil { + return nil + } + out := new(RestartService) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RouteAdmissionPolicy) DeepCopyInto(out *RouteAdmissionPolicy) { *out = *in diff --git a/operator/v1/zz_generated.featuregated-crd-manifests.yaml b/operator/v1/zz_generated.featuregated-crd-manifests.yaml index 80a248a022c..c1181638754 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests.yaml @@ -303,6 +303,7 @@ machineconfigurations.operator.openshift.io: Category: "" FeatureGates: - ManagedBootImages + - NodeDisruptionPolicy FilenameOperatorName: machine-config FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_80" diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/AAA_ungated.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/AAA_ungated.yaml index f04164fc884..f7bbb575c1f 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/AAA_ungated.yaml @@ -119,137 +119,80 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: OperatorCondition is just the standard condition fields. + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" 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. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + 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 - generations: - description: generations are used to determine when an item needs - to be reconciled or has changed in a way that needs a reaction. - items: - description: GenerationStatus keeps track of the generation for - a given resource so that decisions about forced updates can be - made. - properties: - group: - description: group is the group of the thing you're tracking - type: string - hash: - description: hash is an optional field set for resources without - generation that are content sensitive like secrets and configmaps - type: string - lastGeneration: - description: lastGeneration is the last generation of the workload - controller involved - format: int64 - type: integer - name: - description: name is the name of the thing you're tracking - type: string - namespace: - description: namespace is where the thing you're tracking is - type: string - resource: - description: resource is the resource type of the thing you're - tracking - type: string - type: object - type: array - x-kubernetes-list-type: atomic - latestAvailableRevision: - description: latestAvailableRevision is the deploymentID of the most - recent deployment - format: int32 - type: integer - latestAvailableRevisionReason: - description: latestAvailableRevisionReason describe the detailed reason - for the most recent deployment - type: string - nodeStatuses: - description: nodeStatuses track the deployment values and errors across - individual nodes - items: - description: NodeStatus provides information about the current state - of a particular node managed by this operator. - properties: - currentRevision: - description: currentRevision is the generation of the most recently - successful deployment - format: int32 - type: integer - lastFailedCount: - description: lastFailedCount is how often the installer pod - of the last failed revision failed. - type: integer - lastFailedReason: - description: lastFailedReason is a machine readable failure - reason string. - type: string - lastFailedRevision: - description: lastFailedRevision is the generation of the deployment - we tried and failed to deploy. - format: int32 - type: integer - lastFailedRevisionErrors: - description: lastFailedRevisionErrors is a list of human readable - errors during the failed deployment referenced in lastFailedRevision. - items: - type: string - type: array - x-kubernetes-list-type: atomic - lastFailedTime: - description: lastFailedTime is the time the last failed revision - failed the last time. - format: date-time - type: string - lastFallbackCount: - description: lastFallbackCount is how often a fallback to a - previous revision happened. - type: integer - nodeName: - description: nodeName is the name of the node - type: string - targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply - format: int32 - type: integer - required: - - nodeName - type: object - type: array - x-kubernetes-list-map-keys: - - nodeName - x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer - readyReplicas: - description: readyReplicas indicates how many replicas are ready and - at the desired state - format: int32 - type: integer - version: - description: version is the level this availability applies to - type: string type: object required: - spec diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/ManagedBootImages.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/ManagedBootImages.yaml index 13a3c3865df..4dd5145b329 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/ManagedBootImages.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/ManagedBootImages.yaml @@ -253,137 +253,80 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: OperatorCondition is just the standard condition fields. + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" 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. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + 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 - generations: - description: generations are used to determine when an item needs - to be reconciled or has changed in a way that needs a reaction. - items: - description: GenerationStatus keeps track of the generation for - a given resource so that decisions about forced updates can be - made. - properties: - group: - description: group is the group of the thing you're tracking - type: string - hash: - description: hash is an optional field set for resources without - generation that are content sensitive like secrets and configmaps - type: string - lastGeneration: - description: lastGeneration is the last generation of the workload - controller involved - format: int64 - type: integer - name: - description: name is the name of the thing you're tracking - type: string - namespace: - description: namespace is where the thing you're tracking is - type: string - resource: - description: resource is the resource type of the thing you're - tracking - type: string - type: object - type: array - x-kubernetes-list-type: atomic - latestAvailableRevision: - description: latestAvailableRevision is the deploymentID of the most - recent deployment - format: int32 - type: integer - latestAvailableRevisionReason: - description: latestAvailableRevisionReason describe the detailed reason - for the most recent deployment - type: string - nodeStatuses: - description: nodeStatuses track the deployment values and errors across - individual nodes - items: - description: NodeStatus provides information about the current state - of a particular node managed by this operator. - properties: - currentRevision: - description: currentRevision is the generation of the most recently - successful deployment - format: int32 - type: integer - lastFailedCount: - description: lastFailedCount is how often the installer pod - of the last failed revision failed. - type: integer - lastFailedReason: - description: lastFailedReason is a machine readable failure - reason string. - type: string - lastFailedRevision: - description: lastFailedRevision is the generation of the deployment - we tried and failed to deploy. - format: int32 - type: integer - lastFailedRevisionErrors: - description: lastFailedRevisionErrors is a list of human readable - errors during the failed deployment referenced in lastFailedRevision. - items: - type: string - type: array - x-kubernetes-list-type: atomic - lastFailedTime: - description: lastFailedTime is the time the last failed revision - failed the last time. - format: date-time - type: string - lastFallbackCount: - description: lastFallbackCount is how often a fallback to a - previous revision happened. - type: integer - nodeName: - description: nodeName is the name of the node - type: string - targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply - format: int32 - type: integer - required: - - nodeName - type: object - type: array - x-kubernetes-list-map-keys: - - nodeName - x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer - readyReplicas: - description: readyReplicas indicates how many replicas are ready and - at the desired state - format: int32 - type: integer - version: - description: version is the level this availability applies to - type: string type: object required: - spec diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml new file mode 100644 index 00000000000..c0fe076eedd --- /dev/null +++ b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml @@ -0,0 +1,1103 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/1453 + 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/NodeDisruptionPolicy: "true" + name: machineconfigurations.operator.openshift.io +spec: + group: operator.openshift.io + names: + kind: MachineConfiguration + listKind: MachineConfigurationList + plural: machineconfigurations + singular: machineconfiguration + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: "MachineConfiguration provides information to configure an operator + to manage Machine Configuration. \n 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 is the specification of the desired behavior of the + Machine Config Operator + properties: + failedRevisionLimit: + description: failedRevisionLimit is the number of failed static pod + installer revisions to keep on disk and in the api -1 = unlimited, + 0 or unset = 5 (default) + format: int32 + type: integer + forceRedeploymentReason: + description: forceRedeploymentReason can be used to force the redeployment + of the operand by providing a unique string. This provides a mechanism + to kick a previously failed deployment and provide a reason why + you think it will work this time instead of failing again on the + same config. + type: string + logLevel: + default: Normal + 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 Valid values are: \"Normal\", \"Debug\", + \"Trace\", \"TraceAll\". Defaults to \"Normal\"." + enum: + - "" + - Normal + - Debug + - Trace + - TraceAll + type: string + managementState: + description: managementState indicates whether and how the operator + should manage the component + pattern: ^(Managed|Unmanaged|Force|Removed)$ + type: string + nodeDisruptionPolicy: + description: nodeDisruptionPolicy allows an admin to set granular + node disruption actions for MachineConfig-based updates, such as + drains, service reloads, etc. Specifying this will allow for less + downtime when doing small configuration updates to the cluster. + This configuration has no effect on cluster upgrades which will + still incur node disruption where required. + properties: + files: + description: files is a list of MachineConfig file definitions + and actions to take to changes on those paths This list supports + a maximum of 50 entries. + items: + description: NodeDisruptionPolicyFile is a file entry and corresponding + actions to take + properties: + actions: + description: actions represents the series of commands to + be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that they + are set in this list. If there are other incoming changes + to other MachineConfig entries in the same update that + require a reboot, the reboot will supercede these actions. + Valid actions are Reboot, Drain, Reload, DaemonReload + and None. The Reboot action and the None action cannot + be used in conjunction with any of the other actions. + This list supports a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) + : !has(self.reload)' + - message: Restart is required when type is restart, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' ? + has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) == + 1 : true' + path: + description: path is the location of the file being managed + through a MachineConfig. Actions specified will be applied + when changes to the file at the path configured in this + field. + type: string + required: + - actions + - path + type: object + maxItems: 50 + type: array + x-kubernetes-list-map-keys: + - path + x-kubernetes-list-type: map + sshkey: + description: sshkey maps to the ignition.sshkeys field in the + MachineConfig object, definition an action for this will apply + to all sshkey changes in the cluster + properties: + actions: + description: actions represents the series of commands to + be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that they + are set in this list. If there are other incoming changes + to other MachineConfig entries in the same update that require + a reboot, the reboot will supercede these actions. Valid + actions are Reboot, Drain, Reload, DaemonReload and None. + The Reboot action and the None action cannot be used in + conjunction with any of the other actions. This list supports + a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded Service + names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, where + ${SERVICETYPE} must be one of ".service", ".socket", + ".device", ".mount", ".automount", ".swap", + ".target", ".path", ".timer",".snapshot", ".slice" + or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted Service + names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, where + ${SERVICETYPE} must be one of ".service", ".socket", + ".device", ".mount", ".automount", ".swap", + ".target", ".path", ".timer",".snapshot", ".slice" + or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and forbidden + otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) + : !has(self.reload)' + - message: Restart is required when type is restart, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) + : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) == + 1 : true' + - message: None action can only be specified standalone, as + it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) == + 1 : true' + required: + - actions + type: object + units: + description: units is a list MachineConfig unit definitions and + actions to take on changes to those services This list supports + a maximum of 50 entries. + items: + description: NodeDisruptionPolicyUnit is a systemd unit name + and corresponding actions to take + properties: + actions: + description: actions represents the series of commands to + be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that they + are set in this list. If there are other incoming changes + to other MachineConfig entries in the same update that + require a reboot, the reboot will supercede these actions. + Valid actions are Reboot, Drain, Reload, DaemonReload + and None. The Reboot action and the None action cannot + be used in conjunction with any of the other actions. + This list supports a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and + "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) + : !has(self.reload)' + - message: Restart is required when type is restart, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' ? + has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) == + 1 : true' + name: + description: name represents the service name of a systemd + service managed through a MachineConfig Actions specified + will be applied for changes to the named service. Service + names should be of the format ${NAME}${SERVICETYPE} and + can up to 255 characters long. ${NAME} must be atleast + 1 character long and can only consist of alphabets, digits, + ":", "-", "_", ".", and "\". ${SERVICETYPE} must be one + of ".service", ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" + or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected format + is ${NAME}${SERVICETYPE}, where {NAME} must be atleast + 1 character long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. Expected + format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} + must be one of ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - actions + - name + type: object + maxItems: 50 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + observedConfig: + description: observedConfig holds a sparse config that controller + has observed from the cluster state. It exists in spec because + it is an input to the level for the operator + nullable: true + type: object + x-kubernetes-preserve-unknown-fields: true + operatorLogLevel: + default: Normal + description: "operatorLogLevel is an intent based logging for the + operator itself. 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 themselves. \n Valid values are: \"Normal\", + \"Debug\", \"Trace\", \"TraceAll\". Defaults to \"Normal\"." + enum: + - "" + - Normal + - Debug + - Trace + - TraceAll + type: string + succeededRevisionLimit: + description: succeededRevisionLimit is the number of successful static + pod installer revisions to keep on disk and in the api -1 = unlimited, + 0 or unset = 5 (default) + format: int32 + type: integer + unsupportedConfigOverrides: + description: unsupportedConfigOverrides overrides the final configuration + that was computed by the operator. Red Hat does not support the + use of this field. Misuse of this field could lead to unexpected + behavior or conflict with other configuration options. Seek guidance + from the Red Hat support before using this field. Use of this property + blocks cluster upgrades, it must be removed before upgrading your + cluster. + nullable: true + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + status: + description: status is the most recently observed status of the Machine + Config Operator + properties: + conditions: + description: conditions is a list of conditions and their status + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + 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. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + 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 + nodeDisruptionPolicyStatus: + description: nodeDisruptionPolicyStatus status reflects what the latest + cluster-validated policies are, and will be used by the Machine + Config Daemon during future node updates. + properties: + clusterPolicies: + description: clusterPolicies is a merge of cluster default and + user provided node disruption policies. + properties: + files: + description: files is a list of MachineConfig file definitions + and actions to take to changes on those paths + items: + description: NodeDisruptionPolicyFile is a file entry and + corresponding actions to take + properties: + actions: + description: actions represents the series of commands + to be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that + they are set in this list. If there are other incoming + changes to other MachineConfig entries in the same + update that require a reboot, the reboot will supercede + these actions. Valid actions are Reboot, Drain, Reload, + DaemonReload and None. The Reboot action and the None + action cannot be used in conjunction with any of the + other actions. This list supports a maximum of 10 + entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + reloaded Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to + restart, only valid if type is restart + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + restarted Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that + will be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' + ? has(self.reload) : !has(self.reload)' + - message: Restart is required when type is restart, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' + ? has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) + == 1 : true' + path: + description: path is the location of the file being + managed through a MachineConfig. Actions specified + will be applied when changes to the file at the path + configured in this field. + type: string + required: + - actions + - path + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - path + x-kubernetes-list-type: map + sshkey: + description: sshkey is the overall sshkey MachineConfig definition + properties: + actions: + description: actions represents the series of commands + to be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that + they are set in this list. If there are other incoming + changes to other MachineConfig entries in the same update + that require a reboot, the reboot will supercede these + actions. Valid actions are Reboot, Drain, Reload, DaemonReload + and None. The Reboot action and the None action cannot + be used in conjunction with any of the other actions. + This list supports a maximum of 10 entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be reloaded + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\". ${SERVICETYPE} must be one of + ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", + ".timer", ".snapshot", ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to restart, + only valid if type is restart + properties: + serviceName: + description: serviceName is the full name (e.g. + crio.service) of the service to be restarted + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\". ${SERVICETYPE} must be one of + ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", + ".timer", ".snapshot", ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that will + be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' ? + has(self.reload) : !has(self.reload)' + - message: Restart is required when type is restart, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' + ? has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) + == 1 : true' + required: + - actions + type: object + units: + description: units is a list MachineConfig unit definitions + and actions to take on changes to those services + items: + description: NodeDisruptionPolicyUnit is a systemd unit + name and corresponding actions to take + properties: + actions: + description: actions represents the series of commands + to be executed on changes to the file at the corresponding + file path. Actions will be applied in the order that + they are set in this list. If there are other incoming + changes to other MachineConfig entries in the same + update that require a reboot, the reboot will supercede + these actions. Valid actions are Reboot, Drain, Reload, + DaemonReload and None. The Reboot action and the None + action cannot be used in conjunction with any of the + other actions. This list supports a maximum of 10 + entries. + items: + properties: + reload: + description: reload specifies the service to reload, + only valid if type is reload + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + reloaded Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + restart: + description: restart specifies the service to + restart, only valid if type is restart + properties: + serviceName: + description: serviceName is the full name + (e.g. crio.service) of the service to be + restarted Service names should be of the + format ${NAME}${SERVICETYPE} and can up + to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", + and "\". ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer", ".snapshot", + ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service + name. Expected format is ${NAME}${SERVICETYPE}, + where ${SERVICETYPE} must be one of ".service", + ".socket", ".device", ".mount", ".automount", + ".swap", ".target", ".path", ".timer",".snapshot", + ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - serviceName + type: object + type: + description: type represents the commands that + will be carried out if this NodeDisruptionPolicyActionType + is executed Valid value are Reboot, Drain, Reload, + Restart, DaemonReload, None and Special reload/restart + requires a corresponding service target specified + in the reload/restart field. Other values require + no further configuration + enum: + - Reboot + - Drain + - Reload + - Restart + - DaemonReload + - None + - Special + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: Reload is required when type is reload, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Reload'' + ? has(self.reload) : !has(self.reload)' + - message: Restart is required when type is restart, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Restart'' + ? has(self.restart) : !has(self.restart)' + maxItems: 10 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: Reboot action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''Reboot'') ? size(self) + == 1 : true' + - message: None action can only be specified standalone, + as it will override any other actions + rule: 'self.exists(x, x.type==''None'') ? size(self) + == 1 : true' + name: + description: name represents the service name of a systemd + service managed through a MachineConfig Actions specified + will be applied for changes to the named service. + Service names should be of the format ${NAME}${SERVICETYPE} + and can up to 255 characters long. ${NAME} must be + atleast 1 character long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\". ${SERVICETYPE} + must be one of ".service", ".socket", ".device", ".mount", + ".automount", ".swap", ".target", ".path", ".timer", + ".snapshot", ".slice" or ".scope". + maxLength: 255 + type: string + x-kubernetes-validations: + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') + - message: Invalid ${SERVICETYPE} in service name. Expected + format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} + must be one of ".service", ".socket", ".device", + ".mount", ".automount", ".swap", ".target", ".path", + ".timer",".snapshot", ".slice" or ".scope". + rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + required: + - actions + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + type: object + observedGeneration: + description: observedGeneration is the last generation change you've + dealt with + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index 1ff3042672d..ad3d7ff3790 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -1275,13 +1275,24 @@ func (MachineConfigurationList) SwaggerDoc() map[string]string { } var map_MachineConfigurationSpec = map[string]string{ - "managedBootImages": "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.", + "managedBootImages": "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.", + "nodeDisruptionPolicy": "nodeDisruptionPolicy allows an admin to set granular node disruption actions for MachineConfig-based updates, such as drains, service reloads, etc. Specifying this will allow for less downtime when doing small configuration updates to the cluster. This configuration has no effect on cluster upgrades which will still incur node disruption where required.", } func (MachineConfigurationSpec) SwaggerDoc() map[string]string { return map_MachineConfigurationSpec } +var map_MachineConfigurationStatus = map[string]string{ + "conditions": "conditions is a list of conditions and their status", + "observedGeneration": "observedGeneration is the last generation change you've dealt with", + "nodeDisruptionPolicyStatus": "nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine Config Daemon during future node updates.", +} + +func (MachineConfigurationStatus) SwaggerDoc() map[string]string { + return map_MachineConfigurationStatus +} + var map_MachineManager = map[string]string{ "": "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.", "resource": "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.", @@ -1310,6 +1321,75 @@ func (ManagedBootImages) SwaggerDoc() map[string]string { return map_ManagedBootImages } +var map_NodeDisruptionPolicyAction = map[string]string{ + "type": "type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", + "reload": "reload specifies the service to reload, only valid if type is reload", + "restart": "restart specifies the service to restart, only valid if type is restart", +} + +func (NodeDisruptionPolicyAction) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyAction +} + +var map_NodeDisruptionPolicyClusterStatus = map[string]string{ + "": "NodeDisruptionPolicyClusterStatus is the type for the status object, rendered by the controller as a merge of cluster defaults and user provided policies", + "files": "files is a list of MachineConfig file definitions and actions to take to changes on those paths", + "units": "units is a list MachineConfig unit definitions and actions to take on changes to those services", + "sshkey": "sshkey is the overall sshkey MachineConfig definition", +} + +func (NodeDisruptionPolicyClusterStatus) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyClusterStatus +} + +var map_NodeDisruptionPolicyConfig = map[string]string{ + "": "NodeDisruptionPolicyConfig is the overall spec definition for files/units/sshkeys", + "files": "files is a list of MachineConfig file definitions and actions to take to changes on those paths This list supports a maximum of 50 entries.", + "units": "units is a list MachineConfig unit definitions and actions to take on changes to those services This list supports a maximum of 50 entries.", + "sshkey": "sshkey maps to the ignition.sshkeys field in the MachineConfig object, definition an action for this will apply to all sshkey changes in the cluster", +} + +func (NodeDisruptionPolicyConfig) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyConfig +} + +var map_NodeDisruptionPolicyFile = map[string]string{ + "": "NodeDisruptionPolicyFile is a file entry and corresponding actions to take", + "path": "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", +} + +func (NodeDisruptionPolicyFile) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyFile +} + +var map_NodeDisruptionPolicySSHKey = map[string]string{ + "": "NodeDisruptionPolicySSHKey is actions to take for any SSHKey change", + "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", +} + +func (NodeDisruptionPolicySSHKey) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicySSHKey +} + +var map_NodeDisruptionPolicyStatus = map[string]string{ + "clusterPolicies": "clusterPolicies is a merge of cluster default and user provided node disruption policies.", +} + +func (NodeDisruptionPolicyStatus) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyStatus +} + +var map_NodeDisruptionPolicyUnit = map[string]string{ + "": "NodeDisruptionPolicyUnit is a systemd unit name and corresponding actions to take", + "name": "name represents the service name of a systemd service managed through a MachineConfig Actions specified will be applied for changes to the named service. Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", + "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", +} + +func (NodeDisruptionPolicyUnit) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyUnit +} + var map_PartialSelector = map[string]string{ "": "PartialSelector provides label selector(s) that can be used to match machine management resources.", "machineResourceSelector": "machineResourceSelector is a label selector that can be used to select machine resources like MachineSets.", @@ -1319,6 +1399,24 @@ func (PartialSelector) SwaggerDoc() map[string]string { return map_PartialSelector } +var map_ReloadService = map[string]string{ + "": "ReloadService allows the user to specify the services to be reloaded", + "serviceName": "serviceName is the full name (e.g. crio.service) of the service to be reloaded Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", +} + +func (ReloadService) SwaggerDoc() map[string]string { + return map_ReloadService +} + +var map_RestartService = map[string]string{ + "": "RestartService allows the user to specify the services to be restarted", + "serviceName": "serviceName is the full name (e.g. crio.service) of the service to be restarted Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", +} + +func (RestartService) SwaggerDoc() map[string]string { + return map_RestartService +} + var map_AdditionalNetworkDefinition = map[string]string{ "": "AdditionalNetworkDefinition configures an extra network that is available but not created by default. Instead, pods must request them by name. type must be specified, along with exactly one \"Config\" that matches the type.", "type": "type is the type of network The supported values are NetworkTypeRaw, NetworkTypeSimpleMacvlan", diff --git a/payload-manifests/featuregates/featureGate-Hypershift-Default.yaml b/payload-manifests/featuregates/featureGate-Hypershift-Default.yaml index 1e7b228c6fb..a005066a1dc 100644 --- a/payload-manifests/featuregates/featureGate-Hypershift-Default.yaml +++ b/payload-manifests/featuregates/featureGate-Hypershift-Default.yaml @@ -97,6 +97,9 @@ { "name": "NewOLM" }, + { + "name": "NodeDisruptionPolicy" + }, { "name": "NodeSwap" }, diff --git a/payload-manifests/featuregates/featureGate-Hypershift-TechPreviewNoUpgrade.yaml b/payload-manifests/featuregates/featureGate-Hypershift-TechPreviewNoUpgrade.yaml index eedf12380a6..705d608b7b1 100644 --- a/payload-manifests/featuregates/featureGate-Hypershift-TechPreviewNoUpgrade.yaml +++ b/payload-manifests/featuregates/featureGate-Hypershift-TechPreviewNoUpgrade.yaml @@ -137,6 +137,9 @@ { "name": "NewOLM" }, + { + "name": "NodeDisruptionPolicy" + }, { "name": "NodeSwap" }, diff --git a/payload-manifests/featuregates/featureGate-SelfManagedHA-Default.yaml b/payload-manifests/featuregates/featureGate-SelfManagedHA-Default.yaml index b8fdf28c03e..369ca438568 100644 --- a/payload-manifests/featuregates/featureGate-SelfManagedHA-Default.yaml +++ b/payload-manifests/featuregates/featureGate-SelfManagedHA-Default.yaml @@ -100,6 +100,9 @@ { "name": "NewOLM" }, + { + "name": "NodeDisruptionPolicy" + }, { "name": "NodeSwap" }, diff --git a/payload-manifests/featuregates/featureGate-SelfManagedHA-TechPreviewNoUpgrade.yaml b/payload-manifests/featuregates/featureGate-SelfManagedHA-TechPreviewNoUpgrade.yaml index c1c4afa6bb9..e7df8417327 100644 --- a/payload-manifests/featuregates/featureGate-SelfManagedHA-TechPreviewNoUpgrade.yaml +++ b/payload-manifests/featuregates/featureGate-SelfManagedHA-TechPreviewNoUpgrade.yaml @@ -137,6 +137,9 @@ { "name": "NewOLM" }, + { + "name": "NodeDisruptionPolicy" + }, { "name": "NodeSwap" }, diff --git a/payload-manifests/featuregates/featureGate-SingleNode-Default.yaml b/payload-manifests/featuregates/featureGate-SingleNode-Default.yaml index 1442955bb0b..d4e9a7b4bff 100644 --- a/payload-manifests/featuregates/featureGate-SingleNode-Default.yaml +++ b/payload-manifests/featuregates/featureGate-SingleNode-Default.yaml @@ -100,6 +100,9 @@ { "name": "NewOLM" }, + { + "name": "NodeDisruptionPolicy" + }, { "name": "NodeSwap" }, diff --git a/payload-manifests/featuregates/featureGate-SingleNode-TechPreviewNoUpgrade.yaml b/payload-manifests/featuregates/featureGate-SingleNode-TechPreviewNoUpgrade.yaml index b0d41f8caeb..9ed8e788141 100644 --- a/payload-manifests/featuregates/featureGate-SingleNode-TechPreviewNoUpgrade.yaml +++ b/payload-manifests/featuregates/featureGate-SingleNode-TechPreviewNoUpgrade.yaml @@ -137,6 +137,9 @@ { "name": "NewOLM" }, + { + "name": "NodeDisruptionPolicy" + }, { "name": "NodeSwap" }, From e9591931a69d91d75cc3852f7a0aa94ff7613d63 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 17 Mar 2024 08:40:06 -0400 Subject: [PATCH 2/3] adds NodeDisruptionPolicy status objects The new NodeDisruption status objects contain a "special" action type that will only be used by the MCO's controller to indicate some internal actions. They are not part of the NodeDisruptionPolicyConfig object and cannot be set by the user. --- .../generated_openapi/zz_generated.openapi.go | 317 ++++++++++++++---- openapi/openapi.json | 186 +++++++--- ...review.machineconfiguration.testsuite.yaml | 18 +- operator/v1/types_machineconfiguration.go | 173 ++++++++-- ...ineconfigurations-CustomNoUpgrade.crd.yaml | 199 +++++------ ...nfigurations-TechPreviewNoUpgrade.crd.yaml | 199 +++++------ operator/v1/zz_generated.deepcopy.go | 185 +++++++--- .../NodeDisruptionPolicy.yaml | 199 +++++------ .../v1/zz_generated.swagger_doc_generated.go | 83 +++-- 9 files changed, 1046 insertions(+), 513 deletions(-) diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 15a5cf2f045..d0608aa6652 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -975,13 +975,17 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/operator/v1.NetworkMigration": schema_openshift_api_operator_v1_NetworkMigration(ref), "github.com/openshift/api/operator/v1.NetworkSpec": schema_openshift_api_operator_v1_NetworkSpec(ref), "github.com/openshift/api/operator/v1.NetworkStatus": schema_openshift_api_operator_v1_NetworkStatus(ref), - "github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction": schema_openshift_api_operator_v1_NodeDisruptionPolicyAction(ref), "github.com/openshift/api/operator/v1.NodeDisruptionPolicyClusterStatus": schema_openshift_api_operator_v1_NodeDisruptionPolicyClusterStatus(ref), "github.com/openshift/api/operator/v1.NodeDisruptionPolicyConfig": schema_openshift_api_operator_v1_NodeDisruptionPolicyConfig(ref), - "github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile": schema_openshift_api_operator_v1_NodeDisruptionPolicyFile(ref), - "github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey": schema_openshift_api_operator_v1_NodeDisruptionPolicySSHKey(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecAction": schema_openshift_api_operator_v1_NodeDisruptionPolicySpecAction(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecFile": schema_openshift_api_operator_v1_NodeDisruptionPolicySpecFile(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecSSHKey": schema_openshift_api_operator_v1_NodeDisruptionPolicySpecSSHKey(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecUnit": schema_openshift_api_operator_v1_NodeDisruptionPolicySpecUnit(ref), "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatus": schema_openshift_api_operator_v1_NodeDisruptionPolicyStatus(ref), - "github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit": schema_openshift_api_operator_v1_NodeDisruptionPolicyUnit(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusAction": schema_openshift_api_operator_v1_NodeDisruptionPolicyStatusAction(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusFile": schema_openshift_api_operator_v1_NodeDisruptionPolicyStatusFile(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusSSHKey": schema_openshift_api_operator_v1_NodeDisruptionPolicyStatusSSHKey(ref), + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusUnit": schema_openshift_api_operator_v1_NodeDisruptionPolicyStatusUnit(ref), "github.com/openshift/api/operator/v1.NodePlacement": schema_openshift_api_operator_v1_NodePlacement(ref), "github.com/openshift/api/operator/v1.NodePortStrategy": schema_openshift_api_operator_v1_NodePortStrategy(ref), "github.com/openshift/api/operator/v1.NodeStatus": schema_openshift_api_operator_v1_NodeStatus(ref), @@ -49977,54 +49981,6 @@ func schema_openshift_api_operator_v1_NetworkStatus(ref common.ReferenceCallback } } -func schema_openshift_api_operator_v1_NodeDisruptionPolicyAction(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "reload": { - SchemaProps: spec.SchemaProps{ - Description: "reload specifies the service to reload, only valid if type is reload", - Ref: ref("github.com/openshift/api/operator/v1.ReloadService"), - }, - }, - "restart": { - SchemaProps: spec.SchemaProps{ - Description: "restart specifies the service to restart, only valid if type is restart", - Ref: ref("github.com/openshift/api/operator/v1.RestartService"), - }, - }, - }, - Required: []string{"type"}, - }, - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-unions": []interface{}{ - map[string]interface{}{ - "discriminator": "type", - "fields-to-discriminateBy": map[string]interface{}{ - "reload": "Reload", - "restart": "Restart", - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/openshift/api/operator/v1.ReloadService", "github.com/openshift/api/operator/v1.RestartService"}, - } -} - func schema_openshift_api_operator_v1_NodeDisruptionPolicyClusterStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -50048,7 +50004,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyClusterStatus(ref comm Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile"), + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusFile"), }, }, }, @@ -50070,7 +50026,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyClusterStatus(ref comm Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit"), + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusUnit"), }, }, }, @@ -50080,14 +50036,14 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyClusterStatus(ref comm SchemaProps: spec.SchemaProps{ Description: "sshkey is the overall sshkey MachineConfig definition", Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey"), + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusSSHKey"), }, }, }, }, }, Dependencies: []string{ - "github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile", "github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey", "github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit"}, + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusFile", "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusSSHKey", "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusUnit"}, } } @@ -50114,7 +50070,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyConfig(ref common.Refe Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile"), + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecFile"), }, }, }, @@ -50136,7 +50092,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyConfig(ref common.Refe Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit"), + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecUnit"), }, }, }, @@ -50146,22 +50102,70 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyConfig(ref common.Refe SchemaProps: spec.SchemaProps{ Description: "sshkey maps to the ignition.sshkeys field in the MachineConfig object, definition an action for this will apply to all sshkey changes in the cluster", Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey"), + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecSSHKey"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecFile", "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecSSHKey", "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecUnit"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicySpecAction(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type represents the commands that will be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "reload": { + SchemaProps: spec.SchemaProps{ + Description: "reload specifies the service to reload, only valid if type is reload", + Ref: ref("github.com/openshift/api/operator/v1.ReloadService"), + }, + }, + "restart": { + SchemaProps: spec.SchemaProps{ + Description: "restart specifies the service to restart, only valid if type is restart", + Ref: ref("github.com/openshift/api/operator/v1.RestartService"), + }, + }, + }, + Required: []string{"type"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "type", + "fields-to-discriminateBy": map[string]interface{}{ + "reload": "Reload", + "restart": "Restart", + }, }, }, }, }, }, Dependencies: []string{ - "github.com/openshift/api/operator/v1.NodeDisruptionPolicyFile", "github.com/openshift/api/operator/v1.NodeDisruptionPolicySSHKey", "github.com/openshift/api/operator/v1.NodeDisruptionPolicyUnit"}, + "github.com/openshift/api/operator/v1.ReloadService", "github.com/openshift/api/operator/v1.RestartService"}, } } -func schema_openshift_api_operator_v1_NodeDisruptionPolicyFile(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_openshift_api_operator_v1_NodeDisruptionPolicySpecFile(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NodeDisruptionPolicyFile is a file entry and corresponding actions to take", + Description: "NodeDisruptionPolicySpecFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object", Type: []string{"object"}, Properties: map[string]spec.Schema{ "path": { @@ -50185,7 +50189,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyFile(ref common.Refere Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"), + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecAction"), }, }, }, @@ -50196,15 +50200,15 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyFile(ref common.Refere }, }, Dependencies: []string{ - "github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"}, + "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecAction"}, } } -func schema_openshift_api_operator_v1_NodeDisruptionPolicySSHKey(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_openshift_api_operator_v1_NodeDisruptionPolicySpecSSHKey(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NodeDisruptionPolicySSHKey is actions to take for any SSHKey change", + Description: "NodeDisruptionPolicySpecSSHKey is actions to take for any SSHKey change and is used in the NodeDisruptionPolicyConfig object", Type: []string{"object"}, Properties: map[string]spec.Schema{ "actions": { @@ -50220,7 +50224,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicySSHKey(ref common.Refe Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"), + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecAction"), }, }, }, @@ -50231,7 +50235,50 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicySSHKey(ref common.Refe }, }, Dependencies: []string{ - "github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"}, + "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecAction"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicySpecUnit(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeDisruptionPolicySpecUnit is a systemd unit name and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name represents the service name of a systemd service managed through a MachineConfig Actions specified will be applied for changes to the named service. Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "actions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecAction"), + }, + }, + }, + }, + }, + }, + Required: []string{"name", "actions"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicySpecAction"}, } } @@ -50256,11 +50303,137 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyStatus(ref common.Refe } } -func schema_openshift_api_operator_v1_NodeDisruptionPolicyUnit(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_openshift_api_operator_v1_NodeDisruptionPolicyStatusAction(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type represents the commands that will be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "reload": { + SchemaProps: spec.SchemaProps{ + Description: "reload specifies the service to reload, only valid if type is reload", + Ref: ref("github.com/openshift/api/operator/v1.ReloadService"), + }, + }, + "restart": { + SchemaProps: spec.SchemaProps{ + Description: "restart specifies the service to restart, only valid if type is restart", + Ref: ref("github.com/openshift/api/operator/v1.RestartService"), + }, + }, + }, + Required: []string{"type"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "type", + "fields-to-discriminateBy": map[string]interface{}{ + "reload": "Reload", + "restart": "Restart", + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.ReloadService", "github.com/openshift/api/operator/v1.RestartService"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicyStatusFile(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeDisruptionPolicyStatusFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Description: "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "actions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusAction"), + }, + }, + }, + }, + }, + }, + Required: []string{"path", "actions"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusAction"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicyStatusSSHKey(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeDisruptionPolicyStatusSSHKey is actions to take for any SSHKey change and is used in the NodeDisruptionPolicyClusterStatus object", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "actions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusAction"), + }, + }, + }, + }, + }, + }, + Required: []string{"actions"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusAction"}, + } +} + +func schema_openshift_api_operator_v1_NodeDisruptionPolicyStatusUnit(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NodeDisruptionPolicyUnit is a systemd unit name and corresponding actions to take", + Description: "NodeDisruptionPolicyStatusUnit is a systemd unit name and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object", Type: []string{"object"}, Properties: map[string]spec.Schema{ "name": { @@ -50284,7 +50457,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyUnit(ref common.Refere Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"), + Ref: ref("github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusAction"), }, }, }, @@ -50295,7 +50468,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyUnit(ref common.Refere }, }, Dependencies: []string{ - "github.com/openshift/api/operator/v1.NodeDisruptionPolicyAction"}, + "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatusAction"}, } } diff --git a/openapi/openapi.json b/openapi/openapi.json index c457f9516d9..1c7656357d3 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -29195,36 +29195,6 @@ } } }, - "com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "reload": { - "description": "reload specifies the service to reload, only valid if type is reload", - "$ref": "#/definitions/com.github.openshift.api.operator.v1.ReloadService" - }, - "restart": { - "description": "restart specifies the service to restart, only valid if type is restart", - "$ref": "#/definitions/com.github.openshift.api.operator.v1.RestartService" - }, - "type": { - "description": "type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", - "type": "string", - "default": "" - } - }, - "x-kubernetes-unions": [ - { - "discriminator": "type", - "fields-to-discriminateBy": { - "reload": "Reload", - "restart": "Restart" - } - } - ] - }, "com.github.openshift.api.operator.v1.NodeDisruptionPolicyClusterStatus": { "description": "NodeDisruptionPolicyClusterStatus is the type for the status object, rendered by the controller as a merge of cluster defaults and user provided policies", "type": "object", @@ -29234,7 +29204,7 @@ "type": "array", "items": { "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyFile" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusFile" }, "x-kubernetes-list-map-keys": [ "path" @@ -29244,14 +29214,14 @@ "sshkey": { "description": "sshkey is the overall sshkey MachineConfig definition", "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySSHKey" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusSSHKey" }, "units": { "description": "units is a list MachineConfig unit definitions and actions to take on changes to those services", "type": "array", "items": { "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyUnit" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusUnit" }, "x-kubernetes-list-map-keys": [ "name" @@ -29269,7 +29239,7 @@ "type": "array", "items": { "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyFile" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecFile" }, "x-kubernetes-list-map-keys": [ "path" @@ -29279,14 +29249,14 @@ "sshkey": { "description": "sshkey maps to the ignition.sshkeys field in the MachineConfig object, definition an action for this will apply to all sshkey changes in the cluster", "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySSHKey" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecSSHKey" }, "units": { "description": "units is a list MachineConfig unit definitions and actions to take on changes to those services This list supports a maximum of 50 entries.", "type": "array", "items": { "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyUnit" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecUnit" }, "x-kubernetes-list-map-keys": [ "name" @@ -29295,8 +29265,38 @@ } } }, - "com.github.openshift.api.operator.v1.NodeDisruptionPolicyFile": { - "description": "NodeDisruptionPolicyFile is a file entry and corresponding actions to take", + "com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecAction": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "reload": { + "description": "reload specifies the service to reload, only valid if type is reload", + "$ref": "#/definitions/com.github.openshift.api.operator.v1.ReloadService" + }, + "restart": { + "description": "restart specifies the service to restart, only valid if type is restart", + "$ref": "#/definitions/com.github.openshift.api.operator.v1.RestartService" + }, + "type": { + "description": "type represents the commands that will be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", + "type": "string", + "default": "" + } + }, + "x-kubernetes-unions": [ + { + "discriminator": "type", + "fields-to-discriminateBy": { + "reload": "Reload", + "restart": "Restart" + } + } + ] + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecFile": { + "description": "NodeDisruptionPolicySpecFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object", "type": "object", "required": [ "path", @@ -29308,7 +29308,7 @@ "type": "array", "items": { "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecAction" }, "x-kubernetes-list-type": "atomic" }, @@ -29319,8 +29319,8 @@ } } }, - "com.github.openshift.api.operator.v1.NodeDisruptionPolicySSHKey": { - "description": "NodeDisruptionPolicySSHKey is actions to take for any SSHKey change", + "com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecSSHKey": { + "description": "NodeDisruptionPolicySpecSSHKey is actions to take for any SSHKey change and is used in the NodeDisruptionPolicyConfig object", "type": "object", "required": [ "actions" @@ -29331,12 +29331,36 @@ "type": "array", "items": { "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecAction" }, "x-kubernetes-list-type": "atomic" } } }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecUnit": { + "description": "NodeDisruptionPolicySpecUnit is a systemd unit name and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object", + "type": "object", + "required": [ + "name", + "actions" + ], + "properties": { + "actions": { + "description": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecAction" + }, + "x-kubernetes-list-type": "atomic" + }, + "name": { + "description": "name represents the service name of a systemd service managed through a MachineConfig Actions specified will be applied for changes to the named service. Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatus": { "type": "object", "properties": { @@ -29347,8 +29371,80 @@ } } }, - "com.github.openshift.api.operator.v1.NodeDisruptionPolicyUnit": { - "description": "NodeDisruptionPolicyUnit is a systemd unit name and corresponding actions to take", + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusAction": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "reload": { + "description": "reload specifies the service to reload, only valid if type is reload", + "$ref": "#/definitions/com.github.openshift.api.operator.v1.ReloadService" + }, + "restart": { + "description": "restart specifies the service to restart, only valid if type is restart", + "$ref": "#/definitions/com.github.openshift.api.operator.v1.RestartService" + }, + "type": { + "description": "type represents the commands that will be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", + "type": "string", + "default": "" + } + }, + "x-kubernetes-unions": [ + { + "discriminator": "type", + "fields-to-discriminateBy": { + "reload": "Reload", + "restart": "Restart" + } + } + ] + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusFile": { + "description": "NodeDisruptionPolicyStatusFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object", + "type": "object", + "required": [ + "path", + "actions" + ], + "properties": { + "actions": { + "description": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusAction" + }, + "x-kubernetes-list-type": "atomic" + }, + "path": { + "description": "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusSSHKey": { + "description": "NodeDisruptionPolicyStatusSSHKey is actions to take for any SSHKey change and is used in the NodeDisruptionPolicyClusterStatus object", + "type": "object", + "required": [ + "actions" + ], + "properties": { + "actions": { + "description": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusAction" + }, + "x-kubernetes-list-type": "atomic" + } + } + }, + "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusUnit": { + "description": "NodeDisruptionPolicyStatusUnit is a systemd unit name and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object", "type": "object", "required": [ "name", @@ -29360,7 +29456,7 @@ "type": "array", "items": { "default": {}, - "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusAction" }, "x-kubernetes-list-type": "atomic" }, diff --git a/operator/v1/techpreview.machineconfiguration.testsuite.yaml b/operator/v1/techpreview.machineconfiguration.testsuite.yaml index 8ef865413de..c89d85f70ec 100644 --- a/operator/v1/techpreview.machineconfiguration.testsuite.yaml +++ b/operator/v1/techpreview.machineconfiguration.testsuite.yaml @@ -243,7 +243,7 @@ tests: - type: Reboot - type: DaemonReload expectedError: "Reboot action can only be specified standalone, as it will override any other actions" - - name: Node disruption policies that specify a service that has a valid name prefix + - name: Node disruption policies should use service name(s) which have a valid name prefix. initial: | apiVersion: operator.openshift.io/v1 kind: MachineConfiguration @@ -257,7 +257,21 @@ tests: reload: serviceName: .service expectedError: "Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" - - name: Node disruption policies that specify a service name that ends with a correct extension + - name: Node disruption policies should use service name(s) which have a valid name suffix. + initial: | + apiVersion: operator.openshift.io/v1 + kind: MachineConfiguration + spec: + nodeDisruptionPolicy: + files: + - path: "/etc/my-file" + actions: + - type: DaemonReload + - type: Reload + reload: + serviceName: service + expectedError: "Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." + - name: Node disruption policies should use service name(s) which have a valid name suffix. initial: | apiVersion: operator.openshift.io/v1 kind: MachineConfiguration diff --git a/operator/v1/types_machineconfiguration.go b/operator/v1/types_machineconfiguration.go index 8828ff771dc..47be7bd707e 100644 --- a/operator/v1/types_machineconfiguration.go +++ b/operator/v1/types_machineconfiguration.go @@ -194,18 +194,18 @@ type NodeDisruptionPolicyConfig struct { // +listType=map // +listMapKey=path // +kubebuilder:validation:MaxItems=50 - Files []NodeDisruptionPolicyFile `json:"files"` + Files []NodeDisruptionPolicySpecFile `json:"files"` // units is a list MachineConfig unit definitions and actions to take on changes to those services // This list supports a maximum of 50 entries. // +optional // +listType=map // +listMapKey=name // +kubebuilder:validation:MaxItems=50 - Units []NodeDisruptionPolicyUnit `json:"units"` + Units []NodeDisruptionPolicySpecUnit `json:"units"` // sshkey maps to the ignition.sshkeys field in the MachineConfig object, definition an action for this // will apply to all sshkey changes in the cluster // +optional - SSHKey NodeDisruptionPolicySSHKey `json:"sshkey"` + SSHKey NodeDisruptionPolicySpecSSHKey `json:"sshkey"` } // NodeDisruptionPolicyClusterStatus is the type for the status object, rendered by the controller as a @@ -216,20 +216,20 @@ type NodeDisruptionPolicyClusterStatus struct { // +listType=map // +listMapKey=path // +kubebuilder:validation:MaxItems=100 - Files []NodeDisruptionPolicyFile `json:"files,omitempty"` + Files []NodeDisruptionPolicyStatusFile `json:"files,omitempty"` // units is a list MachineConfig unit definitions and actions to take on changes to those services // +optional // +listType=map // +listMapKey=name // +kubebuilder:validation:MaxItems=100 - Units []NodeDisruptionPolicyUnit `json:"units,omitempty"` + Units []NodeDisruptionPolicyStatusUnit `json:"units,omitempty"` // sshkey is the overall sshkey MachineConfig definition // +optional - SSHKey NodeDisruptionPolicySSHKey `json:"sshkey,omitempty"` + SSHKey NodeDisruptionPolicyStatusSSHKey `json:"sshkey,omitempty"` } -// NodeDisruptionPolicyFile is a file entry and corresponding actions to take -type NodeDisruptionPolicyFile struct { +// NodeDisruptionPolicySpecFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object +type NodeDisruptionPolicySpecFile struct { // path is the location of the file being managed through a MachineConfig. // Actions specified will be applied when changes to the file at the path // configured in this field. @@ -247,18 +247,40 @@ type NodeDisruptionPolicyFile struct { // +kubebuilder:validation:MaxItems=10 // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='Reboot') ? size(self) == 1 : true", message="Reboot action can only be specified standalone, as it will override any other actions" // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='None') ? size(self) == 1 : true", message="None action can only be specified standalone, as it will override any other actions" - Actions []NodeDisruptionPolicyAction `json:"actions"` + Actions []NodeDisruptionPolicySpecAction `json:"actions"` } -// NodeDisruptionPolicyUnit is a systemd unit name and corresponding actions to take -type NodeDisruptionPolicyUnit struct { +// NodeDisruptionPolicyStatusFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object +type NodeDisruptionPolicyStatusFile struct { + // path is the location of the file being managed through a MachineConfig. + // Actions specified will be applied when changes to the file at the path + // configured in this field. + // +kubebuilder:validation:Required + Path string `json:"path"` + // actions represents the series of commands to be executed on changes to the file at + // the corresponding file path. Actions will be applied in the order that + // they are set in this list. If there are other incoming changes to other MachineConfig + // entries in the same update that require a reboot, the reboot will supercede these actions. + // Valid actions are Reboot, Drain, Reload, DaemonReload and None. + // The Reboot action and the None action cannot be used in conjunction with any of the other actions. + // This list supports a maximum of 10 entries. + // +kubebuilder:validation:Required + // +listType=atomic + // +kubebuilder:validation:MaxItems=10 + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='Reboot') ? size(self) == 1 : true", message="Reboot action can only be specified standalone, as it will override any other actions" + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='None') ? size(self) == 1 : true", message="None action can only be specified standalone, as it will override any other actions" + Actions []NodeDisruptionPolicyStatusAction `json:"actions"` +} + +// NodeDisruptionPolicySpecUnit is a systemd unit name and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object +type NodeDisruptionPolicySpecUnit struct { // name represents the service name of a systemd service managed through a MachineConfig // Actions specified will be applied for changes to the named service. // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". - // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." + // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:Required // +kubebuilder:validation:MaxLength=255 Name string `json:"name"` @@ -275,11 +297,39 @@ type NodeDisruptionPolicyUnit struct { // +kubebuilder:validation:MaxItems=10 // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='Reboot') ? size(self) == 1 : true", message="Reboot action can only be specified standalone, as it will override any other actions" // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='None') ? size(self) == 1 : true", message="None action can only be specified standalone, as it will override any other actions" - Actions []NodeDisruptionPolicyAction `json:"actions"` + Actions []NodeDisruptionPolicySpecAction `json:"actions"` } -// NodeDisruptionPolicySSHKey is actions to take for any SSHKey change -type NodeDisruptionPolicySSHKey struct { +// NodeDisruptionPolicyStatusUnit is a systemd unit name and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object +type NodeDisruptionPolicyStatusUnit struct { + // name represents the service name of a systemd service managed through a MachineConfig + // Actions specified will be applied for changes to the named service. + // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. + // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". + // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". + // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." + // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" + // +kubebuilder:validation:Required + // +kubebuilder:validation:MaxLength=255 + Name string `json:"name"` + + // actions represents the series of commands to be executed on changes to the file at + // the corresponding file path. Actions will be applied in the order that + // they are set in this list. If there are other incoming changes to other MachineConfig + // entries in the same update that require a reboot, the reboot will supercede these actions. + // Valid actions are Reboot, Drain, Reload, DaemonReload and None. + // The Reboot action and the None action cannot be used in conjunction with any of the other actions. + // This list supports a maximum of 10 entries. + // +kubebuilder:validation:Required + // +listType=atomic + // +kubebuilder:validation:MaxItems=10 + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='Reboot') ? size(self) == 1 : true", message="Reboot action can only be specified standalone, as it will override any other actions" + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='None') ? size(self) == 1 : true", message="None action can only be specified standalone, as it will override any other actions" + Actions []NodeDisruptionPolicyStatusAction `json:"actions"` +} + +// NodeDisruptionPolicySpecSSHKey is actions to take for any SSHKey change and is used in the NodeDisruptionPolicyConfig object +type NodeDisruptionPolicySpecSSHKey struct { // actions represents the series of commands to be executed on changes to the file at // the corresponding file path. Actions will be applied in the order that // they are set in this list. If there are other incoming changes to other MachineConfig @@ -292,20 +342,56 @@ type NodeDisruptionPolicySSHKey struct { // +kubebuilder:validation:MaxItems=10 // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='Reboot') ? size(self) == 1 : true", message="Reboot action can only be specified standalone, as it will override any other actions" // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='None') ? size(self) == 1 : true", message="None action can only be specified standalone, as it will override any other actions" - Actions []NodeDisruptionPolicyAction `json:"actions"` + Actions []NodeDisruptionPolicySpecAction `json:"actions"` +} + +// NodeDisruptionPolicyStatusSSHKey is actions to take for any SSHKey change and is used in the NodeDisruptionPolicyClusterStatus object +type NodeDisruptionPolicyStatusSSHKey struct { + // actions represents the series of commands to be executed on changes to the file at + // the corresponding file path. Actions will be applied in the order that + // they are set in this list. If there are other incoming changes to other MachineConfig + // entries in the same update that require a reboot, the reboot will supercede these actions. + // Valid actions are Reboot, Drain, Reload, DaemonReload and None. + // The Reboot action and the None action cannot be used in conjunction with any of the other actions. + // This list supports a maximum of 10 entries. + // +kubebuilder:validation:Required + // +listType=atomic + // +kubebuilder:validation:MaxItems=10 + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='Reboot') ? size(self) == 1 : true", message="Reboot action can only be specified standalone, as it will override any other actions" + // +kubebuilder:validation:XValidation:rule="self.exists(x, x.type=='None') ? size(self) == 1 : true", message="None action can only be specified standalone, as it will override any other actions" + Actions []NodeDisruptionPolicyStatusAction `json:"actions"` +} + +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Reload' ? has(self.reload) : !has(self.reload)",message="Reload is required when type is reload, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Restart' ? has(self.restart) : !has(self.restart)",message="Restart is required when type is restart, and forbidden otherwise" +// +union +type NodeDisruptionPolicySpecAction struct { + // type represents the commands that will be carried out if this NodeDisruptionPolicySpecActionType is executed + // Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special + // reload/restart requires a corresponding service target specified in the reload/restart field. + // Other values require no further configuration + // +unionDiscriminator + // +kubebuilder:validation:Required + Type NodeDisruptionPolicySpecActionType `json:"type"` + // reload specifies the service to reload, only valid if type is reload + // +optional + Reload *ReloadService `json:"reload,omitempty"` + // restart specifies the service to restart, only valid if type is restart + // +optional + Restart *RestartService `json:"restart,omitempty"` } // +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Reload' ? has(self.reload) : !has(self.reload)",message="Reload is required when type is reload, and forbidden otherwise" // +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Restart' ? has(self.restart) : !has(self.restart)",message="Restart is required when type is restart, and forbidden otherwise" // +union -type NodeDisruptionPolicyAction struct { - // type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed +type NodeDisruptionPolicyStatusAction struct { + // type represents the commands that will be carried out if this NodeDisruptionPolicyStatusActionType is executed // Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special // reload/restart requires a corresponding service target specified in the reload/restart field. // Other values require no further configuration // +unionDiscriminator // +kubebuilder:validation:Required - Type NodeDisruptionPolicyActionType `json:"type"` + Type NodeDisruptionPolicyStatusActionType `json:"type"` // reload specifies the service to reload, only valid if type is reload // +optional Reload *ReloadService `json:"reload,omitempty"` @@ -320,8 +406,8 @@ type ReloadService struct { // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". - // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." + // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:Required // +kubebuilder:validation:MaxLength=255 ServiceName string `json:"serviceName"` @@ -333,37 +419,64 @@ type RestartService struct { // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". - // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." + // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:Required // +kubebuilder:validation:MaxLength=255 ServiceName string `json:"serviceName"` } -// NodeDisruptionPolicyActionType is a string enum used in a NodeDisruptionPolicyAction object. They describe an action to be performed. +// NodeDisruptionPolicySpecActionType is a string enum used in a NodeDisruptionPolicySpecAction object. They describe an action to be performed. +// +kubebuilder:validation:Enum:="Reboot";"Drain";"Reload";"Restart";"DaemonReload";"None" +type NodeDisruptionPolicySpecActionType string + +const ( + // Reboot represents an action that will cause nodes to be rebooted. This is the default action by the MCO + // if a reboot policy is not found for a change/update being performed by the MCO. + RebootSpecAction NodeDisruptionPolicySpecActionType = "Reboot" + + // Drain represents an action that will cause nodes to be drained of their workloads. + DrainSpecAction NodeDisruptionPolicySpecActionType = "Drain" + + // Reload represents an action that will cause nodes to reload the service described by the Target field. + ReloadSpecAction NodeDisruptionPolicySpecActionType = "Reload" + + // Restart represents an action that will cause nodes to restart the service described by the Target field. + RestartSpecAction NodeDisruptionPolicySpecActionType = "Restart" + + // DaemonReload represents an action that TBD + DaemonReloadSpecAction NodeDisruptionPolicySpecActionType = "DaemonReload" + + // None represents an action that no handling is required by the MCO. + NoneSpecAction NodeDisruptionPolicySpecActionType = "None" +) + +// NodeDisruptionPolicyStatusActionType is a string enum used in a NodeDisruptionPolicyStatusAction object. They describe an action to be performed. +// The key difference of this object from NodeDisruptionPolicySpecActionType is that there is a additional SpecialStatusAction value in this enum. This will only be +// used by the MCO's controller to indicate some internal actions. They are not part of the NodeDisruptionPolicyConfig object and cannot be set by the user. // +kubebuilder:validation:Enum:="Reboot";"Drain";"Reload";"Restart";"DaemonReload";"None";"Special" -type NodeDisruptionPolicyActionType string +type NodeDisruptionPolicyStatusActionType string const ( // Reboot represents an action that will cause nodes to be rebooted. This is the default action by the MCO // if a reboot policy is not found for a change/update being performed by the MCO. - Reboot NodeDisruptionPolicyActionType = "Reboot" + RebootStatusAction NodeDisruptionPolicyStatusActionType = "Reboot" // Drain represents an action that will cause nodes to be drained of their workloads. - Drain NodeDisruptionPolicyActionType = "Drain" + DrainStatusAction NodeDisruptionPolicyStatusActionType = "Drain" // Reload represents an action that will cause nodes to reload the service described by the Target field. - Reload NodeDisruptionPolicyActionType = "Reload" + ReloadStatusAction NodeDisruptionPolicyStatusActionType = "Reload" // Restart represents an action that will cause nodes to restart the service described by the Target field. - Restart NodeDisruptionPolicyActionType = "Restart" + RestartStatusAction NodeDisruptionPolicyStatusActionType = "Restart" // DaemonReload represents an action that TBD - DaemonReload NodeDisruptionPolicyActionType = "DaemonReload" + DaemonReloadStatusAction NodeDisruptionPolicyStatusActionType = "DaemonReload" // None represents an action that no handling is required by the MCO. - None NodeDisruptionPolicyActionType = "None" + NoneStatusAction NodeDisruptionPolicyStatusActionType = "None" // Special represents an action that is internal to the MCO, and is not allowed in user defined NodeDisruption policies. - Special NodeDisruptionPolicyActionType = "Special" + SpecialStatusAction NodeDisruptionPolicyStatusActionType = "Special" ) diff --git a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml index 4584c007c38..56f908bce9f 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml @@ -221,8 +221,9 @@ spec: and actions to take to changes on those paths This list supports a maximum of 50 entries. items: - description: NodeDisruptionPolicyFile is a file entry and corresponding - actions to take + description: NodeDisruptionPolicySpecFile is a file entry and + corresponding actions to take and is used in the NodeDisruptionPolicyConfig + object properties: actions: description: actions represents the series of commands to @@ -255,12 +256,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -268,6 +263,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -289,12 +290,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -302,12 +297,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -320,7 +321,6 @@ spec: - Restart - DaemonReload - None - - Special type: string required: - type @@ -397,12 +397,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", @@ -410,6 +404,12 @@ spec: ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -431,12 +431,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", @@ -444,12 +438,18 @@ spec: ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -462,7 +462,6 @@ spec: - Restart - DaemonReload - None - - Special type: string required: - type @@ -496,8 +495,9 @@ spec: actions to take on changes to those services This list supports a maximum of 50 entries. items: - description: NodeDisruptionPolicyUnit is a systemd unit name - and corresponding actions to take + description: NodeDisruptionPolicySpecUnit is a systemd unit + name and corresponding actions to take and is used in the + NodeDisruptionPolicyConfig object properties: actions: description: actions represents the series of commands to @@ -530,12 +530,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -543,6 +537,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -564,12 +564,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -577,12 +571,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -595,7 +595,6 @@ spec: - Restart - DaemonReload - None - - Special type: string required: - type @@ -635,17 +634,17 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected format - is ${NAME}${SERVICETYPE}, where {NAME} must be atleast - 1 character long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected format + is ${NAME}${SERVICETYPE}, where {NAME} must be atleast + 1 character long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - actions - name @@ -784,8 +783,9 @@ spec: description: files is a list of MachineConfig file definitions and actions to take to changes on those paths items: - description: NodeDisruptionPolicyFile is a file entry and - corresponding actions to take + description: NodeDisruptionPolicyStatusFile is a file entry + and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus + object properties: actions: description: actions represents the series of commands @@ -820,12 +820,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -833,6 +827,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -855,12 +855,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -868,12 +862,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that - will be carried out if this NodeDisruptionPolicyActionType + will be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -961,12 +961,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -974,6 +968,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -995,12 +995,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -1008,12 +1002,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -1059,8 +1059,9 @@ spec: description: units is a list MachineConfig unit definitions and actions to take on changes to those services items: - description: NodeDisruptionPolicyUnit is a systemd unit - name and corresponding actions to take + description: NodeDisruptionPolicyStatusUnit is a systemd + unit name and corresponding actions to take and is used + in the NodeDisruptionPolicyClusterStatus object properties: actions: description: actions represents the series of commands @@ -1095,12 +1096,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -1108,6 +1103,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -1130,12 +1131,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -1143,12 +1138,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that - will be carried out if this NodeDisruptionPolicyActionType + will be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -1201,17 +1202,17 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} must - be atleast 1 character long and can only consist - of alphabets, digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - actions - name diff --git a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml index 1b276f5a1ad..aefb72d1c0a 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml @@ -221,8 +221,9 @@ spec: and actions to take to changes on those paths This list supports a maximum of 50 entries. items: - description: NodeDisruptionPolicyFile is a file entry and corresponding - actions to take + description: NodeDisruptionPolicySpecFile is a file entry and + corresponding actions to take and is used in the NodeDisruptionPolicyConfig + object properties: actions: description: actions represents the series of commands to @@ -255,12 +256,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -268,6 +263,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -289,12 +290,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -302,12 +297,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -320,7 +321,6 @@ spec: - Restart - DaemonReload - None - - Special type: string required: - type @@ -397,12 +397,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", @@ -410,6 +404,12 @@ spec: ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -431,12 +431,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", @@ -444,12 +438,18 @@ spec: ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -462,7 +462,6 @@ spec: - Restart - DaemonReload - None - - Special type: string required: - type @@ -496,8 +495,9 @@ spec: actions to take on changes to those services This list supports a maximum of 50 entries. items: - description: NodeDisruptionPolicyUnit is a systemd unit name - and corresponding actions to take + description: NodeDisruptionPolicySpecUnit is a systemd unit + name and corresponding actions to take and is used in the + NodeDisruptionPolicyConfig object properties: actions: description: actions represents the series of commands to @@ -530,12 +530,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -543,6 +537,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -564,12 +564,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -577,12 +571,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -595,7 +595,6 @@ spec: - Restart - DaemonReload - None - - Special type: string required: - type @@ -635,17 +634,17 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected format - is ${NAME}${SERVICETYPE}, where {NAME} must be atleast - 1 character long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected format + is ${NAME}${SERVICETYPE}, where {NAME} must be atleast + 1 character long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - actions - name @@ -784,8 +783,9 @@ spec: description: files is a list of MachineConfig file definitions and actions to take to changes on those paths items: - description: NodeDisruptionPolicyFile is a file entry and - corresponding actions to take + description: NodeDisruptionPolicyStatusFile is a file entry + and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus + object properties: actions: description: actions represents the series of commands @@ -820,12 +820,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -833,6 +827,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -855,12 +855,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -868,12 +862,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that - will be carried out if this NodeDisruptionPolicyActionType + will be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -961,12 +961,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -974,6 +968,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -995,12 +995,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -1008,12 +1002,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -1059,8 +1059,9 @@ spec: description: units is a list MachineConfig unit definitions and actions to take on changes to those services items: - description: NodeDisruptionPolicyUnit is a systemd unit - name and corresponding actions to take + description: NodeDisruptionPolicyStatusUnit is a systemd + unit name and corresponding actions to take and is used + in the NodeDisruptionPolicyClusterStatus object properties: actions: description: actions represents the series of commands @@ -1095,12 +1096,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -1108,6 +1103,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -1130,12 +1131,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -1143,12 +1138,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that - will be carried out if this NodeDisruptionPolicyActionType + will be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -1201,17 +1202,17 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} must - be atleast 1 character long and can only consist - of alphabets, digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - actions - name diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 83e9ea8d180..33366b07c99 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -3279,45 +3279,19 @@ func (in *NetworkStatus) DeepCopy() *NetworkStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeDisruptionPolicyAction) DeepCopyInto(out *NodeDisruptionPolicyAction) { - *out = *in - if in.Reload != nil { - in, out := &in.Reload, &out.Reload - *out = new(ReloadService) - **out = **in - } - if in.Restart != nil { - in, out := &in.Restart, &out.Restart - *out = new(RestartService) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyAction. -func (in *NodeDisruptionPolicyAction) DeepCopy() *NodeDisruptionPolicyAction { - if in == nil { - return nil - } - out := new(NodeDisruptionPolicyAction) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeDisruptionPolicyClusterStatus) DeepCopyInto(out *NodeDisruptionPolicyClusterStatus) { *out = *in if in.Files != nil { in, out := &in.Files, &out.Files - *out = make([]NodeDisruptionPolicyFile, len(*in)) + *out = make([]NodeDisruptionPolicyStatusFile, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Units != nil { in, out := &in.Units, &out.Units - *out = make([]NodeDisruptionPolicyUnit, len(*in)) + *out = make([]NodeDisruptionPolicyStatusUnit, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -3341,14 +3315,14 @@ func (in *NodeDisruptionPolicyConfig) DeepCopyInto(out *NodeDisruptionPolicyConf *out = *in if in.Files != nil { in, out := &in.Files, &out.Files - *out = make([]NodeDisruptionPolicyFile, len(*in)) + *out = make([]NodeDisruptionPolicySpecFile, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Units != nil { in, out := &in.Units, &out.Units - *out = make([]NodeDisruptionPolicyUnit, len(*in)) + *out = make([]NodeDisruptionPolicySpecUnit, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -3368,11 +3342,60 @@ func (in *NodeDisruptionPolicyConfig) DeepCopy() *NodeDisruptionPolicyConfig { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeDisruptionPolicyFile) DeepCopyInto(out *NodeDisruptionPolicyFile) { +func (in *NodeDisruptionPolicySpecAction) DeepCopyInto(out *NodeDisruptionPolicySpecAction) { + *out = *in + if in.Reload != nil { + in, out := &in.Reload, &out.Reload + *out = new(ReloadService) + **out = **in + } + if in.Restart != nil { + in, out := &in.Restart, &out.Restart + *out = new(RestartService) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicySpecAction. +func (in *NodeDisruptionPolicySpecAction) DeepCopy() *NodeDisruptionPolicySpecAction { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicySpecAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicySpecFile) DeepCopyInto(out *NodeDisruptionPolicySpecFile) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make([]NodeDisruptionPolicySpecAction, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicySpecFile. +func (in *NodeDisruptionPolicySpecFile) DeepCopy() *NodeDisruptionPolicySpecFile { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicySpecFile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicySpecSSHKey) DeepCopyInto(out *NodeDisruptionPolicySpecSSHKey) { *out = *in if in.Actions != nil { in, out := &in.Actions, &out.Actions - *out = make([]NodeDisruptionPolicyAction, len(*in)) + *out = make([]NodeDisruptionPolicySpecAction, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -3380,22 +3403,22 @@ func (in *NodeDisruptionPolicyFile) DeepCopyInto(out *NodeDisruptionPolicyFile) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyFile. -func (in *NodeDisruptionPolicyFile) DeepCopy() *NodeDisruptionPolicyFile { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicySpecSSHKey. +func (in *NodeDisruptionPolicySpecSSHKey) DeepCopy() *NodeDisruptionPolicySpecSSHKey { if in == nil { return nil } - out := new(NodeDisruptionPolicyFile) + out := new(NodeDisruptionPolicySpecSSHKey) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeDisruptionPolicySSHKey) DeepCopyInto(out *NodeDisruptionPolicySSHKey) { +func (in *NodeDisruptionPolicySpecUnit) DeepCopyInto(out *NodeDisruptionPolicySpecUnit) { *out = *in if in.Actions != nil { in, out := &in.Actions, &out.Actions - *out = make([]NodeDisruptionPolicyAction, len(*in)) + *out = make([]NodeDisruptionPolicySpecAction, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -3403,12 +3426,12 @@ func (in *NodeDisruptionPolicySSHKey) DeepCopyInto(out *NodeDisruptionPolicySSHK return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicySSHKey. -func (in *NodeDisruptionPolicySSHKey) DeepCopy() *NodeDisruptionPolicySSHKey { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicySpecUnit. +func (in *NodeDisruptionPolicySpecUnit) DeepCopy() *NodeDisruptionPolicySpecUnit { if in == nil { return nil } - out := new(NodeDisruptionPolicySSHKey) + out := new(NodeDisruptionPolicySpecUnit) in.DeepCopyInto(out) return out } @@ -3431,11 +3454,83 @@ func (in *NodeDisruptionPolicyStatus) DeepCopy() *NodeDisruptionPolicyStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeDisruptionPolicyUnit) DeepCopyInto(out *NodeDisruptionPolicyUnit) { +func (in *NodeDisruptionPolicyStatusAction) DeepCopyInto(out *NodeDisruptionPolicyStatusAction) { + *out = *in + if in.Reload != nil { + in, out := &in.Reload, &out.Reload + *out = new(ReloadService) + **out = **in + } + if in.Restart != nil { + in, out := &in.Restart, &out.Restart + *out = new(RestartService) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyStatusAction. +func (in *NodeDisruptionPolicyStatusAction) DeepCopy() *NodeDisruptionPolicyStatusAction { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicyStatusAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicyStatusFile) DeepCopyInto(out *NodeDisruptionPolicyStatusFile) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make([]NodeDisruptionPolicyStatusAction, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyStatusFile. +func (in *NodeDisruptionPolicyStatusFile) DeepCopy() *NodeDisruptionPolicyStatusFile { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicyStatusFile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicyStatusSSHKey) DeepCopyInto(out *NodeDisruptionPolicyStatusSSHKey) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make([]NodeDisruptionPolicyStatusAction, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyStatusSSHKey. +func (in *NodeDisruptionPolicyStatusSSHKey) DeepCopy() *NodeDisruptionPolicyStatusSSHKey { + if in == nil { + return nil + } + out := new(NodeDisruptionPolicyStatusSSHKey) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDisruptionPolicyStatusUnit) DeepCopyInto(out *NodeDisruptionPolicyStatusUnit) { *out = *in if in.Actions != nil { in, out := &in.Actions, &out.Actions - *out = make([]NodeDisruptionPolicyAction, len(*in)) + *out = make([]NodeDisruptionPolicyStatusAction, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -3443,12 +3538,12 @@ func (in *NodeDisruptionPolicyUnit) DeepCopyInto(out *NodeDisruptionPolicyUnit) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyUnit. -func (in *NodeDisruptionPolicyUnit) DeepCopy() *NodeDisruptionPolicyUnit { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisruptionPolicyStatusUnit. +func (in *NodeDisruptionPolicyStatusUnit) DeepCopy() *NodeDisruptionPolicyStatusUnit { if in == nil { return nil } - out := new(NodeDisruptionPolicyUnit) + out := new(NodeDisruptionPolicyStatusUnit) in.DeepCopyInto(out) return out } diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml index c0fe076eedd..ac2f90aa7ef 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml @@ -86,8 +86,9 @@ spec: and actions to take to changes on those paths This list supports a maximum of 50 entries. items: - description: NodeDisruptionPolicyFile is a file entry and corresponding - actions to take + description: NodeDisruptionPolicySpecFile is a file entry and + corresponding actions to take and is used in the NodeDisruptionPolicyConfig + object properties: actions: description: actions represents the series of commands to @@ -120,12 +121,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -133,6 +128,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -154,12 +155,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -167,12 +162,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -185,7 +186,6 @@ spec: - Restart - DaemonReload - None - - Special type: string required: - type @@ -262,12 +262,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", @@ -275,6 +269,12 @@ spec: ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -296,12 +296,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", @@ -309,12 +303,18 @@ spec: ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -327,7 +327,6 @@ spec: - Restart - DaemonReload - None - - Special type: string required: - type @@ -361,8 +360,9 @@ spec: actions to take on changes to those services This list supports a maximum of 50 entries. items: - description: NodeDisruptionPolicyUnit is a systemd unit name - and corresponding actions to take + description: NodeDisruptionPolicySpecUnit is a systemd unit + name and corresponding actions to take and is used in the + NodeDisruptionPolicyConfig object properties: actions: description: actions represents the series of commands to @@ -395,12 +395,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -408,6 +402,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -429,12 +429,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} - must be atleast 1 character long and can only - consist of alphabets, digits, ":", "-", "_", - ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -442,12 +436,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} + must be atleast 1 character long and can only + consist of alphabets, digits, ":", "-", "_", + ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -460,7 +460,6 @@ spec: - Restart - DaemonReload - None - - Special type: string required: - type @@ -500,17 +499,17 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected format - is ${NAME}${SERVICETYPE}, where {NAME} must be atleast - 1 character long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected format + is ${NAME}${SERVICETYPE}, where {NAME} must be atleast + 1 character long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - actions - name @@ -649,8 +648,9 @@ spec: description: files is a list of MachineConfig file definitions and actions to take to changes on those paths items: - description: NodeDisruptionPolicyFile is a file entry and - corresponding actions to take + description: NodeDisruptionPolicyStatusFile is a file entry + and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus + object properties: actions: description: actions represents the series of commands @@ -685,12 +685,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -698,6 +692,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -720,12 +720,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -733,12 +727,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that - will be carried out if this NodeDisruptionPolicyActionType + will be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -826,12 +826,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -839,6 +833,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -860,12 +860,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -873,12 +867,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that will - be carried out if this NodeDisruptionPolicyActionType + be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -924,8 +924,9 @@ spec: description: units is a list MachineConfig unit definitions and actions to take on changes to those services items: - description: NodeDisruptionPolicyUnit is a systemd unit - name and corresponding actions to take + description: NodeDisruptionPolicyStatusUnit is a systemd + unit name and corresponding actions to take and is used + in the NodeDisruptionPolicyClusterStatus object properties: actions: description: actions represents the series of commands @@ -960,12 +961,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -973,6 +968,12 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object @@ -995,12 +996,6 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. - Expected format is ${NAME}${SERVICETYPE}, - where {NAME} must be atleast 1 character - long and can only consist of alphabets, - digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", @@ -1008,12 +1003,18 @@ spec: ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. + Expected format is ${NAME}${SERVICETYPE}, + where {NAME} must be atleast 1 character + long and can only consist of alphabets, + digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - serviceName type: object type: description: type represents the commands that - will be carried out if this NodeDisruptionPolicyActionType + will be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified @@ -1066,17 +1067,17 @@ spec: maxLength: 255 type: string x-kubernetes-validations: - - message: Invalid ${NAME} in service name. Expected - format is ${NAME}${SERVICETYPE}, where {NAME} must - be atleast 1 character long and can only consist - of alphabets, digits, ":", "-", "_", ".", and "\" - rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..*$') - message: Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer",".snapshot", ".slice" or ".scope". rule: self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$') + - message: Invalid ${NAME} in service name. Expected + format is ${NAME}${SERVICETYPE}, where {NAME} must + be atleast 1 character long and can only consist + of alphabets, digits, ":", "-", "_", ".", and "\" + rule: self.matches('^[a-zA-Z0-9:._\\\\-]+\\..') required: - actions - name diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index ad3d7ff3790..fbb6c444823 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -1321,16 +1321,6 @@ func (ManagedBootImages) SwaggerDoc() map[string]string { return map_ManagedBootImages } -var map_NodeDisruptionPolicyAction = map[string]string{ - "type": "type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", - "reload": "reload specifies the service to reload, only valid if type is reload", - "restart": "restart specifies the service to restart, only valid if type is restart", -} - -func (NodeDisruptionPolicyAction) SwaggerDoc() map[string]string { - return map_NodeDisruptionPolicyAction -} - var map_NodeDisruptionPolicyClusterStatus = map[string]string{ "": "NodeDisruptionPolicyClusterStatus is the type for the status object, rendered by the controller as a merge of cluster defaults and user provided policies", "files": "files is a list of MachineConfig file definitions and actions to take to changes on those paths", @@ -1353,23 +1343,43 @@ func (NodeDisruptionPolicyConfig) SwaggerDoc() map[string]string { return map_NodeDisruptionPolicyConfig } -var map_NodeDisruptionPolicyFile = map[string]string{ - "": "NodeDisruptionPolicyFile is a file entry and corresponding actions to take", +var map_NodeDisruptionPolicySpecAction = map[string]string{ + "type": "type represents the commands that will be carried out if this NodeDisruptionPolicySpecActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", + "reload": "reload specifies the service to reload, only valid if type is reload", + "restart": "restart specifies the service to restart, only valid if type is restart", +} + +func (NodeDisruptionPolicySpecAction) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicySpecAction +} + +var map_NodeDisruptionPolicySpecFile = map[string]string{ + "": "NodeDisruptionPolicySpecFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object", "path": "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", } -func (NodeDisruptionPolicyFile) SwaggerDoc() map[string]string { - return map_NodeDisruptionPolicyFile +func (NodeDisruptionPolicySpecFile) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicySpecFile } -var map_NodeDisruptionPolicySSHKey = map[string]string{ - "": "NodeDisruptionPolicySSHKey is actions to take for any SSHKey change", +var map_NodeDisruptionPolicySpecSSHKey = map[string]string{ + "": "NodeDisruptionPolicySpecSSHKey is actions to take for any SSHKey change and is used in the NodeDisruptionPolicyConfig object", + "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", +} + +func (NodeDisruptionPolicySpecSSHKey) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicySpecSSHKey +} + +var map_NodeDisruptionPolicySpecUnit = map[string]string{ + "": "NodeDisruptionPolicySpecUnit is a systemd unit name and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object", + "name": "name represents the service name of a systemd service managed through a MachineConfig Actions specified will be applied for changes to the named service. Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", } -func (NodeDisruptionPolicySSHKey) SwaggerDoc() map[string]string { - return map_NodeDisruptionPolicySSHKey +func (NodeDisruptionPolicySpecUnit) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicySpecUnit } var map_NodeDisruptionPolicyStatus = map[string]string{ @@ -1380,14 +1390,43 @@ func (NodeDisruptionPolicyStatus) SwaggerDoc() map[string]string { return map_NodeDisruptionPolicyStatus } -var map_NodeDisruptionPolicyUnit = map[string]string{ - "": "NodeDisruptionPolicyUnit is a systemd unit name and corresponding actions to take", +var map_NodeDisruptionPolicyStatusAction = map[string]string{ + "type": "type represents the commands that will be carried out if this NodeDisruptionPolicyStatusActionType is executed Valid value are Reboot, Drain, Reload, Restart, DaemonReload, None and Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration", + "reload": "reload specifies the service to reload, only valid if type is reload", + "restart": "restart specifies the service to restart, only valid if type is restart", +} + +func (NodeDisruptionPolicyStatusAction) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyStatusAction +} + +var map_NodeDisruptionPolicyStatusFile = map[string]string{ + "": "NodeDisruptionPolicyStatusFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object", + "path": "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", +} + +func (NodeDisruptionPolicyStatusFile) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyStatusFile +} + +var map_NodeDisruptionPolicyStatusSSHKey = map[string]string{ + "": "NodeDisruptionPolicyStatusSSHKey is actions to take for any SSHKey change and is used in the NodeDisruptionPolicyClusterStatus object", + "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", +} + +func (NodeDisruptionPolicyStatusSSHKey) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyStatusSSHKey +} + +var map_NodeDisruptionPolicyStatusUnit = map[string]string{ + "": "NodeDisruptionPolicyStatusUnit is a systemd unit name and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object", "name": "name represents the service name of a systemd service managed through a MachineConfig Actions specified will be applied for changes to the named service. Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\". ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\", \".snapshot\", \".slice\" or \".scope\".", "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", } -func (NodeDisruptionPolicyUnit) SwaggerDoc() map[string]string { - return map_NodeDisruptionPolicyUnit +func (NodeDisruptionPolicyStatusUnit) SwaggerDoc() map[string]string { + return map_NodeDisruptionPolicyStatusUnit } var map_PartialSelector = map[string]string{ From 4bdf2e3c21727437bbdc18b9bf227144a3547423 Mon Sep 17 00:00:00 2001 From: Yu Qi Zhang Date: Thu, 21 Mar 2024 14:03:29 -0400 Subject: [PATCH 3/3] NodeDisruptionPolicy cleanups - don't remove staticpodoperatorstatus for now - update godocs to be more clear - add a type alias for serviceName --- features.md | 1 + .../generated_openapi/zz_generated.openapi.go | 89 +++++++- openapi/openapi.json | 53 ++++- ...review.machineconfiguration.testsuite.yaml | 4 +- operator/v1/types_machineconfiguration.go | 55 ++--- ...ineconfigurations-CustomNoUpgrade.crd.yaml | 195 +++++++++++------- ..._01_machineconfigurations-Default.crd.yaml | 157 +++++++++----- ...nfigurations-TechPreviewNoUpgrade.crd.yaml | 195 +++++++++++------- operator/v1/zz_generated.deepcopy.go | 8 +- .../AAA_ungated.yaml | 157 +++++++++----- .../ManagedBootImages.yaml | 157 +++++++++----- .../NodeDisruptionPolicy.yaml | 195 +++++++++++------- .../v1/zz_generated.swagger_doc_generated.go | 6 +- 13 files changed, 847 insertions(+), 425 deletions(-) diff --git a/features.md b/features.md index 006c93d3e17..3f99a8a6eff 100644 --- a/features.md +++ b/features.md @@ -24,6 +24,7 @@ | MetricsServer| | | | Enabled | Enabled | Enabled | | MixedCPUsAllocation| | | | Enabled | Enabled | Enabled | | NewOLM| | | | Enabled | Enabled | Enabled | +| NodeDisruptionPolicy| | | | Enabled | Enabled | Enabled | | NodeSwap| | | | Enabled | Enabled | Enabled | | OnClusterBuild| | | | Enabled | Enabled | Enabled | | PinnedImages| | | | Enabled | Enabled | Enabled | diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index d0608aa6652..29baf4c29e9 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -49245,15 +49245,20 @@ func schema_openshift_api_operator_v1_MachineConfigurationStatus(ref common.Refe SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the last generation change you've dealt with", + Type: []string{"integer"}, + Format: "int64", + }, + }, "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-map-keys": []interface{}{ "type", }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", + "x-kubernetes-list-type": "map", }, }, SchemaProps: spec.SchemaProps{ @@ -49263,17 +49268,80 @@ func schema_openshift_api_operator_v1_MachineConfigurationStatus(ref common.Refe Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + Ref: ref("github.com/openshift/api/operator/v1.OperatorCondition"), }, }, }, }, }, - "observedGeneration": { + "version": { SchemaProps: spec.SchemaProps{ - Description: "observedGeneration is the last generation change you've dealt with", + Description: "version is the level this availability applies to", + Type: []string{"string"}, + Format: "", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas indicates how many replicas are ready and at the desired state", + Default: 0, Type: []string{"integer"}, - Format: "int64", + Format: "int32", + }, + }, + "generations": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.GenerationStatus"), + }, + }, + }, + }, + }, + "latestAvailableRevision": { + SchemaProps: spec.SchemaProps{ + Description: "latestAvailableRevision is the deploymentID of the most recent deployment", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "latestAvailableRevisionReason": { + SchemaProps: spec.SchemaProps{ + Description: "latestAvailableRevisionReason describe the detailed reason for the most recent deployment", + Type: []string{"string"}, + Format: "", + }, + }, + "nodeStatuses": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "nodeName", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "nodeStatuses track the deployment values and errors across individual nodes", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1.NodeStatus"), + }, + }, + }, }, }, "nodeDisruptionPolicyStatus": { @@ -49284,10 +49352,11 @@ func schema_openshift_api_operator_v1_MachineConfigurationStatus(ref common.Refe }, }, }, + Required: []string{"readyReplicas"}, }, }, Dependencies: []string{ - "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, + "github.com/openshift/api/operator/v1.GenerationStatus", "github.com/openshift/api/operator/v1.NodeDisruptionPolicyStatus", "github.com/openshift/api/operator/v1.NodeStatus", "github.com/openshift/api/operator/v1.OperatorCondition"}, } } @@ -50170,7 +50239,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicySpecFile(ref common.Re Properties: map[string]spec.Schema{ "path": { SchemaProps: spec.SchemaProps{ - Description: "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + Description: "path is the location of a file being managed through a MachineConfig. The Actions in the policy will apply to changes to the file at this path.", Default: "", Type: []string{"string"}, Format: "", @@ -50360,7 +50429,7 @@ func schema_openshift_api_operator_v1_NodeDisruptionPolicyStatusFile(ref common. Properties: map[string]spec.Schema{ "path": { SchemaProps: spec.SchemaProps{ - Description: "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + Description: "path is the location of a file being managed through a MachineConfig. The Actions in the policy will apply to changes to the file at this path.", Default: "", Type: []string{"string"}, Format: "", diff --git a/openapi/openapi.json b/openapi/openapi.json index 1c7656357d3..c84af06cc88 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -28762,30 +28762,71 @@ }, "com.github.openshift.api.operator.v1.MachineConfigurationStatus": { "type": "object", + "required": [ + "readyReplicas" + ], "properties": { "conditions": { "description": "conditions is a list of conditions and their status", "type": "array", "items": { "default": {}, - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + "$ref": "#/definitions/com.github.openshift.api.operator.v1.OperatorCondition" }, "x-kubernetes-list-map-keys": [ "type" ], - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge" + "x-kubernetes-list-type": "map" + }, + "generations": { + "description": "generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.GenerationStatus" + }, + "x-kubernetes-list-type": "atomic" + }, + "latestAvailableRevision": { + "description": "latestAvailableRevision is the deploymentID of the most recent deployment", + "type": "integer", + "format": "int32" + }, + "latestAvailableRevisionReason": { + "description": "latestAvailableRevisionReason describe the detailed reason for the most recent deployment", + "type": "string" }, "nodeDisruptionPolicyStatus": { "description": "nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine Config Daemon during future node updates.", "default": {}, "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatus" }, + "nodeStatuses": { + "description": "nodeStatuses track the deployment values and errors across individual nodes", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeStatus" + }, + "x-kubernetes-list-map-keys": [ + "nodeName" + ], + "x-kubernetes-list-type": "map" + }, "observedGeneration": { "description": "observedGeneration is the last generation change you've dealt with", "type": "integer", "format": "int64" + }, + "readyReplicas": { + "description": "readyReplicas indicates how many replicas are ready and at the desired state", + "type": "integer", + "format": "int32", + "default": 0 + }, + "version": { + "description": "version is the level this availability applies to", + "type": "string" } } }, @@ -29313,7 +29354,7 @@ "x-kubernetes-list-type": "atomic" }, "path": { - "description": "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + "description": "path is the location of a file being managed through a MachineConfig. The Actions in the policy will apply to changes to the file at this path.", "type": "string", "default": "" } @@ -29419,7 +29460,7 @@ "x-kubernetes-list-type": "atomic" }, "path": { - "description": "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + "description": "path is the location of a file being managed through a MachineConfig. The Actions in the policy will apply to changes to the file at this path.", "type": "string", "default": "" } diff --git a/operator/v1/techpreview.machineconfiguration.testsuite.yaml b/operator/v1/techpreview.machineconfiguration.testsuite.yaml index c89d85f70ec..38dcbcf3485 100644 --- a/operator/v1/techpreview.machineconfiguration.testsuite.yaml +++ b/operator/v1/techpreview.machineconfiguration.testsuite.yaml @@ -230,7 +230,7 @@ tests: actions: - type: DaemonReload - type: Reload - expectedError: "Reload is required when type is reload, and forbidden otherwise" + expectedError: "reload is required when type is Reload, and forbidden otherwise" - name: Node disruption policies that specify a reboot action should not allow other actions in the list initial: | apiVersion: operator.openshift.io/v1 @@ -323,4 +323,4 @@ tests: - type: Drain - type: Restart restart: - serviceName: a.b.c.d.e.snapshot \ No newline at end of file + serviceName: a.b.c.d.e.snapshot diff --git a/operator/v1/types_machineconfiguration.go b/operator/v1/types_machineconfiguration.go index 47be7bd707e..5afc154dcd9 100644 --- a/operator/v1/types_machineconfiguration.go +++ b/operator/v1/types_machineconfiguration.go @@ -57,16 +57,8 @@ type MachineConfigurationSpec struct { } type MachineConfigurationStatus struct { - // conditions is a list of conditions and their status - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` - - // observedGeneration is the last generation change you've dealt with - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` + // TODO tombstone this field + StaticPodOperatorStatus `json:",inline"` // nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, // and will be used by the Machine Config Daemon during future node updates. @@ -230,9 +222,8 @@ type NodeDisruptionPolicyClusterStatus struct { // NodeDisruptionPolicySpecFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object type NodeDisruptionPolicySpecFile struct { - // path is the location of the file being managed through a MachineConfig. - // Actions specified will be applied when changes to the file at the path - // configured in this field. + // path is the location of a file being managed through a MachineConfig. + // The Actions in the policy will apply to changes to the file at this path. // +kubebuilder:validation:Required Path string `json:"path"` // actions represents the series of commands to be executed on changes to the file at @@ -252,9 +243,8 @@ type NodeDisruptionPolicySpecFile struct { // NodeDisruptionPolicyStatusFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object type NodeDisruptionPolicyStatusFile struct { - // path is the location of the file being managed through a MachineConfig. - // Actions specified will be applied when changes to the file at the path - // configured in this field. + // path is the location of a file being managed through a MachineConfig. + // The Actions in the policy will apply to changes to the file at this path. // +kubebuilder:validation:Required Path string `json:"path"` // actions represents the series of commands to be executed on changes to the file at @@ -279,11 +269,8 @@ type NodeDisruptionPolicySpecUnit struct { // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". - // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." - // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:Required - // +kubebuilder:validation:MaxLength=255 - Name string `json:"name"` + Name NodeDisruptionPolicyServiceName `json:"name"` // actions represents the series of commands to be executed on changes to the file at // the corresponding file path. Actions will be applied in the order that @@ -307,11 +294,8 @@ type NodeDisruptionPolicyStatusUnit struct { // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". - // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." - // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:Required - // +kubebuilder:validation:MaxLength=255 - Name string `json:"name"` + Name NodeDisruptionPolicyServiceName `json:"name"` // actions represents the series of commands to be executed on changes to the file at // the corresponding file path. Actions will be applied in the order that @@ -362,8 +346,8 @@ type NodeDisruptionPolicyStatusSSHKey struct { Actions []NodeDisruptionPolicyStatusAction `json:"actions"` } -// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Reload' ? has(self.reload) : !has(self.reload)",message="Reload is required when type is reload, and forbidden otherwise" -// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Restart' ? has(self.restart) : !has(self.restart)",message="Restart is required when type is restart, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Reload' ? has(self.reload) : !has(self.reload)",message="reload is required when type is Reload, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Restart' ? has(self.restart) : !has(self.restart)",message="restart is required when type is Restart, and forbidden otherwise" // +union type NodeDisruptionPolicySpecAction struct { // type represents the commands that will be carried out if this NodeDisruptionPolicySpecActionType is executed @@ -381,8 +365,8 @@ type NodeDisruptionPolicySpecAction struct { Restart *RestartService `json:"restart,omitempty"` } -// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Reload' ? has(self.reload) : !has(self.reload)",message="Reload is required when type is reload, and forbidden otherwise" -// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Restart' ? has(self.restart) : !has(self.restart)",message="Restart is required when type is restart, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Reload' ? has(self.reload) : !has(self.reload)",message="reload is required when type is Reload, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Restart' ? has(self.restart) : !has(self.restart)",message="restart is required when type is Restart, and forbidden otherwise" // +union type NodeDisruptionPolicyStatusAction struct { // type represents the commands that will be carried out if this NodeDisruptionPolicyStatusActionType is executed @@ -406,11 +390,8 @@ type ReloadService struct { // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". - // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." - // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:Required - // +kubebuilder:validation:MaxLength=255 - ServiceName string `json:"serviceName"` + ServiceName NodeDisruptionPolicyServiceName `json:"serviceName"` } // RestartService allows the user to specify the services to be restarted @@ -419,17 +400,19 @@ type RestartService struct { // Service names should be of the format ${NAME}${SERVICETYPE} and can up to 255 characters long. // ${NAME} must be atleast 1 character long and can only consist of alphabets, digits, ":", "-", "_", ".", and "\". // ${SERVICETYPE} must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".snapshot", ".slice" or ".scope". - // +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." - // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" // +kubebuilder:validation:Required - // +kubebuilder:validation:MaxLength=255 - ServiceName string `json:"serviceName"` + ServiceName NodeDisruptionPolicyServiceName `json:"serviceName"` } // NodeDisruptionPolicySpecActionType is a string enum used in a NodeDisruptionPolicySpecAction object. They describe an action to be performed. // +kubebuilder:validation:Enum:="Reboot";"Drain";"Reload";"Restart";"DaemonReload";"None" type NodeDisruptionPolicySpecActionType string +// +kubebuilder:validation:XValidation:rule=`self.matches('\\.(service|socket|device|mount|automount|swap|target|path|timer|snapshot|slice|scope)$')`, message="Invalid ${SERVICETYPE} in service name. Expected format is ${NAME}${SERVICETYPE}, where ${SERVICETYPE} must be one of \".service\", \".socket\", \".device\", \".mount\", \".automount\", \".swap\", \".target\", \".path\", \".timer\",\".snapshot\", \".slice\" or \".scope\"." +// +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9:._\\\\-]+\\..')`, message="Invalid ${NAME} in service name. Expected format is ${NAME}${SERVICETYPE}, where {NAME} must be atleast 1 character long and can only consist of alphabets, digits, \":\", \"-\", \"_\", \".\", and \"\\\"" +// +kubebuilder:validation:MaxLength=255 +type NodeDisruptionPolicyServiceName string + const ( // Reboot represents an action that will cause nodes to be rebooted. This is the default action by the MCO // if a reboot policy is not found for a change/update being performed by the MCO. diff --git a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml index 56f908bce9f..3a2d46d3036 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml @@ -326,11 +326,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, and + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -347,10 +347,9 @@ spec: rule: 'self.exists(x, x.type==''None'') ? size(self) == 1 : true' path: - description: path is the location of the file being managed - through a MachineConfig. Actions specified will be applied - when changes to the file at the path configured in this - field. + description: path is the location of a file being managed + through a MachineConfig. The Actions in the policy will + apply to changes to the file at this path. type: string required: - actions @@ -467,11 +466,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and forbidden + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, and + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -600,11 +599,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, and + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -701,75 +700,68 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + description: OperatorCondition is just the standard condition fields. 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. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - 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 + generations: + description: generations are used to determine when an item needs + to be reconciled or has changed in a way that needs a reaction. + items: + description: GenerationStatus keeps track of the generation for + a given resource so that decisions about forced updates can be + made. + properties: + group: + description: group is the group of the thing you're tracking + type: string + hash: + description: hash is an optional field set for resources without + generation that are content sensitive like secrets and configmaps + type: string + lastGeneration: + description: lastGeneration is the last generation of the workload + controller involved + format: int64 + type: integer + name: + description: name is the name of the thing you're tracking + type: string + namespace: + description: namespace is where the thing you're tracking is + type: string + resource: + description: resource is the resource type of the thing you're + tracking + type: string + type: object + type: array + x-kubernetes-list-type: atomic + latestAvailableRevision: + description: latestAvailableRevision is the deploymentID of the most + recent deployment + format: int32 + type: integer + latestAvailableRevisionReason: + description: latestAvailableRevisionReason describe the detailed reason + for the most recent deployment + type: string nodeDisruptionPolicyStatus: description: nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine @@ -892,11 +884,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -913,10 +905,9 @@ spec: rule: 'self.exists(x, x.type==''None'') ? size(self) == 1 : true' path: - description: path is the location of the file being - managed through a MachineConfig. Actions specified - will be applied when changes to the file at the path - configured in this field. + description: path is the location of a file being managed + through a MachineConfig. The Actions in the policy + will apply to changes to the file at this path. type: string required: - actions @@ -1032,11 +1023,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -1168,11 +1159,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -1224,11 +1215,75 @@ spec: x-kubernetes-list-type: map type: object type: object + nodeStatuses: + description: nodeStatuses track the deployment values and errors across + individual nodes + items: + description: NodeStatus provides information about the current state + of a particular node managed by this operator. + properties: + currentRevision: + description: currentRevision is the generation of the most recently + successful deployment + format: int32 + type: integer + lastFailedCount: + description: lastFailedCount is how often the installer pod + of the last failed revision failed. + type: integer + lastFailedReason: + description: lastFailedReason is a machine readable failure + reason string. + type: string + lastFailedRevision: + description: lastFailedRevision is the generation of the deployment + we tried and failed to deploy. + format: int32 + type: integer + lastFailedRevisionErrors: + description: lastFailedRevisionErrors is a list of human readable + errors during the failed deployment referenced in lastFailedRevision. + items: + type: string + type: array + x-kubernetes-list-type: atomic + lastFailedTime: + description: lastFailedTime is the time the last failed revision + failed the last time. + format: date-time + type: string + lastFallbackCount: + description: lastFallbackCount is how often a fallback to a + previous revision happened. + type: integer + nodeName: + description: nodeName is the name of the node + type: string + targetRevision: + description: targetRevision is the generation of the deployment + we're trying to apply + format: int32 + type: integer + required: + - nodeName + type: object + type: array + x-kubernetes-list-map-keys: + - nodeName + x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer + readyReplicas: + description: readyReplicas indicates how many replicas are ready and + at the desired state + format: int32 + type: integer + version: + description: version is the level this availability applies to + type: string type: object required: - spec diff --git a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-Default.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-Default.crd.yaml index 7ddaf40ff19..8fd0c546df6 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-Default.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-Default.crd.yaml @@ -120,80 +120,137 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + description: OperatorCondition is just the standard condition fields. 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. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - 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 + generations: + description: generations are used to determine when an item needs + to be reconciled or has changed in a way that needs a reaction. + items: + description: GenerationStatus keeps track of the generation for + a given resource so that decisions about forced updates can be + made. + properties: + group: + description: group is the group of the thing you're tracking + type: string + hash: + description: hash is an optional field set for resources without + generation that are content sensitive like secrets and configmaps + type: string + lastGeneration: + description: lastGeneration is the last generation of the workload + controller involved + format: int64 + type: integer + name: + description: name is the name of the thing you're tracking + type: string + namespace: + description: namespace is where the thing you're tracking is + type: string + resource: + description: resource is the resource type of the thing you're + tracking + type: string + type: object + type: array + x-kubernetes-list-type: atomic + latestAvailableRevision: + description: latestAvailableRevision is the deploymentID of the most + recent deployment + format: int32 + type: integer + latestAvailableRevisionReason: + description: latestAvailableRevisionReason describe the detailed reason + for the most recent deployment + type: string + nodeStatuses: + description: nodeStatuses track the deployment values and errors across + individual nodes + items: + description: NodeStatus provides information about the current state + of a particular node managed by this operator. + properties: + currentRevision: + description: currentRevision is the generation of the most recently + successful deployment + format: int32 + type: integer + lastFailedCount: + description: lastFailedCount is how often the installer pod + of the last failed revision failed. + type: integer + lastFailedReason: + description: lastFailedReason is a machine readable failure + reason string. + type: string + lastFailedRevision: + description: lastFailedRevision is the generation of the deployment + we tried and failed to deploy. + format: int32 + type: integer + lastFailedRevisionErrors: + description: lastFailedRevisionErrors is a list of human readable + errors during the failed deployment referenced in lastFailedRevision. + items: + type: string + type: array + x-kubernetes-list-type: atomic + lastFailedTime: + description: lastFailedTime is the time the last failed revision + failed the last time. + format: date-time + type: string + lastFallbackCount: + description: lastFallbackCount is how often a fallback to a + previous revision happened. + type: integer + nodeName: + description: nodeName is the name of the node + type: string + targetRevision: + description: targetRevision is the generation of the deployment + we're trying to apply + format: int32 + type: integer + required: + - nodeName + type: object + type: array + x-kubernetes-list-map-keys: + - nodeName + x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer + readyReplicas: + description: readyReplicas indicates how many replicas are ready and + at the desired state + format: int32 + type: integer + version: + description: version is the level this availability applies to + type: string type: object required: - spec diff --git a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml index aefb72d1c0a..c030d3c82bb 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml @@ -326,11 +326,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, and + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -347,10 +347,9 @@ spec: rule: 'self.exists(x, x.type==''None'') ? size(self) == 1 : true' path: - description: path is the location of the file being managed - through a MachineConfig. Actions specified will be applied - when changes to the file at the path configured in this - field. + description: path is the location of a file being managed + through a MachineConfig. The Actions in the policy will + apply to changes to the file at this path. type: string required: - actions @@ -467,11 +466,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and forbidden + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, and + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -600,11 +599,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, and + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -701,75 +700,68 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + description: OperatorCondition is just the standard condition fields. 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. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - 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 + generations: + description: generations are used to determine when an item needs + to be reconciled or has changed in a way that needs a reaction. + items: + description: GenerationStatus keeps track of the generation for + a given resource so that decisions about forced updates can be + made. + properties: + group: + description: group is the group of the thing you're tracking + type: string + hash: + description: hash is an optional field set for resources without + generation that are content sensitive like secrets and configmaps + type: string + lastGeneration: + description: lastGeneration is the last generation of the workload + controller involved + format: int64 + type: integer + name: + description: name is the name of the thing you're tracking + type: string + namespace: + description: namespace is where the thing you're tracking is + type: string + resource: + description: resource is the resource type of the thing you're + tracking + type: string + type: object + type: array + x-kubernetes-list-type: atomic + latestAvailableRevision: + description: latestAvailableRevision is the deploymentID of the most + recent deployment + format: int32 + type: integer + latestAvailableRevisionReason: + description: latestAvailableRevisionReason describe the detailed reason + for the most recent deployment + type: string nodeDisruptionPolicyStatus: description: nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine @@ -892,11 +884,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -913,10 +905,9 @@ spec: rule: 'self.exists(x, x.type==''None'') ? size(self) == 1 : true' path: - description: path is the location of the file being - managed through a MachineConfig. Actions specified - will be applied when changes to the file at the path - configured in this field. + description: path is the location of a file being managed + through a MachineConfig. The Actions in the policy + will apply to changes to the file at this path. type: string required: - actions @@ -1032,11 +1023,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -1168,11 +1159,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -1224,11 +1215,75 @@ spec: x-kubernetes-list-type: map type: object type: object + nodeStatuses: + description: nodeStatuses track the deployment values and errors across + individual nodes + items: + description: NodeStatus provides information about the current state + of a particular node managed by this operator. + properties: + currentRevision: + description: currentRevision is the generation of the most recently + successful deployment + format: int32 + type: integer + lastFailedCount: + description: lastFailedCount is how often the installer pod + of the last failed revision failed. + type: integer + lastFailedReason: + description: lastFailedReason is a machine readable failure + reason string. + type: string + lastFailedRevision: + description: lastFailedRevision is the generation of the deployment + we tried and failed to deploy. + format: int32 + type: integer + lastFailedRevisionErrors: + description: lastFailedRevisionErrors is a list of human readable + errors during the failed deployment referenced in lastFailedRevision. + items: + type: string + type: array + x-kubernetes-list-type: atomic + lastFailedTime: + description: lastFailedTime is the time the last failed revision + failed the last time. + format: date-time + type: string + lastFallbackCount: + description: lastFallbackCount is how often a fallback to a + previous revision happened. + type: integer + nodeName: + description: nodeName is the name of the node + type: string + targetRevision: + description: targetRevision is the generation of the deployment + we're trying to apply + format: int32 + type: integer + required: + - nodeName + type: object + type: array + x-kubernetes-list-map-keys: + - nodeName + x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer + readyReplicas: + description: readyReplicas indicates how many replicas are ready and + at the desired state + format: int32 + type: integer + version: + description: version is the level this availability applies to + type: string type: object required: - spec diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 33366b07c99..c98770feecf 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -2953,13 +2953,7 @@ func (in *MachineConfigurationSpec) DeepCopy() *MachineConfigurationSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineConfigurationStatus) DeepCopyInto(out *MachineConfigurationStatus) { *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]) - } - } + in.StaticPodOperatorStatus.DeepCopyInto(&out.StaticPodOperatorStatus) in.NodeDisruptionPolicyStatus.DeepCopyInto(&out.NodeDisruptionPolicyStatus) return } diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/AAA_ungated.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/AAA_ungated.yaml index f7bbb575c1f..f04164fc884 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/AAA_ungated.yaml @@ -119,80 +119,137 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + description: OperatorCondition is just the standard condition fields. 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. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - 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 + generations: + description: generations are used to determine when an item needs + to be reconciled or has changed in a way that needs a reaction. + items: + description: GenerationStatus keeps track of the generation for + a given resource so that decisions about forced updates can be + made. + properties: + group: + description: group is the group of the thing you're tracking + type: string + hash: + description: hash is an optional field set for resources without + generation that are content sensitive like secrets and configmaps + type: string + lastGeneration: + description: lastGeneration is the last generation of the workload + controller involved + format: int64 + type: integer + name: + description: name is the name of the thing you're tracking + type: string + namespace: + description: namespace is where the thing you're tracking is + type: string + resource: + description: resource is the resource type of the thing you're + tracking + type: string + type: object + type: array + x-kubernetes-list-type: atomic + latestAvailableRevision: + description: latestAvailableRevision is the deploymentID of the most + recent deployment + format: int32 + type: integer + latestAvailableRevisionReason: + description: latestAvailableRevisionReason describe the detailed reason + for the most recent deployment + type: string + nodeStatuses: + description: nodeStatuses track the deployment values and errors across + individual nodes + items: + description: NodeStatus provides information about the current state + of a particular node managed by this operator. + properties: + currentRevision: + description: currentRevision is the generation of the most recently + successful deployment + format: int32 + type: integer + lastFailedCount: + description: lastFailedCount is how often the installer pod + of the last failed revision failed. + type: integer + lastFailedReason: + description: lastFailedReason is a machine readable failure + reason string. + type: string + lastFailedRevision: + description: lastFailedRevision is the generation of the deployment + we tried and failed to deploy. + format: int32 + type: integer + lastFailedRevisionErrors: + description: lastFailedRevisionErrors is a list of human readable + errors during the failed deployment referenced in lastFailedRevision. + items: + type: string + type: array + x-kubernetes-list-type: atomic + lastFailedTime: + description: lastFailedTime is the time the last failed revision + failed the last time. + format: date-time + type: string + lastFallbackCount: + description: lastFallbackCount is how often a fallback to a + previous revision happened. + type: integer + nodeName: + description: nodeName is the name of the node + type: string + targetRevision: + description: targetRevision is the generation of the deployment + we're trying to apply + format: int32 + type: integer + required: + - nodeName + type: object + type: array + x-kubernetes-list-map-keys: + - nodeName + x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer + readyReplicas: + description: readyReplicas indicates how many replicas are ready and + at the desired state + format: int32 + type: integer + version: + description: version is the level this availability applies to + type: string type: object required: - spec diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/ManagedBootImages.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/ManagedBootImages.yaml index 4dd5145b329..13a3c3865df 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/ManagedBootImages.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/ManagedBootImages.yaml @@ -253,80 +253,137 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + description: OperatorCondition is just the standard condition fields. 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. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - 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 + generations: + description: generations are used to determine when an item needs + to be reconciled or has changed in a way that needs a reaction. + items: + description: GenerationStatus keeps track of the generation for + a given resource so that decisions about forced updates can be + made. + properties: + group: + description: group is the group of the thing you're tracking + type: string + hash: + description: hash is an optional field set for resources without + generation that are content sensitive like secrets and configmaps + type: string + lastGeneration: + description: lastGeneration is the last generation of the workload + controller involved + format: int64 + type: integer + name: + description: name is the name of the thing you're tracking + type: string + namespace: + description: namespace is where the thing you're tracking is + type: string + resource: + description: resource is the resource type of the thing you're + tracking + type: string + type: object + type: array + x-kubernetes-list-type: atomic + latestAvailableRevision: + description: latestAvailableRevision is the deploymentID of the most + recent deployment + format: int32 + type: integer + latestAvailableRevisionReason: + description: latestAvailableRevisionReason describe the detailed reason + for the most recent deployment + type: string + nodeStatuses: + description: nodeStatuses track the deployment values and errors across + individual nodes + items: + description: NodeStatus provides information about the current state + of a particular node managed by this operator. + properties: + currentRevision: + description: currentRevision is the generation of the most recently + successful deployment + format: int32 + type: integer + lastFailedCount: + description: lastFailedCount is how often the installer pod + of the last failed revision failed. + type: integer + lastFailedReason: + description: lastFailedReason is a machine readable failure + reason string. + type: string + lastFailedRevision: + description: lastFailedRevision is the generation of the deployment + we tried and failed to deploy. + format: int32 + type: integer + lastFailedRevisionErrors: + description: lastFailedRevisionErrors is a list of human readable + errors during the failed deployment referenced in lastFailedRevision. + items: + type: string + type: array + x-kubernetes-list-type: atomic + lastFailedTime: + description: lastFailedTime is the time the last failed revision + failed the last time. + format: date-time + type: string + lastFallbackCount: + description: lastFallbackCount is how often a fallback to a + previous revision happened. + type: integer + nodeName: + description: nodeName is the name of the node + type: string + targetRevision: + description: targetRevision is the generation of the deployment + we're trying to apply + format: int32 + type: integer + required: + - nodeName + type: object + type: array + x-kubernetes-list-map-keys: + - nodeName + x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer + readyReplicas: + description: readyReplicas indicates how many replicas are ready and + at the desired state + format: int32 + type: integer + version: + description: version is the level this availability applies to + type: string type: object required: - spec diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml index ac2f90aa7ef..8ed2e5180c1 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml @@ -191,11 +191,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, and + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -212,10 +212,9 @@ spec: rule: 'self.exists(x, x.type==''None'') ? size(self) == 1 : true' path: - description: path is the location of the file being managed - through a MachineConfig. Actions specified will be applied - when changes to the file at the path configured in this - field. + description: path is the location of a file being managed + through a MachineConfig. The Actions in the policy will + apply to changes to the file at this path. type: string required: - actions @@ -332,11 +331,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and forbidden + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, and + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -465,11 +464,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, and + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -566,75 +565,68 @@ spec: conditions: description: conditions is a list of conditions and their status items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + description: OperatorCondition is just the standard condition fields. 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. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - 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 + generations: + description: generations are used to determine when an item needs + to be reconciled or has changed in a way that needs a reaction. + items: + description: GenerationStatus keeps track of the generation for + a given resource so that decisions about forced updates can be + made. + properties: + group: + description: group is the group of the thing you're tracking + type: string + hash: + description: hash is an optional field set for resources without + generation that are content sensitive like secrets and configmaps + type: string + lastGeneration: + description: lastGeneration is the last generation of the workload + controller involved + format: int64 + type: integer + name: + description: name is the name of the thing you're tracking + type: string + namespace: + description: namespace is where the thing you're tracking is + type: string + resource: + description: resource is the resource type of the thing you're + tracking + type: string + type: object + type: array + x-kubernetes-list-type: atomic + latestAvailableRevision: + description: latestAvailableRevision is the deploymentID of the most + recent deployment + format: int32 + type: integer + latestAvailableRevisionReason: + description: latestAvailableRevisionReason describe the detailed reason + for the most recent deployment + type: string nodeDisruptionPolicyStatus: description: nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine @@ -757,11 +749,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -778,10 +770,9 @@ spec: rule: 'self.exists(x, x.type==''None'') ? size(self) == 1 : true' path: - description: path is the location of the file being - managed through a MachineConfig. Actions specified - will be applied when changes to the file at the path - configured in this field. + description: path is the location of a file being managed + through a MachineConfig. The Actions in the policy + will apply to changes to the file at this path. type: string required: - actions @@ -897,11 +888,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, and + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -1033,11 +1024,11 @@ spec: - type type: object x-kubernetes-validations: - - message: Reload is required when type is reload, + - message: reload is required when type is Reload, and forbidden otherwise rule: 'has(self.type) && self.type == ''Reload'' ? has(self.reload) : !has(self.reload)' - - message: Restart is required when type is restart, + - message: restart is required when type is Restart, and forbidden otherwise rule: 'has(self.type) && self.type == ''Restart'' ? has(self.restart) : !has(self.restart)' @@ -1089,11 +1080,75 @@ spec: x-kubernetes-list-type: map type: object type: object + nodeStatuses: + description: nodeStatuses track the deployment values and errors across + individual nodes + items: + description: NodeStatus provides information about the current state + of a particular node managed by this operator. + properties: + currentRevision: + description: currentRevision is the generation of the most recently + successful deployment + format: int32 + type: integer + lastFailedCount: + description: lastFailedCount is how often the installer pod + of the last failed revision failed. + type: integer + lastFailedReason: + description: lastFailedReason is a machine readable failure + reason string. + type: string + lastFailedRevision: + description: lastFailedRevision is the generation of the deployment + we tried and failed to deploy. + format: int32 + type: integer + lastFailedRevisionErrors: + description: lastFailedRevisionErrors is a list of human readable + errors during the failed deployment referenced in lastFailedRevision. + items: + type: string + type: array + x-kubernetes-list-type: atomic + lastFailedTime: + description: lastFailedTime is the time the last failed revision + failed the last time. + format: date-time + type: string + lastFallbackCount: + description: lastFallbackCount is how often a fallback to a + previous revision happened. + type: integer + nodeName: + description: nodeName is the name of the node + type: string + targetRevision: + description: targetRevision is the generation of the deployment + we're trying to apply + format: int32 + type: integer + required: + - nodeName + type: object + type: array + x-kubernetes-list-map-keys: + - nodeName + x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the last generation change you've dealt with format: int64 type: integer + readyReplicas: + description: readyReplicas indicates how many replicas are ready and + at the desired state + format: int32 + type: integer + version: + description: version is the level this availability applies to + type: string type: object required: - spec diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index fbb6c444823..6d9197407d3 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -1284,8 +1284,6 @@ func (MachineConfigurationSpec) SwaggerDoc() map[string]string { } var map_MachineConfigurationStatus = map[string]string{ - "conditions": "conditions is a list of conditions and their status", - "observedGeneration": "observedGeneration is the last generation change you've dealt with", "nodeDisruptionPolicyStatus": "nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine Config Daemon during future node updates.", } @@ -1355,7 +1353,7 @@ func (NodeDisruptionPolicySpecAction) SwaggerDoc() map[string]string { var map_NodeDisruptionPolicySpecFile = map[string]string{ "": "NodeDisruptionPolicySpecFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyConfig object", - "path": "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + "path": "path is the location of a file being managed through a MachineConfig. The Actions in the policy will apply to changes to the file at this path.", "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", } @@ -1402,7 +1400,7 @@ func (NodeDisruptionPolicyStatusAction) SwaggerDoc() map[string]string { var map_NodeDisruptionPolicyStatusFile = map[string]string{ "": "NodeDisruptionPolicyStatusFile is a file entry and corresponding actions to take and is used in the NodeDisruptionPolicyClusterStatus object", - "path": "path is the location of the file being managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.", + "path": "path is the location of a file being managed through a MachineConfig. The Actions in the policy will apply to changes to the file at this path.", "actions": "actions represents the series of commands to be executed on changes to the file at the corresponding file path. Actions will be applied in the order that they are set in this list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions. Valid actions are Reboot, Drain, Reload, DaemonReload and None. The Reboot action and the None action cannot be used in conjunction with any of the other actions. This list supports a maximum of 10 entries.", }