diff --git a/api/hypershift/v1alpha1/hosted_controlplane.go b/api/hypershift/v1alpha1/hosted_controlplane.go index 7ed50dfb757..aa34f8143c2 100644 --- a/api/hypershift/v1alpha1/hosted_controlplane.go +++ b/api/hypershift/v1alpha1/hosted_controlplane.go @@ -4,6 +4,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + + configv1 "github.com/openshift/api/config/v1" ) func init() { @@ -38,6 +40,12 @@ type HostedControlPlaneSpec struct { // If not defined, ReleaseImage is used ControlPlaneReleaseImage *string `json:"controlPlaneReleaseImage,omitempty"` + // updateService may be used to specify the preferred upstream update service. + // By default it will use the appropriate update service for the cluster and region. + // + // +optional + UpdateService configv1.URL `json:"updateService,omitempty"` + // 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. diff --git a/api/hypershift/v1alpha1/hostedcluster_types.go b/api/hypershift/v1alpha1/hostedcluster_types.go index 5631c5a1ccf..2b8e89782c0 100644 --- a/api/hypershift/v1alpha1/hostedcluster_types.go +++ b/api/hypershift/v1alpha1/hostedcluster_types.go @@ -166,6 +166,12 @@ type HostedClusterSpec struct { // +optional ClusterID string `json:"clusterID,omitempty"` + // updateService may be used to specify the preferred upstream update service. + // By default it will use the appropriate update service for the cluster and region. + // + // +optional + UpdateService configv1.URL `json:"updateService,omitempty"` + // 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. diff --git a/api/hypershift/v1beta1/hosted_controlplane.go b/api/hypershift/v1beta1/hosted_controlplane.go index cae547eda73..754e6500459 100644 --- a/api/hypershift/v1beta1/hosted_controlplane.go +++ b/api/hypershift/v1beta1/hosted_controlplane.go @@ -4,6 +4,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + + configv1 "github.com/openshift/api/config/v1" ) func init() { @@ -41,6 +43,12 @@ type HostedControlPlaneSpec struct { // If not defined, ReleaseImage is used ControlPlaneReleaseImage *string `json:"controlPlaneReleaseImage,omitempty"` + // updateService may be used to specify the preferred upstream update service. + // By default it will use the appropriate update service for the cluster and region. + // + // +optional + UpdateService configv1.URL `json:"updateService,omitempty"` + // 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. diff --git a/api/hypershift/v1beta1/hostedcluster_types.go b/api/hypershift/v1beta1/hostedcluster_types.go index 2f7c5dbd831..7b976fffc55 100644 --- a/api/hypershift/v1beta1/hostedcluster_types.go +++ b/api/hypershift/v1beta1/hostedcluster_types.go @@ -309,6 +309,12 @@ type HostedClusterSpec struct { // +optional ClusterID string `json:"clusterID,omitempty"` + // updateService may be used to specify the preferred upstream update service. + // By default it will use the appropriate update service for the cluster and region. + // + // +optional + UpdateService configv1.URL `json:"updateService,omitempty"` + // 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. diff --git a/client/applyconfiguration/hypershift/v1alpha1/hostedclusterspec.go b/client/applyconfiguration/hypershift/v1alpha1/hostedclusterspec.go index 328caa03b07..cafa1f357ee 100644 --- a/client/applyconfiguration/hypershift/v1alpha1/hostedclusterspec.go +++ b/client/applyconfiguration/hypershift/v1alpha1/hostedclusterspec.go @@ -18,8 +18,9 @@ limitations under the License. package v1alpha1 import ( + v1 "github.com/openshift/api/config/v1" hypershiftv1alpha1 "github.com/openshift/hypershift/api/hypershift/v1alpha1" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" ) // HostedClusterSpecApplyConfiguration represents an declarative configuration of the HostedClusterSpec type for use @@ -28,6 +29,7 @@ type HostedClusterSpecApplyConfiguration struct { Release *ReleaseApplyConfiguration `json:"release,omitempty"` ControlPlaneRelease *ReleaseApplyConfiguration `json:"controlPlaneRelease,omitempty"` ClusterID *string `json:"clusterID,omitempty"` + UpdateService *v1.URL `json:"updateService,omitempty"` Channel *string `json:"channel,omitempty"` InfraID *string `json:"infraID,omitempty"` Platform *PlatformSpecApplyConfiguration `json:"platform,omitempty"` @@ -38,14 +40,14 @@ type HostedClusterSpecApplyConfiguration struct { Autoscaling *ClusterAutoscalingApplyConfiguration `json:"autoscaling,omitempty"` Etcd *EtcdSpecApplyConfiguration `json:"etcd,omitempty"` Services []ServicePublishingStrategyMappingApplyConfiguration `json:"services,omitempty"` - PullSecret *v1.LocalObjectReference `json:"pullSecret,omitempty"` - SSHKey *v1.LocalObjectReference `json:"sshKey,omitempty"` + PullSecret *corev1.LocalObjectReference `json:"pullSecret,omitempty"` + SSHKey *corev1.LocalObjectReference `json:"sshKey,omitempty"` IssuerURL *string `json:"issuerURL,omitempty"` - ServiceAccountSigningKey *v1.LocalObjectReference `json:"serviceAccountSigningKey,omitempty"` + ServiceAccountSigningKey *corev1.LocalObjectReference `json:"serviceAccountSigningKey,omitempty"` Configuration *ClusterConfigurationApplyConfiguration `json:"configuration,omitempty"` - AuditWebhook *v1.LocalObjectReference `json:"auditWebhook,omitempty"` + AuditWebhook *corev1.LocalObjectReference `json:"auditWebhook,omitempty"` ImageContentSources []ImageContentSourceApplyConfiguration `json:"imageContentSources,omitempty"` - AdditionalTrustBundle *v1.LocalObjectReference `json:"additionalTrustBundle,omitempty"` + AdditionalTrustBundle *corev1.LocalObjectReference `json:"additionalTrustBundle,omitempty"` SecretEncryption *SecretEncryptionSpecApplyConfiguration `json:"secretEncryption,omitempty"` FIPS *bool `json:"fips,omitempty"` PausedUntil *string `json:"pausedUntil,omitempty"` @@ -83,6 +85,14 @@ func (b *HostedClusterSpecApplyConfiguration) WithClusterID(value string) *Hoste return b } +// WithUpdateService sets the UpdateService field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdateService field is set to the value of the last call. +func (b *HostedClusterSpecApplyConfiguration) WithUpdateService(value v1.URL) *HostedClusterSpecApplyConfiguration { + b.UpdateService = &value + return b +} + // WithChannel sets the Channel field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Channel field is set to the value of the last call. @@ -171,7 +181,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithServices(values ...*ServicePub // WithPullSecret sets the PullSecret field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PullSecret field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithPullSecret(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithPullSecret(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.PullSecret = &value return b } @@ -179,7 +189,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithPullSecret(value v1.LocalObjec // WithSSHKey sets the SSHKey field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SSHKey field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithSSHKey(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithSSHKey(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.SSHKey = &value return b } @@ -195,7 +205,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithIssuerURL(value string) *Hoste // WithServiceAccountSigningKey sets the ServiceAccountSigningKey field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceAccountSigningKey field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithServiceAccountSigningKey(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithServiceAccountSigningKey(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.ServiceAccountSigningKey = &value return b } @@ -211,7 +221,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithConfiguration(value *ClusterCo // WithAuditWebhook sets the AuditWebhook field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AuditWebhook field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithAuditWebhook(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithAuditWebhook(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.AuditWebhook = &value return b } @@ -232,7 +242,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithImageContentSources(values ... // WithAdditionalTrustBundle sets the AdditionalTrustBundle field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AdditionalTrustBundle field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithAdditionalTrustBundle(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithAdditionalTrustBundle(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.AdditionalTrustBundle = &value return b } diff --git a/client/applyconfiguration/hypershift/v1beta1/hostedclusterspec.go b/client/applyconfiguration/hypershift/v1beta1/hostedclusterspec.go index 818c1918341..b6e89b3408d 100644 --- a/client/applyconfiguration/hypershift/v1beta1/hostedclusterspec.go +++ b/client/applyconfiguration/hypershift/v1beta1/hostedclusterspec.go @@ -18,8 +18,9 @@ limitations under the License. package v1beta1 import ( + v1 "github.com/openshift/api/config/v1" hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" ) // HostedClusterSpecApplyConfiguration represents an declarative configuration of the HostedClusterSpec type for use @@ -28,6 +29,7 @@ type HostedClusterSpecApplyConfiguration struct { Release *ReleaseApplyConfiguration `json:"release,omitempty"` ControlPlaneRelease *ReleaseApplyConfiguration `json:"controlPlaneRelease,omitempty"` ClusterID *string `json:"clusterID,omitempty"` + UpdateService *v1.URL `json:"updateService,omitempty"` Channel *string `json:"channel,omitempty"` InfraID *string `json:"infraID,omitempty"` Platform *PlatformSpecApplyConfiguration `json:"platform,omitempty"` @@ -38,14 +40,14 @@ type HostedClusterSpecApplyConfiguration struct { Autoscaling *ClusterAutoscalingApplyConfiguration `json:"autoscaling,omitempty"` Etcd *EtcdSpecApplyConfiguration `json:"etcd,omitempty"` Services []ServicePublishingStrategyMappingApplyConfiguration `json:"services,omitempty"` - PullSecret *v1.LocalObjectReference `json:"pullSecret,omitempty"` - SSHKey *v1.LocalObjectReference `json:"sshKey,omitempty"` + PullSecret *corev1.LocalObjectReference `json:"pullSecret,omitempty"` + SSHKey *corev1.LocalObjectReference `json:"sshKey,omitempty"` IssuerURL *string `json:"issuerURL,omitempty"` - ServiceAccountSigningKey *v1.LocalObjectReference `json:"serviceAccountSigningKey,omitempty"` + ServiceAccountSigningKey *corev1.LocalObjectReference `json:"serviceAccountSigningKey,omitempty"` Configuration *ClusterConfigurationApplyConfiguration `json:"configuration,omitempty"` - AuditWebhook *v1.LocalObjectReference `json:"auditWebhook,omitempty"` + AuditWebhook *corev1.LocalObjectReference `json:"auditWebhook,omitempty"` ImageContentSources []ImageContentSourceApplyConfiguration `json:"imageContentSources,omitempty"` - AdditionalTrustBundle *v1.LocalObjectReference `json:"additionalTrustBundle,omitempty"` + AdditionalTrustBundle *corev1.LocalObjectReference `json:"additionalTrustBundle,omitempty"` SecretEncryption *SecretEncryptionSpecApplyConfiguration `json:"secretEncryption,omitempty"` FIPS *bool `json:"fips,omitempty"` PausedUntil *string `json:"pausedUntil,omitempty"` @@ -83,6 +85,14 @@ func (b *HostedClusterSpecApplyConfiguration) WithClusterID(value string) *Hoste return b } +// WithUpdateService sets the UpdateService field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdateService field is set to the value of the last call. +func (b *HostedClusterSpecApplyConfiguration) WithUpdateService(value v1.URL) *HostedClusterSpecApplyConfiguration { + b.UpdateService = &value + return b +} + // WithChannel sets the Channel field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Channel field is set to the value of the last call. @@ -171,7 +181,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithServices(values ...*ServicePub // WithPullSecret sets the PullSecret field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PullSecret field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithPullSecret(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithPullSecret(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.PullSecret = &value return b } @@ -179,7 +189,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithPullSecret(value v1.LocalObjec // WithSSHKey sets the SSHKey field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SSHKey field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithSSHKey(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithSSHKey(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.SSHKey = &value return b } @@ -195,7 +205,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithIssuerURL(value string) *Hoste // WithServiceAccountSigningKey sets the ServiceAccountSigningKey field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceAccountSigningKey field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithServiceAccountSigningKey(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithServiceAccountSigningKey(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.ServiceAccountSigningKey = &value return b } @@ -211,7 +221,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithConfiguration(value *ClusterCo // WithAuditWebhook sets the AuditWebhook field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AuditWebhook field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithAuditWebhook(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithAuditWebhook(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.AuditWebhook = &value return b } @@ -232,7 +242,7 @@ func (b *HostedClusterSpecApplyConfiguration) WithImageContentSources(values ... // WithAdditionalTrustBundle sets the AdditionalTrustBundle field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AdditionalTrustBundle field is set to the value of the last call. -func (b *HostedClusterSpecApplyConfiguration) WithAdditionalTrustBundle(value v1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { +func (b *HostedClusterSpecApplyConfiguration) WithAdditionalTrustBundle(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration { b.AdditionalTrustBundle = &value return b } diff --git a/client/applyconfiguration/hypershift/v1beta1/hostedcontrolplanespec.go b/client/applyconfiguration/hypershift/v1beta1/hostedcontrolplanespec.go index 98fa1c3d9ff..3fd545463c3 100644 --- a/client/applyconfiguration/hypershift/v1beta1/hostedcontrolplanespec.go +++ b/client/applyconfiguration/hypershift/v1beta1/hostedcontrolplanespec.go @@ -18,8 +18,9 @@ limitations under the License. package v1beta1 import ( + v1 "github.com/openshift/api/config/v1" hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" ) // HostedControlPlaneSpecApplyConfiguration represents an declarative configuration of the HostedControlPlaneSpec type for use @@ -27,26 +28,27 @@ import ( type HostedControlPlaneSpecApplyConfiguration struct { ReleaseImage *string `json:"releaseImage,omitempty"` ControlPlaneReleaseImage *string `json:"controlPlaneReleaseImage,omitempty"` + UpdateService *v1.URL `json:"updateService,omitempty"` Channel *string `json:"channel,omitempty"` - PullSecret *v1.LocalObjectReference `json:"pullSecret,omitempty"` + PullSecret *corev1.LocalObjectReference `json:"pullSecret,omitempty"` IssuerURL *string `json:"issuerURL,omitempty"` Networking *ClusterNetworkingApplyConfiguration `json:"networking,omitempty"` - SSHKey *v1.LocalObjectReference `json:"sshKey,omitempty"` + SSHKey *corev1.LocalObjectReference `json:"sshKey,omitempty"` ClusterID *string `json:"clusterID,omitempty"` InfraID *string `json:"infraID,omitempty"` Platform *PlatformSpecApplyConfiguration `json:"platform,omitempty"` DNS *DNSSpecApplyConfiguration `json:"dns,omitempty"` - ServiceAccountSigningKey *v1.LocalObjectReference `json:"serviceAccountSigningKey,omitempty"` + ServiceAccountSigningKey *corev1.LocalObjectReference `json:"serviceAccountSigningKey,omitempty"` ControllerAvailabilityPolicy *hypershiftv1beta1.AvailabilityPolicy `json:"controllerAvailabilityPolicy,omitempty"` InfrastructureAvailabilityPolicy *hypershiftv1beta1.AvailabilityPolicy `json:"infrastructureAvailabilityPolicy,omitempty"` FIPS *bool `json:"fips,omitempty"` KubeConfig *KubeconfigSecretRefApplyConfiguration `json:"kubeconfig,omitempty"` Services []ServicePublishingStrategyMappingApplyConfiguration `json:"services,omitempty"` - AuditWebhook *v1.LocalObjectReference `json:"auditWebhook,omitempty"` + AuditWebhook *corev1.LocalObjectReference `json:"auditWebhook,omitempty"` Etcd *EtcdSpecApplyConfiguration `json:"etcd,omitempty"` Configuration *ClusterConfigurationApplyConfiguration `json:"configuration,omitempty"` ImageContentSources []ImageContentSourceApplyConfiguration `json:"imageContentSources,omitempty"` - AdditionalTrustBundle *v1.LocalObjectReference `json:"additionalTrustBundle,omitempty"` + AdditionalTrustBundle *corev1.LocalObjectReference `json:"additionalTrustBundle,omitempty"` SecretEncryption *SecretEncryptionSpecApplyConfiguration `json:"secretEncryption,omitempty"` PausedUntil *string `json:"pausedUntil,omitempty"` OLMCatalogPlacement *hypershiftv1beta1.OLMCatalogPlacement `json:"olmCatalogPlacement,omitempty"` @@ -76,6 +78,14 @@ func (b *HostedControlPlaneSpecApplyConfiguration) WithControlPlaneReleaseImage( return b } +// WithUpdateService sets the UpdateService field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdateService field is set to the value of the last call. +func (b *HostedControlPlaneSpecApplyConfiguration) WithUpdateService(value v1.URL) *HostedControlPlaneSpecApplyConfiguration { + b.UpdateService = &value + return b +} + // WithChannel sets the Channel field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Channel field is set to the value of the last call. @@ -87,7 +97,7 @@ func (b *HostedControlPlaneSpecApplyConfiguration) WithChannel(value string) *Ho // WithPullSecret sets the PullSecret field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PullSecret field is set to the value of the last call. -func (b *HostedControlPlaneSpecApplyConfiguration) WithPullSecret(value v1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { +func (b *HostedControlPlaneSpecApplyConfiguration) WithPullSecret(value corev1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { b.PullSecret = &value return b } @@ -111,7 +121,7 @@ func (b *HostedControlPlaneSpecApplyConfiguration) WithNetworking(value *Cluster // WithSSHKey sets the SSHKey field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SSHKey field is set to the value of the last call. -func (b *HostedControlPlaneSpecApplyConfiguration) WithSSHKey(value v1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { +func (b *HostedControlPlaneSpecApplyConfiguration) WithSSHKey(value corev1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { b.SSHKey = &value return b } @@ -151,7 +161,7 @@ func (b *HostedControlPlaneSpecApplyConfiguration) WithDNS(value *DNSSpecApplyCo // WithServiceAccountSigningKey sets the ServiceAccountSigningKey field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceAccountSigningKey field is set to the value of the last call. -func (b *HostedControlPlaneSpecApplyConfiguration) WithServiceAccountSigningKey(value v1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { +func (b *HostedControlPlaneSpecApplyConfiguration) WithServiceAccountSigningKey(value corev1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { b.ServiceAccountSigningKey = &value return b } @@ -204,7 +214,7 @@ func (b *HostedControlPlaneSpecApplyConfiguration) WithServices(values ...*Servi // WithAuditWebhook sets the AuditWebhook field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AuditWebhook field is set to the value of the last call. -func (b *HostedControlPlaneSpecApplyConfiguration) WithAuditWebhook(value v1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { +func (b *HostedControlPlaneSpecApplyConfiguration) WithAuditWebhook(value corev1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { b.AuditWebhook = &value return b } @@ -241,7 +251,7 @@ func (b *HostedControlPlaneSpecApplyConfiguration) WithImageContentSources(value // WithAdditionalTrustBundle sets the AdditionalTrustBundle field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AdditionalTrustBundle field is set to the value of the last call. -func (b *HostedControlPlaneSpecApplyConfiguration) WithAdditionalTrustBundle(value v1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { +func (b *HostedControlPlaneSpecApplyConfiguration) WithAdditionalTrustBundle(value corev1.LocalObjectReference) *HostedControlPlaneSpecApplyConfiguration { b.AdditionalTrustBundle = &value return b } diff --git a/cmd/install/assets/hypershift-operator/hypershift.openshift.io_hostedclusters.yaml b/cmd/install/assets/hypershift-operator/hypershift.openshift.io_hostedclusters.yaml index 4f51b298648..aa659a26e49 100644 --- a/cmd/install/assets/hypershift-operator/hypershift.openshift.io_hostedclusters.yaml +++ b/cmd/install/assets/hypershift-operator/hypershift.openshift.io_hostedclusters.yaml @@ -3923,6 +3923,11 @@ spec: type: string type: object x-kubernetes-map-type: atomic + updateService: + description: |- + updateService may be used to specify the preferred upstream update service. + By default it will use the appropriate update service for the cluster and region. + type: string required: - networking - platform @@ -8220,6 +8225,11 @@ spec: type: string type: object x-kubernetes-map-type: atomic + updateService: + description: |- + updateService may be used to specify the preferred upstream update service. + By default it will use the appropriate update service for the cluster and region. + type: string required: - networking - platform diff --git a/cmd/install/assets/hypershift-operator/hypershift.openshift.io_hostedcontrolplanes.yaml b/cmd/install/assets/hypershift-operator/hypershift.openshift.io_hostedcontrolplanes.yaml index 577f54bd129..3fd048f44b0 100644 --- a/cmd/install/assets/hypershift-operator/hypershift.openshift.io_hostedcontrolplanes.yaml +++ b/cmd/install/assets/hypershift-operator/hypershift.openshift.io_hostedcontrolplanes.yaml @@ -3899,6 +3899,11 @@ spec: type: string type: object x-kubernetes-map-type: atomic + updateService: + description: |- + updateService may be used to specify the preferred upstream update service. + By default it will use the appropriate update service for the cluster and region. + type: string required: - dns - etcd @@ -8169,6 +8174,11 @@ spec: type: string type: object x-kubernetes-map-type: atomic + updateService: + description: |- + updateService may be used to specify the preferred upstream update service. + By default it will use the appropriate update service for the cluster and region. + type: string required: - dns - etcd diff --git a/control-plane-operator/controllers/hostedcontrolplane/cvo/reconcile.go b/control-plane-operator/controllers/hostedcontrolplane/cvo/reconcile.go index 769a5d30582..0a718addc1b 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/cvo/reconcile.go +++ b/control-plane-operator/controllers/hostedcontrolplane/cvo/reconcile.go @@ -19,6 +19,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" + configv1 "github.com/openshift/api/config/v1" "github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/kas" "github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/manifests" "github.com/openshift/hypershift/hypershift-operator/controllers/manifests/controlplaneoperator" @@ -113,7 +114,7 @@ func cvoLabels() map[string]string { var port int32 = 8443 -func ReconcileDeployment(deployment *appsv1.Deployment, ownerRef config.OwnerRef, deploymentConfig config.DeploymentConfig, controlPlaneImage, image, cliImage, availabilityProberImage, clusterID string, platformType hyperv1.PlatformType, oauthEnabled, enableCVOManagementClusterMetricsAccess bool) error { +func ReconcileDeployment(deployment *appsv1.Deployment, ownerRef config.OwnerRef, deploymentConfig config.DeploymentConfig, controlPlaneImage, image, cliImage, availabilityProberImage, clusterID string, updateService configv1.URL, platformType hyperv1.PlatformType, oauthEnabled, enableCVOManagementClusterMetricsAccess bool) error { ownerRef.ApplyTo(deployment) // preserve existing resource requirements for main CVO container @@ -140,7 +141,7 @@ func ReconcileDeployment(deployment *appsv1.Deployment, ownerRef config.OwnerRef util.BuildContainer(cvoContainerBootstrap(), buildCVOContainerBootstrap(cliImage, clusterID)), }, Containers: []corev1.Container{ - util.BuildContainer(cvoContainerMain(), buildCVOContainerMain(controlPlaneImage, image, deployment.Namespace, enableCVOManagementClusterMetricsAccess)), + util.BuildContainer(cvoContainerMain(), buildCVOContainerMain(controlPlaneImage, image, deployment.Namespace, updateService, enableCVOManagementClusterMetricsAccess)), }, Volumes: []corev1.Volume{ util.BuildVolume(cvoVolumePayload(), buildCVOVolumePayload), @@ -328,7 +329,7 @@ oc get clusterversion/version &> /dev/null || oc create -f /tmp/clusterversion.y return fmt.Sprintf(scriptTemplate, clusterID, payloadDir) } -func buildCVOContainerMain(image, releaseImage, namespace string, enableCVOManagementClusterMetricsAccess bool) func(c *corev1.Container) { +func buildCVOContainerMain(image, releaseImage, namespace string, updateService configv1.URL, enableCVOManagementClusterMetricsAccess bool) func(c *corev1.Container) { cpath := func(vol, file string) string { return path.Join(volumeMounts.Path(cvoContainerMain().Name, vol), file) } @@ -348,6 +349,9 @@ func buildCVOContainerMain(image, releaseImage, namespace string, enableCVOManag "--hypershift=true", "--v=4", } + if updateService != "" { + c.Args = append(c.Args, "--update-service", string(updateService)) + } if enableCVOManagementClusterMetricsAccess { c.Args = append(c.Args, "--use-dns-for-services=true") c.Args = append(c.Args, "--metrics-ca-bundle-file=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt") diff --git a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go index 7d37b729a41..ca52f0f40f9 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go +++ b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go @@ -3258,7 +3258,7 @@ func (r *HostedControlPlaneReconciler) reconcileClusterVersionOperator(ctx conte deployment := manifests.ClusterVersionOperatorDeployment(hcp.Namespace) if _, err := createOrUpdate(ctx, r, deployment, func() error { - return cvo.ReconcileDeployment(deployment, p.OwnerRef, p.DeploymentConfig, p.ControlPlaneImage, p.Image, p.CLIImage, p.AvailabilityProberImage, p.ClusterID, p.PlatformType, util.HCPOAuthEnabled(hcp), r.EnableCVOManagementClusterMetricsAccess) + return cvo.ReconcileDeployment(deployment, p.OwnerRef, p.DeploymentConfig, p.ControlPlaneImage, p.Image, p.CLIImage, p.AvailabilityProberImage, p.ClusterID, hcp.Spec.UpdateService, p.PlatformType, util.HCPOAuthEnabled(hcp), r.EnableCVOManagementClusterMetricsAccess) }); err != nil { return fmt.Errorf("failed to reconcile cluster version operator deployment: %w", err) } diff --git a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go index 3a9b3050fa1..eb4ca1a8a01 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go @@ -1087,7 +1087,7 @@ func (r *reconciler) reconcileClusterVersion(ctx context.Context, hcp *hyperv1.H if _, err := r.CreateOrUpdate(ctx, r.client, clusterVersion, func() error { clusterVersion.Spec.ClusterID = configv1.ClusterID(hcp.Spec.ClusterID) clusterVersion.Spec.Capabilities = nil - clusterVersion.Spec.Upstream = "" + clusterVersion.Spec.Upstream = hcp.Spec.UpdateService clusterVersion.Spec.Channel = hcp.Spec.Channel clusterVersion.Spec.DesiredUpdate = nil return nil diff --git a/docs/content/reference/api.md b/docs/content/reference/api.md index acf6bc78481..9de49d2a5a6 100644 --- a/docs/content/reference/api.md +++ b/docs/content/reference/api.md @@ -212,6 +212,21 @@ immutable.

+updateService
+ + +github.com/openshift/api/config/v1.URL + + + + +(Optional) +

updateService may be used to specify the preferred upstream update service. +By default it will use the appropriate update service for the cluster and region.

+ + + + channel
string @@ -3528,6 +3543,21 @@ immutable.

+updateService
+ + +github.com/openshift/api/config/v1.URL + + + + +(Optional) +

updateService may be used to specify the preferred upstream update service. +By default it will use the appropriate update service for the cluster and region.

+ + + + channel
string @@ -4046,6 +4076,21 @@ If not defined, ReleaseImage is used

+updateService
+ + +github.com/openshift/api/config/v1.URL + + + + +(Optional) +

updateService may be used to specify the preferred upstream update service. +By default it will use the appropriate update service for the cluster and region.

+ + + + channel
string diff --git a/hack/app-sre/saas_template.yaml b/hack/app-sre/saas_template.yaml index e3a1d74a867..b1087436495 100644 --- a/hack/app-sre/saas_template.yaml +++ b/hack/app-sre/saas_template.yaml @@ -41581,6 +41581,11 @@ objects: type: string type: object x-kubernetes-map-type: atomic + updateService: + description: |- + updateService may be used to specify the preferred upstream update service. + By default it will use the appropriate update service for the cluster and region. + type: string required: - networking - platform @@ -45895,6 +45900,11 @@ objects: type: string type: object x-kubernetes-map-type: atomic + updateService: + description: |- + updateService may be used to specify the preferred upstream update service. + By default it will use the appropriate update service for the cluster and region. + type: string required: - networking - platform @@ -50373,6 +50383,11 @@ objects: type: string type: object x-kubernetes-map-type: atomic + updateService: + description: |- + updateService may be used to specify the preferred upstream update service. + By default it will use the appropriate update service for the cluster and region. + type: string required: - dns - etcd @@ -54660,6 +54675,11 @@ objects: type: string type: object x-kubernetes-map-type: atomic + updateService: + description: |- + updateService may be used to specify the preferred upstream update service. + By default it will use the appropriate update service for the cluster and region. + type: string required: - dns - etcd diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go index 19f95aa3849..5daf0ac25fa 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -1814,6 +1814,7 @@ func reconcileHostedControlPlane(hcp *hyperv1.HostedControlPlane, hcluster *hype } } + hcp.Spec.UpdateService = hcluster.Spec.UpdateService hcp.Spec.Channel = hcluster.Spec.Channel hcp.Spec.ReleaseImage = hcluster.Spec.Release.Image if hcluster.Spec.ControlPlaneRelease != nil { diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1alpha1/hosted_controlplane.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1alpha1/hosted_controlplane.go index 7ed50dfb757..aa34f8143c2 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1alpha1/hosted_controlplane.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1alpha1/hosted_controlplane.go @@ -4,6 +4,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + + configv1 "github.com/openshift/api/config/v1" ) func init() { @@ -38,6 +40,12 @@ type HostedControlPlaneSpec struct { // If not defined, ReleaseImage is used ControlPlaneReleaseImage *string `json:"controlPlaneReleaseImage,omitempty"` + // updateService may be used to specify the preferred upstream update service. + // By default it will use the appropriate update service for the cluster and region. + // + // +optional + UpdateService configv1.URL `json:"updateService,omitempty"` + // 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. diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1alpha1/hostedcluster_types.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1alpha1/hostedcluster_types.go index 5631c5a1ccf..2b8e89782c0 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1alpha1/hostedcluster_types.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1alpha1/hostedcluster_types.go @@ -166,6 +166,12 @@ type HostedClusterSpec struct { // +optional ClusterID string `json:"clusterID,omitempty"` + // updateService may be used to specify the preferred upstream update service. + // By default it will use the appropriate update service for the cluster and region. + // + // +optional + UpdateService configv1.URL `json:"updateService,omitempty"` + // 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. diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hosted_controlplane.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hosted_controlplane.go index cae547eda73..754e6500459 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hosted_controlplane.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hosted_controlplane.go @@ -4,6 +4,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + + configv1 "github.com/openshift/api/config/v1" ) func init() { @@ -41,6 +43,12 @@ type HostedControlPlaneSpec struct { // If not defined, ReleaseImage is used ControlPlaneReleaseImage *string `json:"controlPlaneReleaseImage,omitempty"` + // updateService may be used to specify the preferred upstream update service. + // By default it will use the appropriate update service for the cluster and region. + // + // +optional + UpdateService configv1.URL `json:"updateService,omitempty"` + // 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. diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go index 2f7c5dbd831..7b976fffc55 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go @@ -309,6 +309,12 @@ type HostedClusterSpec struct { // +optional ClusterID string `json:"clusterID,omitempty"` + // updateService may be used to specify the preferred upstream update service. + // By default it will use the appropriate update service for the cluster and region. + // + // +optional + UpdateService configv1.URL `json:"updateService,omitempty"` + // 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.