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

[WIP] [Test Automation] Automate E2E scenario with use of Operator for installation #1607

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ca87dbe
Added necessary files and configuration to the ci script to test the …
Omar-AlJaljuli Sep 11, 2024
55b7fb5
temporary additions to test CI on operator
Omar-AlJaljuli Sep 23, 2024
cb45596
fix small issue in non-rbac deployment
Omar-AlJaljuli Sep 23, 2024
0ce1fed
adding to the config to allow the operator tests to run
Omar-AlJaljuli Sep 24, 2024
8987750
fixing callback uri
Omar-AlJaljuli Sep 25, 2024
9a10bc5
add OCM cluster-role-binding to operator projects
Omar-AlJaljuli Oct 31, 2024
de9e68a
make the pod selector appropriate when testing operators with audit l…
Omar-AlJaljuli Oct 31, 2024
2d95e7e
ignore the auth tests for showcase-operator-nightly
Omar-AlJaljuli Nov 4, 2024
8f9fda0
update dyanmic plugins
Omar-AlJaljuli Nov 4, 2024
10ff1fa
fix dynamic plugins yaml spacing
Omar-AlJaljuli Nov 12, 2024
bc40857
temporarily disable acr config and test to pass
Omar-AlJaljuli Nov 12, 2024
03248bf
install podman and opm to properly install newest IIB and change rbac…
Omar-AlJaljuli Nov 13, 2024
82176b0
fix rebase mistakes
Omar-AlJaljuli Nov 18, 2024
b6d4a9f
edit to try new install-catalog-source script
Omar-AlJaljuli Nov 18, 2024
fbfaee0
return catalog sched frequency to 1
Omar-AlJaljuli Nov 18, 2024
7d2aba1
use flexible dynamic plugins configmap and run IIB script in debug mode
Omar-AlJaljuli Nov 19, 2024
25de826
fix rbac namespace name
Omar-AlJaljuli Nov 19, 2024
fb1a75b
fix rebase changes
Omar-AlJaljuli Nov 20, 2024
a2015db
Update install-catalog script name after merge
Omar-AlJaljuli Nov 22, 2024
6ada1aa
remove redundant dyanmic plugin configmaps to keep it flexible with m…
Omar-AlJaljuli Nov 22, 2024
36727d2
fix rbac configmap
Omar-AlJaljuli Nov 22, 2024
bb184a6
adding dynamic pluigns root PVC to operator
Omar-AlJaljuli Nov 26, 2024
f3d1731
add PVC file to rhdh-operator
Omar-AlJaljuli Nov 26, 2024
1ff43ad
upgrade Backstage api version for operator deployment
Omar-AlJaljuli Nov 26, 2024
2e27c9f
add redis cache deployment and delete rhdh-operator before installation
Omar-AlJaljuli Nov 27, 2024
56b261e
add patch to bypass volume node affinity issue
Omar-AlJaljuli Nov 28, 2024
bebd837
Added necessary files and configuration to the ci script to test the …
Omar-AlJaljuli Sep 11, 2024
10c3418
temporary additions to test CI on operator
Omar-AlJaljuli Sep 23, 2024
b8c8206
fix small issue in non-rbac deployment
Omar-AlJaljuli Sep 23, 2024
aa500bd
adding to the config to allow the operator tests to run
Omar-AlJaljuli Sep 24, 2024
02e19aa
fixing callback uri
Omar-AlJaljuli Sep 25, 2024
5632ae6
add OCM cluster-role-binding to operator projects
Omar-AlJaljuli Oct 31, 2024
c4f0564
make the pod selector appropriate when testing operators with audit l…
Omar-AlJaljuli Oct 31, 2024
275a2cb
ignore the auth tests for showcase-operator-nightly
Omar-AlJaljuli Nov 4, 2024
47ef707
update dyanmic plugins
Omar-AlJaljuli Nov 4, 2024
5185090
fix dynamic plugins yaml spacing
Omar-AlJaljuli Nov 12, 2024
82101a5
temporarily disable acr config and test to pass
Omar-AlJaljuli Nov 12, 2024
830c684
install podman and opm to properly install newest IIB and change rbac…
Omar-AlJaljuli Nov 13, 2024
ac813f2
fix rebase mistakes
Omar-AlJaljuli Nov 18, 2024
675ac63
edit to try new install-catalog-source script
Omar-AlJaljuli Nov 18, 2024
ba6f5dd
return catalog sched frequency to 1
Omar-AlJaljuli Nov 18, 2024
4ffc854
use flexible dynamic plugins configmap and run IIB script in debug mode
Omar-AlJaljuli Nov 19, 2024
57d6e4d
fix rbac namespace name
Omar-AlJaljuli Nov 19, 2024
3533c84
fix rebase changes
Omar-AlJaljuli Nov 20, 2024
b1357cc
Update install-catalog script name after merge
Omar-AlJaljuli Nov 22, 2024
d4cd371
remove redundant dyanmic plugin configmaps to keep it flexible with m…
Omar-AlJaljuli Nov 22, 2024
924a0ef
fix rbac configmap
Omar-AlJaljuli Nov 22, 2024
74093a1
adding dynamic pluigns root PVC to operator
Omar-AlJaljuli Nov 26, 2024
c4e2689
add PVC file to rhdh-operator
Omar-AlJaljuli Nov 26, 2024
d41781d
upgrade Backstage api version for operator deployment
Omar-AlJaljuli Nov 26, 2024
ced7a67
add redis cache deployment and delete rhdh-operator before installation
Omar-AlJaljuli Nov 27, 2024
5fc3277
add patch to bypass volume node affinity issue
Omar-AlJaljuli Nov 28, 2024
71e1dd1
remove operator deployment patches
Omar-AlJaljuli Dec 4, 2024
078c685
Merge branch 'RHIDP-2919' of github.com:Omar-AlJaljuli/janus-idp-back…
Omar-AlJaljuli Dec 4, 2024
43199b8
remove typo
Omar-AlJaljuli Dec 4, 2024
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
16 changes: 15 additions & 1 deletion .ibm/images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,19 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.
apt-get install google-cloud-cli google-cloud-sdk-gke-gcloud-auth-plugin -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Set working directory
# Install skopeo
RUN apt-get update -y && \
apt-get install -y skopeo

