Skip to content

Commit

Permalink
udpate e2e using downstream images
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiwei Yin <[email protected]>
  • Loading branch information
zhiweiyin318 committed Dec 19, 2024
1 parent 066a27e commit 754f72f
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 56 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ ifeq ($(GOHOSTOS),darwin)
endif
endif

MCEVersion?="2.8"
Tag?=""

ImageCredentials?=""
UserName?=""
Password?=""

fmt:
go fmt ./test/e2e
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hack/e2e-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ######"
Expand Down
4 changes: 2 additions & 2 deletions hack/mce-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
101 changes: 100 additions & 1 deletion hack/mce-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,110 @@

{{/* 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 }}
{{- end }}
{{- 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 }}
40 changes: 15 additions & 25 deletions hack/mce-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions hack/mce-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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: ""
33 changes: 19 additions & 14 deletions test/configuration/mce-values.yaml
Original file line number Diff line number Diff line change
@@ -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: ""
12 changes: 6 additions & 6 deletions test/configuration/policy-values.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 754f72f

Please sign in to comment.