diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index eb69b5e..a3af9b7 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -63,8 +63,9 @@ jobs: run: | make e2e-install env: - KUBECONFIG: /home/runner/.kube/hub-kubeconfig - + KUBECONFIG: /home/runner/.kube/hub-kubeconfig + USERNAME: ${{ secrets.IMAGE_PULL_SECRET_USER_NAME }} + TOKEN: ${{ secrets.IMAGE_PULL_SECRET_TOKEN }} - name: Import hosted cluster run: | make e2e-import-cluster diff --git a/Makefile b/Makefile index fc1bf9c..bba9092 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,12 @@ ifeq ($(GOHOSTOS),darwin) endif endif +MCEVersion?="2.8" +Tag?="" + ImageCredentials?="" +UserName?="" +Password?="" fmt: go fmt ./test/e2e @@ -36,13 +41,13 @@ update: fmt hack/update.sh install-mce: ensure-helm - $(HELM) upgrade --install mce ./hack/mce-chart --set-file images.imageCredentials.dockerConfigJson=$(ImageCredentials) + $(HELM) upgrade --install mce ./hack/mce-chart --set mceVersion=$(MCEVersion),images.tag=$(Tag) --set-file images.imageCredentials.dockerConfigJson=$(ImageCredentials) install-policy: ensure-helm $(HELM) upgrade --install policy ./policy install-e2e-mce: ensure-helm - $(HELM) upgrade --install mce ./hack/mce-chart -f ./test/configuration/mce-values.yaml + $(HELM) upgrade --install mce ./hack/mce-chart -f ./test/configuration/mce-values.yaml --set mceVersion=$(MCEVersion),images.tag=$(Tag),images.imageCredentials.userName=$(UserName),images.imageCredentials.password=$(Password) install-e2e-policy: ensure-helm $(HELM) upgrade --install policy ./policy -f ./test/configuration/policy-values.yaml diff --git a/hack/e2e-install.sh b/hack/e2e-install.sh index 80b6e9f..b5624e1 100755 --- a/hack/e2e-install.sh +++ b/hack/e2e-install.sh @@ -42,7 +42,7 @@ function waitForReady() { echo "" echo "#### Install MCE on Hub cluster ####" -make install-e2e-mce +UserName=$USERNAME Password=$TOKEN make install-e2e-mce echo "" echo "###### Wait until MCE pod is running ######" diff --git a/hack/mce-chart/Chart.yaml b/hack/mce-chart/Chart.yaml index 8515cde..22eed6f 100644 --- a/hack/mce-chart/Chart.yaml +++ b/hack/mce-chart/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 name: mce description: A Helm chart for MCE -version: 2.7.0 -appVersion: 2.7.0 +version: 1.0.0 +appVersion: 1.0.0 diff --git a/hack/mce-chart/templates/_helpers.tpl b/hack/mce-chart/templates/_helpers.tpl index 3665c78..77744e1 100644 --- a/hack/mce-chart/templates/_helpers.tpl +++ b/hack/mce-chart/templates/_helpers.tpl @@ -1,7 +1,10 @@ + {{/* Create secret to access docker registry */}} {{- define "imagePullSecret" }} {{- with .Values.images }} -{{- if .imageCredentials.dockerConfigJson }} +{{- if and .imageCredentials.userName .imageCredentials.password }} +{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .imageCredentials.registry (printf "%s:%s" .imageCredentials.userName .imageCredentials.password | b64enc) | b64enc }} +{{- else if .imageCredentials.dockerConfigJson }} {{- printf "%s" .imageCredentials.dockerConfigJson | b64enc }} {{- else }} {{- printf "{}" | b64enc }} @@ -9,3 +12,99 @@ {{- end }} {{- end }} + +{{- define "backplaneOperatorImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/backplane-rhel9-operator:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.backplane_operator }} +{{- end }} +{{- end }} + +{{- define "registrationOperatorImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/registration-operator-rhel9:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.registration_operator }} +{{- end }} +{{- end }} + +{{- define "hypershiftAddonOperatorImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/hypershift-addon-rhel9-operator:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.hypershift_addon_operator }} +{{- end }} +{{- end }} + +{{- define "hypershiftOperatorImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/hypershift-rhel9-operator:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.hypershift_operator }} +{{- end }} +{{- end }} + +{{- define "managedclusterImportControllerImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/managedcluster-import-controller-rhel9:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.managedcluster_import_controller }} +{{- end }} +{{- end }} + +{{- define "multicloudManagerImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/multicloud-manager-rhel9:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.multicloud_manager }} +{{- end }} +{{- end }} + +{{- define "addonManagerImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/addon-manager-rhel9:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.addon_manager }} +{{- end }} +{{- end }} + +{{- define "workImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/work-rhel9:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.work }} +{{- end }} +{{- end }} + +{{- define "registrationImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/registration-rhel9:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.registration }} +{{- end }} +{{- end }} + +{{- define "placementImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/placement-rhel9:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.placement }} +{{- end }} +{{- end }} + +{{- define "kubeRbacProxyMceImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/kube-rbac-proxy-mce-rhel9:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.kube_rbac_proxy_mce }} +{{- end }} +{{- end }} + +{{- define "clusterlifecycleStateMetricsImage" }} +{{- if and .Values.images.registry .Values.images.tag }} +{{- printf "%s/clusterlifecycle-state-metrics-rhel9:%s" .Values.images.registry .Values.images.tag }} +{{- else }} +{{- printf "%s" .Values.images.overrides.clusterlifecycle_state_metrics }} +{{- end }} +{{- end }} diff --git a/hack/mce-chart/templates/deployment.yaml b/hack/mce-chart/templates/deployment.yaml index a0f043e..dc6f72c 100644 --- a/hack/mce-chart/templates/deployment.yaml +++ b/hack/mce-chart/templates/deployment.yaml @@ -114,46 +114,36 @@ spec: - name: OPERAND_IMAGE_HYPERSHIFT_ADDON_OPERATOR_CANARY_TEST value: quay.io/stolostron/hypershift-addon-operator-canary-test@sha256 - name: OPERAND_IMAGE_HYPERSHIFT_OPERATOR - value: {{ .Values.images.overrides.hypershift_operator }} - - name: OPERAND_IMAGE_IMAGE_BASED_INSTALL_OPERATOR - value: quay.io/stolostron/image-based-install-operator@sha256 - - name: OPERAND_IMAGE_MANAGED_SERVICEACCOUNT - value: quay.io/stolostron/managed-serviceaccount@sha256 - - name: OPERAND_IMAGE_MANAGED_SERVICEACCOUNT_E2E - value: quay.io/stolostron/managed-serviceaccount-e2e@sha256 - - name: OPERAND_IMAGE_POSTGRESQL_12 - value: quay.io/stolostron/postgresql-12-centos7@sha256 - - name: OPERAND_IMAGE_PROVIDER_CREDENTIAL_CONTROLLER - value: quay.io/stolostron/provider-credential-controller@sha256 + value: {{ template "hypershiftOperatorImage" . }} - name: OPERAND_IMAGE_ADDON_MANAGER - value: {{ .Values.images.overrides.addon_manager }} + value: {{ template "addonManagerImage" . }} - name: OPERAND_IMAGE_BACKPLANE_OPERATOR - value: {{ .Values.images.overrides.backplane_operator }} + value: {{ template "backplaneOperatorImage" . }} - name: OPERAND_IMAGE_HYPERSHIFT_ADDON_OPERATOR - value: {{ .Values.images.overrides.hypershift_addon_operator }} + value: {{ template "hypershiftAddonOperatorImage" . }} - name: OPERAND_IMAGE_MANAGEDCLUSTER_IMPORT_CONTROLLER - value: {{ .Values.images.overrides.managedcluster_import_controller }} + value: {{ template "managedclusterImportControllerImage" . }} - name: OPERAND_IMAGE_MULTICLOUD_MANAGER - value: {{ .Values.images.overrides.multicloud_manager }} + value: {{ template "multicloudManagerImage" . }} - name: OPERAND_IMAGE_PLACEMENT - value: {{ .Values.images.overrides.placement }} + value: {{ template "placementImage" . }} - name: OPERAND_IMAGE_REGISTRATION - value: {{ .Values.images.overrides.registration }} + value: {{ template "registrationImage" . }} - name: OPERAND_IMAGE_REGISTRATION_OPERATOR - value: {{ .Values.images.overrides.registration_operator }} + value: {{ template "registrationOperatorImage" . }} - name: OPERAND_IMAGE_WORK - value: {{ .Values.images.overrides.work }} + value: {{ template "workImage" . }} - name: OPERAND_IMAGE_KUBE_RBAC_PROXY_MCE - value: {{ .Values.images.overrides.kube_rbac_proxy_mce }} + value: {{ template "kubeRbacProxyMceImage" . }} - name: OPERAND_IMAGE_CLUSTERLIFECYCLE_STATE_METRICS - value: {{ .Values.images.overrides.clusterlifecycle_state_metrics }} + value: {{ template "clusterlifecycleStateMetricsImage" . }} - name: OPERATOR_VERSION - value: {{ .Chart.AppVersion }} + value: "{{ .Values.mceVersion }}" - name: OPERATOR_PACKAGE value: multicluster-engine - name: OPERATOR_CONDITION_NAME - value: multicluster-engine.v{{ .Chart.AppVersion }} - image: {{ .Values.images.overrides.backplane_operator }} + value: multicluster-engine.v{{ .Values.mceVersion }} + image: "{{ template "backplaneOperatorImage" . }}" imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 3 diff --git a/hack/mce-chart/values.yaml b/hack/mce-chart/values.yaml index 220c41f..1727427 100644 --- a/hack/mce-chart/values.yaml +++ b/hack/mce-chart/values.yaml @@ -1,7 +1,9 @@ - -replicaCount: 2 -availabilityConfig: High +mceVersion: 2.8 +replicaCount: 1 +availabilityConfig: Basic images: + registry: "" + tag: "" overrides: backplane_operator: "registry.redhat.io/multicluster-engine/backplane-rhel9-operator@sha256:8c2f526398df56f92bfc62af8e42c3e373c236ab67e58e877cf9690fc480d46a" registration_operator: "registry.redhat.io/multicluster-engine/registration-operator-rhel9@sha256:8a37700e9848830dca9a3eebd4c8ca6abd7b04dc28ab5cefd743d00dd58be92a" @@ -17,3 +19,6 @@ images: clusterlifecycle_state_metrics: "registry.redhat.io/multicluster-engine/clusterlifecycle-state-metrics-rhel9@sha256:bf5bb514e4d8af5e38317c3727d4cd9f90c22b293fe3e2367f9f0e179e0ee0c7" imageCredentials: dockerConfigJson: "" + registry: "quay.io" + userName: "" + password: "" \ No newline at end of file diff --git a/test/configuration/mce-values.yaml b/test/configuration/mce-values.yaml index 4dcd777..e805a6f 100644 --- a/test/configuration/mce-values.yaml +++ b/test/configuration/mce-values.yaml @@ -1,21 +1,26 @@ - +mceVersion: 2.8 replicaCount: 1 availabilityConfig: Basic images: + registry: "" + tag: "" overrides: - backplane_operator: "quay.io/stolostron/backplane-operator:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - registration_operator: "quay.io/stolostron/registration-operator:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - hypershift_addon_operator: "quay.io/stolostron/hypershift-addon-operator:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - hypershift_operator: "quay.io/acm-d/hypershift-rhel9-operator:v2.8.0-4" - managedcluster_import_controller: "quay.io/stolostron/managedcluster-import-controller:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - multicloud_manager: "quay.io/stolostron/multicloud-manager:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - addon_manager: "quay.io/stolostron/addon-manager:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - work: "quay.io/stolostron/work:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - registration: "quay.io/stolostron/registration:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - placement: "quay.io/stolostron/placement:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - kube_rbac_proxy_mce: "quay.io/stolostron/kube-rbac-proxy-mce:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - clusterlifecycle_state_metrics: "quay.io/stolostron/clusterlifecycle-state-metrics:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - + backplane_operator: "quay.io/acm-d/backplane-rhel9-operator:v2.8.0-13" + registration_operator: "quay.io/acm-d/registration-operator-rhel9:v2.8.0-13" + hypershift_addon_operator: "quay.io/acm-d/hypershift-addon-rhel9-operator:v2.8.0-5" + hypershift_operator: "quay.io/acm-d/hypershift-rhel9-operator:v2.8.0-14" + managedcluster_import_controller: "quay.io/acm-d/managedcluster-import-controller-rhel9:v2.8.0-13" + multicloud_manager: "quay.io/acm-d/multicloud-manager-rhel9:v2.8.0-9" + addon_manager: "quay.io/acm-d/addon-manager-rhel9:v2.8.0-13" + work: "quay.io/acm-d/work-rhel9:v2.8.0-13" + registration: "quay.io/acm-d/registration-rhel9:v2.8.0-13" + placement: "quay.io/acm-d/placement-rhel9:v2.8.0-13" + kube_rbac_proxy_mce: "quay.io/acm-d/kube-rbac-proxy-mce-rhel9:v2.8.0-13" + clusterlifecycle_state_metrics: "quay.io/acm-d/clusterlifecycle-state-metrics-rhel9:v2.8.0-10" + imageCredentials: dockerConfigJson: "" + registry: "quay.io" + userName: "" + password: "" \ No newline at end of file diff --git a/test/configuration/policy-values.yaml b/test/configuration/policy-values.yaml index ce90c92..bcae3d6 100644 --- a/test/configuration/policy-values.yaml +++ b/test/configuration/policy-values.yaml @@ -1,14 +1,14 @@ global: - registryOverride: "quay.io/stolostron" + registryOverride: "quay.io/acm-d" # registry for ACM 2.11.2 # registryOverride: "registry.redhat.io" imageOverrides: # upstream images - governance_policy_propagator: "governance-policy-propagator:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - governance_policy_addon_controller: "governance-policy-addon-controller:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - config_policy_controller: "config-policy-controller:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - governance_policy_framework_addon: "governance-policy-framework-addon:2.13.0-SNAPSHOT-2024-11-26-00-59-13" - klusterlet_addon_controller: "klusterlet-addon-controller:2.13.0-SNAPSHOT-2024-11-26-00-59-13" + governance_policy_propagator: "governance-policy-propagator-rhel9:v2.13.0-11" + governance_policy_addon_controller: "acm-governance-policy-addon-controller-rhel9:v2.13.0-12" + config_policy_controller: "config-policy-controller-rhel9:v2.13.0-14" + governance_policy_framework_addon: "acm-governance-policy-framework-addon-rhel9:v2.13.0-11" + klusterlet_addon_controller: "klusterlet-addon-controller-rhel9:v2.13.0-8" namespace: multicluster-engine pullSecret: open-cluster-management-image-pull-credentials