# Install umoci
RUN curl -LO "https://github.com/opencontainers/umoci/releases/download/v0.4.7/umoci.amd64" && \
chmod +x umoci.amd64 && \
mv umoci.amd64 /usr/local/bin/umoci

# Install opm
RUN curl -LO "https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/linux-amd64-opm" && \
chmod +x linux-amd64-opm && \
mv linux-amd64-opm /usr/local/bin/opm

# Set working directory
WORKDIR /tmp/
1 change: 1 addition & 0 deletions .ibm/pipelines/auth/secrets-rhdh-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ data:
DH_TARGET_URL: aHR0cDovL3Rlc3QtYmFja3N0YWdlLWN1c3RvbWl6YXRpb24tcHJvdmlkZXItc2hvd2Nhc2UtY2kucmhkaC1wci1vcy1hOTgwNTY1MDgzMGIyMmMzYWVlMjQzZTUxZDc5NTY1ZC0wMDAwLnVzLWVhc3QuY29udGFpbmVycy5hcHBkb21haW4uY2xvdWQ=
GOOGLE_CLIENT_ID: dGVtcA==
GOOGLE_CLIENT_SECRET: dGVtcA==
BASE_URL: dGVtcA==
type: Opaque
2 changes: 1 addition & 1 deletion .ibm/pipelines/env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ NAME_SPACE_RBAC="${NAME_SPACE_RBAC:-showcase-rbac}"
NAME_SPACE_RUNTIME="${NAME_SPACE_RUNTIME:-showcase-runtime}"
NAME_SPACE_POSTGRES_DB="${NAME_SPACE_POSTGRES_DB:-postgress-external-db}"
NAME_SPACE_RDS="showcase-rds-nightly"
OPERATOR_MANAGER='rhdh-operator'
CHART_VERSION="2.15.2"
GITHUB_APP_APP_ID=$(cat /tmp/secrets/GITHUB_APP_APP_ID)
GITHUB_APP_CLIENT_ID=$(cat /tmp/secrets/GITHUB_APP_CLIENT_ID)
Expand Down Expand Up @@ -52,7 +53,6 @@ GH_USER2_ID=$(cat /tmp/secrets/GH_USER2_ID)
GH_USER2_PASS=$(cat /tmp/secrets/GH_USER2_PASS)
GH_USER2_2FA_SECRET=$(cat /tmp/secrets/GH_USER2_2FA_SECRET)
GH_RHDH_QE_USER_TOKEN=$(cat /tmp/secrets/GH_RHDH_QE_USER_TOKEN)

