Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disable-infra annotation to hive clusterdeployments #3985

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/hive/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
"hive.openshift.io/infra-disabled": "true",
},
},
Spec: hivev1.ClusterDeploymentSpec{
Expand Down
5 changes: 5 additions & 0 deletions pkg/hive/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@
ObjectMeta: metav1.ObjectMeta{
Name: ClusterDeploymentName,
Namespace: namespace,
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

Check failure on line 198 in pkg/hive/resources.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
"hive.openshift.io/infra-disabled": "true",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nit: we could make a const for this in pkg/hive since it's used in two places.

},
},
Spec: hivev1.ClusterDeploymentSpec{
BaseDomain: "",
Expand Down
8 changes: 5 additions & 3 deletions test/e2e/hive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, '.') {
Expand Down Expand Up @@ -53,13 +54,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())
Expand Down
Loading