From f8a85ad87802e34a16f19e94e5773903010af022 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 29 May 2019 12:44:39 -0700 Subject: [PATCH 1/2] config/v1/types_cluster_version: Add ClusterVersionSpec.AutomaticUpdates Give cluster admins a knob for turning these on and off. You could conceivably build a bunch of logic in here, like an update-schedule schema configuring allowed upgrade times [1]. But it's going to be hard to get a spec schema that supports all the upgrade-gating logic that users will need. Instead, we have a simple boolean switch here and very basic logic in the cluster-version operator. Users who want more control can run their own Cincinnati proxy/mirrors with Policy Engines [2] that add their desired behavior (e.g. removing all edges during times when they don't want clusters auto-upgrading). [1]: https://github.com/openshift/api/pull/326#commitcomment-33726440 [2]: https://github.com/openshift/cincinnati/blob/1777fc45cefaab3c8c0e870ef1dfc29564d2d37b/docs/design/cincinnati.md#policy-engine --- config/v1/types_cluster_version.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/v1/types_cluster_version.go b/config/v1/types_cluster_version.go index 6ab92365b99..301f3527b69 100644 --- a/config/v1/types_cluster_version.go +++ b/config/v1/types_cluster_version.go @@ -50,6 +50,10 @@ type ClusterVersionSpec struct { // +optional DesiredUpdate *Update `json:"desiredUpdate,omitempty"` + // automaticUpdates enables automatic updates. + // +optional + AutomaticUpdates bool `json:"automaticUpdates,omitempty"` + // upstream may be used to specify the preferred update server. By default // it will use the appropriate update server for the cluster and region. // From 0b9690b5dc3b370f6e901bba25a72c67bc217877 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 29 May 2019 12:46:34 -0700 Subject: [PATCH 2/2] generated With: $ make generate --- config/v1/zz_generated.swagger_doc_generated.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/config/v1/zz_generated.swagger_doc_generated.go b/config/v1/zz_generated.swagger_doc_generated.go index 65e759682da..adeb9a7fd33 100644 --- a/config/v1/zz_generated.swagger_doc_generated.go +++ b/config/v1/zz_generated.swagger_doc_generated.go @@ -474,12 +474,13 @@ func (ClusterVersionList) SwaggerDoc() map[string]string { } var map_ClusterVersionSpec = map[string]string{ - "": "ClusterVersionSpec is the desired version state of the cluster. It includes the version the cluster should be at, how the cluster is identified, and where the cluster should look for version updates.", - "clusterID": "clusterID uniquely identifies this cluster. This is expected to be an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in hexadecimal values). This is a required field.", - "desiredUpdate": "desiredUpdate is an optional field that indicates the desired value of the cluster version. Setting this value will trigger an upgrade (if the current version does not match the desired version). The set of recommended update values is listed as part of available updates in status, and setting values outside that range may cause the upgrade to fail. You may specify the version field without setting image if an update exists with that version in the availableUpdates or history.\n\nIf an upgrade fails the operator will halt and report status about the failing component. Setting the desired update value back to the previous version will cause a rollback to be attempted. Not all rollbacks will succeed.", - "upstream": "upstream may be used to specify the preferred update server. By default it will use the appropriate update server for the cluster and region.", - "channel": "channel is an identifier for explicitly requesting that a non-default set of updates be applied to this cluster. The default channel will be contain stable updates that are appropriate for production clusters.", - "overrides": "overrides is list of overides for components that are managed by cluster version operator. Marking a component unmanaged will prevent the operator from creating or updating the object.", + "": "ClusterVersionSpec is the desired version state of the cluster. It includes the version the cluster should be at, how the cluster is identified, and where the cluster should look for version updates.", + "clusterID": "clusterID uniquely identifies this cluster. This is expected to be an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in hexadecimal values). This is a required field.", + "desiredUpdate": "desiredUpdate is an optional field that indicates the desired value of the cluster version. Setting this value will trigger an upgrade (if the current version does not match the desired version). The set of recommended update values is listed as part of available updates in status, and setting values outside that range may cause the upgrade to fail. You may specify the version field without setting image if an update exists with that version in the availableUpdates or history.\n\nIf an upgrade fails the operator will halt and report status about the failing component. Setting the desired update value back to the previous version will cause a rollback to be attempted. Not all rollbacks will succeed.", + "automaticUpdates": "automaticUpdates enables automatic updates.", + "upstream": "upstream may be used to specify the preferred update server. By default it will use the appropriate update server for the cluster and region.", + "channel": "channel is an identifier for explicitly requesting that a non-default set of updates be applied to this cluster. The default channel will be contain stable updates that are appropriate for production clusters.", + "overrides": "overrides is list of overides for components that are managed by cluster version operator. Marking a component unmanaged will prevent the operator from creating or updating the object.", } func (ClusterVersionSpec) SwaggerDoc() map[string]string {