GITLAB_TOKEN=$(cat /tmp/secrets/GITLAB_TOKEN)

RHDH_PR_OS_CLUSTER_URL=$(cat /tmp/secrets/RHDH_PR_OS_CLUSTER_URL)
Expand Down
73 changes: 69 additions & 4 deletions .ibm/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ configure_external_postgres_db() {
apply_yaml_files() {
local dir=$1
local project=$2
local release_name=$3
local base_url="https://${release_name}-backstage-${project}.${K8S_CLUSTER_ROUTER_BASE}"
if [[ "$JOB_NAME" == *aks* ]]; then
base_url="https://${K8S_CLUSTER_ROUTER_BASE}"
elif [[ "$JOB_NAME" == *operator* ]]; then
base_url="https://backstage-${release_name}-${project}.${K8S_CLUSTER_ROUTER_BASE}"
fi
local encoded_base_url="$(echo -n $base_url | base64 -w 0)"
echo "Applying YAML files to namespace ${project}"

oc config set-context --current --namespace="${project}"
Expand Down Expand Up @@ -230,6 +238,7 @@ apply_yaml_files() {
if [[ "$JOB_NAME" != *aks* ]]; then # Skip for AKS, because of strange `sed: -e expression #1, char 136: unterminated `s' command`
sed -i "s/K8S_CLUSTER_API_SERVER_URL:.*/K8S_CLUSTER_API_SERVER_URL: ${ENCODED_API_SERVER_URL}/g" "$dir/auth/secrets-rhdh-secrets.yaml"
fi
sed -i "s/BASE_URL:.*/BASE_URL: ${encoded_base_url}/g" "$dir/auth/secrets-rhdh-secrets.yaml"
sed -i "s/K8S_CLUSTER_NAME:.*/K8S_CLUSTER_NAME: ${ENCODED_CLUSTER_NAME}/g" "$dir/auth/secrets-rhdh-secrets.yaml"

set +x
Expand Down Expand Up @@ -306,6 +315,8 @@ check_backstage_running() {
local namespace=$2
if [[ "$JOB_NAME" == *aks* || "$JOB_NAME" == *gke* ]]; then
local url="https://${K8S_CLUSTER_ROUTER_BASE}"
elif [[ "$JOB_NAME" == *operator* ]]; then
local url="https://backstage-${release_name}-${namespace}.${K8S_CLUSTER_ROUTER_BASE}"
else
local url="https://${release_name}-backstage-${namespace}.${K8S_CLUSTER_ROUTER_BASE}"
fi
Expand Down Expand Up @@ -359,6 +370,34 @@ install_pipelines_operator() {
fi
}

install_rhdh_operator() {
local dir=$1
local namespace=$2

configure_namespace $namespace

# Make sure script is up to date
rm -f /tmp/install-rhdh-catalog-source.sh
curl -L https://raw.githubusercontent.com/redhat-developer/rhdh-operator/refs/heads/main/.rhdh/scripts/install-rhdh-catalog-source.sh > /tmp/install-rhdh-catalog-source.sh
chmod +x /tmp/install-rhdh-catalog-source.sh
bash -x /tmp/install-rhdh-catalog-source.sh --next --install-operator rhdh
}

deploy_rhdh_operator() {
local dir=$1
local namespace=$2

if [[ "${namespace}" == "showcase-op-rbac-nightly" ]]; then
oc apply -f "${dir}/resources/rhdh-operator/deployment/dynamic-plugins-root.yaml" -n "${namespace}"
oc apply -f "${dir}/resources/rhdh-operator/deployment/rhdh-start-rbac.yaml" -n "${namespace}"
# oc apply -f "${dir}/resources/rhdh-operator/patch/rhdh-patch-rbac.yaml" -n "${namespace}"
else
oc apply -f "${dir}/resources/rhdh-operator/deployment/dynamic-plugins-root.yaml" -n "${namespace}"
oc apply -f "${dir}/resources/rhdh-operator/deployment/rhdh-start.yaml" -n "${namespace}"
# oc apply -f "${dir}/resources/rhdh-operator/patch/rhdh-patch.yaml" -n "${namespace}"
fi
}

initiate_deployments() {

#install_pipelines_operator
Expand All @@ -373,7 +412,7 @@ initiate_deployments() {
oc apply -f "$DIR/resources/redis-cache/redis-deployment.yaml" --namespace="${NAME_SPACE}"

cd "${DIR}"
apply_yaml_files "${DIR}" "${NAME_SPACE}"
apply_yaml_files "${DIR}" "${NAME_SPACE}" "${RELEASE_NAME}"
echo "Deploying image from repository: ${QUAY_REPO}, TAG_NAME: ${TAG_NAME}, in NAME_SPACE: ${NAME_SPACE}"
helm upgrade -i "${RELEASE_NAME}" -n "${NAME_SPACE}" "${HELM_REPO_NAME}/${HELM_IMAGE_NAME}" --version "${CHART_VERSION}" -f "${DIR}/value_files/${HELM_CHART_VALUE_FILE_NAME}" --set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" --set upstream.backstage.image.repository="${QUAY_REPO}" --set upstream.backstage.image.tag="${TAG_NAME}"

Expand All @@ -382,7 +421,7 @@ initiate_deployments() {
configure_external_postgres_db "${NAME_SPACE_RBAC}"

uninstall_helmchart "${NAME_SPACE_RBAC}" "${RELEASE_NAME_RBAC}"
apply_yaml_files "${DIR}" "${NAME_SPACE_RBAC}"
apply_yaml_files "${DIR}" "${NAME_SPACE_RBAC}" "${RELEASE_NAME_RBAC}"
echo "Deploying image from repository: ${QUAY_REPO}, TAG_NAME: ${TAG_NAME}, in NAME_SPACE: ${RELEASE_NAME_RBAC}"
helm upgrade -i "${RELEASE_NAME_RBAC}" -n "${NAME_SPACE_RBAC}" "${HELM_REPO_NAME}/${HELM_IMAGE_NAME}" --version "${CHART_VERSION}" -f "${DIR}/value_files/${HELM_CHART_RBAC_VALUE_FILE_NAME}" --set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" --set upstream.backstage.image.repository="${QUAY_REPO}" --set upstream.backstage.image.tag="${TAG_NAME}"
}
Expand All @@ -401,6 +440,24 @@ initiate_rds_deployment() {
helm upgrade -i "${release_name}" -n "${namespace}" "${HELM_REPO_NAME}/${HELM_IMAGE_NAME}" --version "${CHART_VERSION}" -f "$DIR/resources/postgres-db/values-showcase-postgres.yaml" --set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" --set upstream.backstage.image.repository="${QUAY_REPO}" --set upstream.backstage.image.tag="${TAG_NAME}"
}

initiate_deployments_operator() {
configure_namespace "${OPERATOR_MANAGER}"
install_rhdh_operator "${DIR}" "${OPERATOR_MANAGER}"

configure_namespace "${NAME_SPACE}"
apply_yaml_files "${DIR}" "${NAME_SPACE}" "${RELEASE_NAME}"
create_dynamic_plugins_config "${DIR}/value_files/${HELM_CHART_VALUE_FILE_NAME}" "/tmp/configmap-dynamic-plugins.yaml"
oc apply -f /tmp/configmap-dynamic-plugins.yaml -n "${NAME_SPACE}"
oc apply -f "$DIR/resources/redis-cache/redis-deployment.yaml" --namespace="${NAME_SPACE}"
deploy_rhdh_operator "${DIR}" "${NAME_SPACE}"

configure_namespace "${NAME_SPACE_RBAC}"
apply_yaml_files "${DIR}" "${NAME_SPACE_RBAC}" "${RELEASE_NAME_RBAC}"
create_dynamic_plugins_config "${DIR}/value_files/${HELM_CHART_RBAC_VALUE_FILE_NAME}" "/tmp/configmap-dynamic-plugins-rbac.yaml"
oc apply -f /tmp/configmap-dynamic-plugins-rbac.yaml -n "${NAME_SPACE_RBAC}"
deploy_rhdh_operator "${DIR}" "${NAME_SPACE_RBAC}"
}

check_and_test() {
local release_name=$1
local namespace=$2
Expand Down Expand Up @@ -446,7 +503,11 @@ main() {
echo "Log file: ${LOGFILE}"
set_cluster_info
source "${DIR}/env_variables.sh"

############# REMOVE ONCE PR IS READY ############################
NAME_SPACE="showcase-operator-nightly"
NAME_SPACE_RBAC="showcase-op-rbac-nightly"
JOB_NAME=e2e-tests-operator-nightly
##################################################################
install_oc
if [[ "$JOB_NAME" == *aks* ]]; then
az_login
Expand Down Expand Up @@ -494,7 +555,11 @@ main() {
elif [[ "$JOB_NAME" == *auth-providers* ]]; then
run_tests "${AUTH_PROVIDERS_RELEASE}" "${AUTH_PROVIDERS_NAMESPACE}"
else
initiate_deployments
if [[ "$JOB_NAME" == *operator* ]]; then
initiate_deployments_operator
else
initiate_deployments
fi
check_and_test "${RELEASE_NAME}" "${NAME_SPACE}"
check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC}"
# Only test TLS config with RDS and Change configuration at runtime in nightly jobs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ subjects:
- kind: ServiceAccount
name: rhdh-k8s-plugin
namespace: showcase-pr-3
- kind: ServiceAccount
name: rhdh-k8s-plugin
namespace: showcase-operator-nightly
- kind: ServiceAccount
name: rhdh-k8s-plugin
namespace: showcase-op-rbac-nightly

4 changes: 4 additions & 0 deletions .ibm/pipelines/resources/config_map/app-config-rhdh-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
app:
baseUrl: ${BASE_URL}
title: Red Hat Developer Hub
backend:
baseUrl: ${BASE_URL}
cors:
origin: ${BASE_URL}
auth:
keys:
- secret: temp
Expand Down
4 changes: 4 additions & 0 deletions .ibm/pipelines/resources/config_map/app-config-rhdh.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
app:
baseUrl: ${BASE_URL}
title: Red Hat Developer Hub
branding:
fullLogo: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSLzIwMDEvUkVDLVNWRy0yMDAxMDkwNC9EVEQvc3ZnMTAuZHRkIj4KPCEtLSBDcmVhdGVkIHVzaW5nIEtyaXRhOiBodHRwczovL2tyaXRhLm9yZyAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIAogICAgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiCiAgICB4bWxuczprcml0YT0iaHR0cDovL2tyaXRhLm9yZy9uYW1lc3BhY2VzL3N2Zy9rcml0YSIKICAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgIHdpZHRoPSIxNjBwdCIKICAgIGhlaWdodD0iODBwdCIKICAgIHZpZXdCb3g9IjAgMCAxNjAgODAiPgo8ZGVmcy8+Cjx0ZXh0IGlkPSJzaGFwZTAiIGtyaXRhOnVzZVJpY2hUZXh0PSJ0cnVlIiB0ZXh0LXJlbmRlcmluZz0iYXV0byIga3JpdGE6dGV4dFZlcnNpb249IjMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0wLjE3NzMyMDYxNTAzNDE1NSwgNTQuMjYyNSkiIGZpbGw9IiNmZmZmZmYiIHN0cm9rZS1vcGFjaXR5PSIwIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMCIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgc3Ryb2tlLWxpbmVqb2luPSJiZXZlbCIgbGV0dGVyLXNwYWNpbmc9IjAiIHdvcmQtc3BhY2luZz0iMCIgc3R5bGU9InRleHQtYWxpZ246IHN0YXJ0O3RleHQtYWxpZ24tbGFzdDogYXV0bztmb250LWZhbWlseTogUmVkIEhhdCBEaXNwbGF5O2ZvbnQtc2l6ZTogNDA7Zm9udC13ZWlnaHQ6IDcwMDsiPjx0c3BhbiB4PSIwIj5RRTwvdHNwYW4+PC90ZXh0Pjx0ZXh0IGlkPSJzaGFwZTEiIGtyaXRhOnVzZVJpY2hUZXh0PSJ0cnVlIiB0ZXh0LXJlbmRlcmluZz0iYXV0byIga3JpdGE6dGV4dFZlcnNpb249IjMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDU3LjU2NDgyMDYxNTAzNDIsIDM1LjcyOTY4NzUpIiBmaWxsPSIjZmZmZmZmIiBzdHJva2Utb3BhY2l0eT0iMCIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjAiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIHN0cm9rZS1saW5lam9pbj0iYmV2ZWwiIGxldHRlci1zcGFjaW5nPSIwIiB3b3JkLXNwYWNpbmc9IjAiIHN0eWxlPSJ0ZXh0LWFsaWduOiBzdGFydDt0ZXh0LWFsaWduLWxhc3Q6IGF1dG87Zm9udC1mYW1pbHk6IFJlZCBIYXQgVGV4dDtmb250LXNpemU6IDE0O2ZvbnQtd2VpZ2h0OiA3MDA7Ij48dHNwYW4geD0iMCI+UmVkIEhhdDwvdHNwYW4+PHRzcGFuIHg9IjAiIGR5PSIxOC41MTU2MjUiPkRldmVsb3BlciBIdWI8L3RzcGFuPjwvdGV4dD4KPC9zdmc+Cg=="
Expand Down Expand Up @@ -53,6 +54,9 @@ dynamicPlugins:
title: Dark Dynamic
variant: dark
backend:
baseUrl: ${BASE_URL}
cors:
origin: ${BASE_URL}
auth:
keys:
- secret: temp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: dynamic-plugins-root
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
kind: Backstage
apiVersion: rhdh.redhat.com/v1alpha2
metadata:
name: rhdh-rbac
spec:
application:
image: 'quay.io/rhdh/rhdh-hub-rhel9:next'
appConfig:
configMaps:
- name: app-config-rhdh
mountPath: /opt/app-root/src
dynamicPluginsConfigMapName: dynamic-plugins
extraEnvs:
secrets:
- name: rhdh-secrets
extraFiles:
configMaps:
- name: rbac-policy
mountPath: /opt/app-root/src/rbac


16 changes: 16 additions & 0 deletions .ibm/pipelines/resources/rhdh-operator/deployment/rhdh-start.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
kind: Backstage
apiVersion: rhdh.redhat.com/v1alpha2
metadata:
name: rhdh
spec:
application:
image: 'quay.io/rhdh/rhdh-hub-rhel9:next'
appConfig:
configMaps:
- name: app-config-rhdh
mountPath: /opt/app-root/src
dynamicPluginsConfigMapName: dynamic-plugins
extraEnvs:
secrets:
- name: rhdh-secrets

15 changes: 15 additions & 0 deletions .ibm/pipelines/resources/rhdh-operator/patch/rhdh-patch-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rhdh.redhat.com/v1alpha2
kind: Backstage
metadata:
name: rhdh-rbac
spec:
deployment:
patch:
spec:
template:
spec:
volumes:
- $patch: replace
name: dynamic-plugins-root
persistentVolumeClaim:
claimName: dynamic-plugins-root
15 changes: 15 additions & 0 deletions .ibm/pipelines/resources/rhdh-operator/patch/rhdh-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rhdh.redhat.com/v1alpha2
kind: Backstage
metadata:
name: rhdh
spec:
deployment:
patch:
spec:
template:
spec:
volumes:
- $patch: replace
name: dynamic-plugins-root
persistentVolumeClaim:
claimName: dynamic-plugins-root
13 changes: 13 additions & 0 deletions .ibm/pipelines/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ yq_merge_value_files() {
' "${step_2_file}" "${step_1_file}" > "${final_file}"
}

# Uses the base YAML value file to create the dynamic plugins config map for the operator
create_dynamic_plugins_config() {
local base_file=$1
local final_file=$2
echo "kind: ConfigMap
apiVersion: v1
metadata:
name: dynamic-plugins
data:
dynamic-plugins.yaml: |" >> ${final_file}
yq '.global.dynamic' ${base_file} | sed -e 's/^/ /' >> ${final_file}
}

# Waits for a Kubernetes/OpenShift deployment to become ready within a specified timeout period
wait_for_deployment() {
local namespace=$1
Expand Down
2 changes: 2 additions & 0 deletions e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"showcase-rbac-k8s-ci-nightly": "playwright test --project=showcase-rbac-k8s",
"showcase-rds-nightly": "playwright test --project=postgres-health-check",
"showcase-runtime": "playwright test --project=showcase-runtime",
"showcase-operator-nightly": "playwright test --project=showcase-operator",
"showcase-op-rbac-nightly": "playwright test --project=showcase-operator-rbac",
"lint:check": "eslint . --ext .js,.ts",
"lint:fix": "eslint . --ext .js,.ts --fix",
"postinstall": "playwright install",
Expand Down
24 changes: 24 additions & 0 deletions e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ export default defineConfig({
"**/playwright/e2e/configuration-test/config-map.spec.ts",
],
},
{
name: "showcase-operator",
use: {
...devices["Desktop Chrome"],
viewport: { width: 1920, height: 1080 },
},
testIgnore: [
"**/playwright/e2e/plugins/rbac/**/*.spec.ts",
"**/playwright/e2e/plugins/analytics/analytics-disabled-rbac.spec.ts",
"**/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts",
"**/playwright/e2e/authProviders/**/*.spec.ts",
"**/playwright/e2e/plugins/bulk-import.spec.ts",
],
},
{
name: "showcase-rbac",
...useCommonDeviceAndViewportConfig,
Expand All @@ -65,6 +79,16 @@ export default defineConfig({
"**/playwright/e2e/plugins/bulk-import.spec.ts",
],
},
{
name: "showcase-operator-rbac",
...useCommonDeviceAndViewportConfig,
testMatch: [
"**/playwright/e2e/plugins/rbac/**/*.spec.ts",
"**/playwright/e2e/plugins/analytics/analytics-disabled-rbac.spec.ts",
"**/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts",
"**/playwright/e2e/plugins/bulk-import.spec.ts",
],
},
{
name: "showcase-auth-providers",
...useCommonDeviceAndViewportConfig,
Expand Down
7 changes: 5 additions & 2 deletions e2e-tests/playwright/e2e/audit-log/log-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class LogUtils {

/**
* Fetches the logs from pods that match the fixed pod selector and applies a grep filter.
* The pod selector is:
* The pod selector for showcase is:
* - app.kubernetes.io/component=backstage
* - app.kubernetes.io/instance=redhat-developer-hub
* - app.kubernetes.io/name=developer-hub
Expand All @@ -75,8 +75,11 @@ export class LogUtils {
* @returns A promise that resolves with the filtered logs
*/
static async getPodLogsWithGrep(filter: string): Promise<string> {
const podSelector =
let podSelector =
"app.kubernetes.io/component=backstage,app.kubernetes.io/instance=rhdh,app.kubernetes.io/name=backstage";
if (process.env.NAME_SPACE == "showcase-operator-nightly") {
podSelector = "rhdh.redhat.com/app=backstage-rhdh";
}
const tailNumber = 30;
const namespace = process.env.NAME_SPACE || "default";

Expand Down
Loading