diff --git a/pkg/hive/install.go b/pkg/hive/install.go index a391bb1c6e6..754847b0c0d 100644 --- a/pkg/hive/install.go +++ b/pkg/hive/install.go @@ -203,9 +203,9 @@ func (c *clusterManager) clusterDeploymentForInstall(doc *api.OpenShiftClusterDo Name: ClusterDeploymentName, Namespace: doc.OpenShiftCluster.Properties.HiveProfile.Namespace, Labels: map[string]string{ - "hive.openshift.io/cluster-platform": "azure", - "hive.openshift.io/cluster-region": doc.OpenShiftCluster.Location, - createdByHiveLabelKey: "true", + hiveClusterPlatformLabel: "azure", + hiveClusterRegionLabel: doc.OpenShiftCluster.Location, + createdByHiveLabelKey: "true", }, Annotations: map[string]string{ // https://github.com/openshift/hive/pull/2157 @@ -214,6 +214,10 @@ func (c *clusterManager) clusterDeploymentForInstall(doc *api.OpenShiftClusterDo // TODO: remove until we use a version of hive at minimal install "hive.openshift.io/cli-domain-from-installer-image": "true", + + // https://github.com/openshift/hive/pull/2501 + // Disable hibernation controller + hiveInfraDisabledAnnotation: "true", }, }, Spec: hivev1.ClusterDeploymentSpec{ diff --git a/pkg/hive/resources.go b/pkg/hive/resources.go index da871f64f0a..71351b1bf1a 100644 --- a/pkg/hive/resources.go +++ b/pkg/hive/resources.go @@ -29,6 +29,9 @@ const ( clusterManifestsSecretName = "cluster-manifests-secret" boundServiceAccountSigningKeySecretName = "bound-service-account-signing-key" boundServiceAccountSigningKeySecretKey = "bound-service-account-signing-key.key" + hiveClusterPlatformLabel = "hive.openshift.io/cluster-platform" + hiveClusterRegionLabel = "hive.openshift.io/cluster-region" + hiveInfraDisabledAnnotation = "hive.openshift.io/infra-disabled" ) var ( @@ -200,8 +203,13 @@ func adoptedClusterDeployment(namespace, clusterName, clusterID, infraID, resour Name: ClusterDeploymentName, Namespace: namespace, Labels: map[string]string{ - "hive.openshift.io/cluster-platform": "azure", - "hive.openshift.io/cluster-region": location, + hiveClusterPlatformLabel: "azure", + hiveClusterRegionLabel: location, + }, + Annotations: map[string]string{ + // https://github.com/openshift/hive/pull/2501 + // Disable hibernation controller as it is not used as part of ARO's Hive implementation + hiveInfraDisabledAnnotation: "true", }, }, Spec: hivev1.ClusterDeploymentSpec{ diff --git a/test/e2e/hive.go b/test/e2e/hive.go index 1d4227b4108..8048bb7faf6 100644 --- a/test/e2e/hive.go +++ b/test/e2e/hive.go @@ -20,8 +20,9 @@ import ( ) var ( - clusterPlatformLabelKey string = "hive.openshift.io/cluster-platform" - clusterRegionLabelKey string = "hive.openshift.io/cluster-region" + clusterPlatformLabelKey string = "hive.openshift.io/cluster-platform" + clusterRegionLabelKey string = "hive.openshift.io/cluster-region" + infraDisabledAnnotationKey string = "hive.openshift.io/infra-disabled" controlPlaneAPIURLOverride = func(clusterDomain string, clusterLocation string) string { if !strings.ContainsRune(clusterDomain, '.') { @@ -52,13 +53,14 @@ var _ = Describe("Hive-managed ARO cluster", func() { }, cd) Expect(err).NotTo(HaveOccurred()) - By("verifying that the ClusterDeployment object has the expected name and labels") + By("verifying that the ClusterDeployment object has the expected name, labels, and annotations") Expect(cd.ObjectMeta).NotTo(BeNil()) Expect(cd.ObjectMeta.Name).To(Equal(hive.ClusterDeploymentName)) Expect(cd.ObjectMeta.Labels).Should(HaveKey(clusterPlatformLabelKey)) Expect(cd.ObjectMeta.Labels[clusterPlatformLabelKey]).To(Equal("azure")) Expect(cd.ObjectMeta.Labels).Should(HaveKey(clusterRegionLabelKey)) Expect(cd.ObjectMeta.Labels[clusterRegionLabelKey]).To(Equal(adminAPICluster.Location)) + Expect(cd.ObjectMeta.Annotations[infraDisabledAnnotationKey]).To(Equal("true")) By("verifying that the ClusterDeployment object spec correctly includes the ARO cluster's Azure region and RG name") Expect(cd.Spec).NotTo(BeNil())