Skip to content

Commit

Permalink
Fix k8s tests
Browse files Browse the repository at this point in the history
Update aks.sh

Fix

Fix configmap

More fixes
  • Loading branch information
zdrapela committed Dec 9, 2024
1 parent d961486 commit a1bc12f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .ibm/pipelines/jobs/aks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ handle_aks() {
az_aks_approuting_enable "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}"
az_aks_get_credentials "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}"

API_SERVER_URL=$(oc whoami --show-server)
ENCODED_API_SERVER_URL=$(echo "${API_SERVER_URL}" | base64)
ENCODED_CLUSTER_NAME=$(echo "my-cluster" | base64)

set_github_app_3_credentials

initiate_aks_deployment
check_and_test "${RELEASE_NAME}" "${NAME_SPACE_K8S}" "${url}"
delete_namespace "${NAME_SPACE_K8S}"
initiate_rbac_aks_deployment
check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC_K8S}"
check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC_K8S}" "${url}"
delete_namespace "${NAME_SPACE_RBAC_K8S}"
}

Expand Down
7 changes: 6 additions & 1 deletion .ibm/pipelines/jobs/gke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ handle_gke() {
export K8S_CLUSTER_ROUTER_BASE=$GKE_INSTANCE_DOMAIN_NAME
export NAME_SPACE_K8S="showcase-k8s-ci-nightly"
export NAME_SPACE_RBAC_K8S="showcase-rbac-k8s-ci-nightly"

url="https://${K8S_CLUSTER_ROUTER_BASE}"

gcloud_auth "${GKE_SERVICE_ACCOUNT_NAME}" "/tmp/secrets/GKE_SERVICE_ACCOUNT_KEY"
gcloud_gke_get_credentials "${GKE_CLUSTER_NAME}" "${GKE_CLUSTER_REGION}" "${GOOGLE_CLOUD_PROJECT}"

API_SERVER_URL=$(oc whoami --show-server)
ENCODED_API_SERVER_URL=$(echo "${API_SERVER_URL}" | base64)
ENCODED_CLUSTER_NAME=$(echo "my-cluster" | base64)

set_github_app_3_credentials

initiate_gke_deployment
check_and_test "${RELEASE_NAME}" "${NAME_SPACE_K8S}" "${url}"
delete_namespace "${NAME_SPACE_K8S}"
initiate_rbac_gke_deployment
check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC_K8S}"
check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC_K8S}" "${url}"
delete_namespace "${NAME_SPACE_RBAC_K8S}"

}
4 changes: 2 additions & 2 deletions .ibm/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export PS4='[$(date "+%Y-%m-%d %H:%M:%S")] ' # logs timestamp for every cmd.

LOGFILE="test-log"
export DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
secret_name="rhdh-k8s-plugin-secret"
export secret_name="rhdh-k8s-plugin-secret"
OVERALL_RESULT=0

cleanup() {
Expand Down Expand Up @@ -56,7 +56,7 @@ main() {
;;
*gke*)
echo "Calling handle_gke"
handle_gke
handle_gke
;;
*periodic*)
echo "Calling handle_periodic"
Expand Down
4 changes: 1 addition & 3 deletions .ibm/pipelines/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,4 @@ oc_login() {
oc login --token="${K8S_CLUSTER_TOKEN}" --server="${K8S_CLUSTER_URL}"
echo "OCP version: $(oc version)"
export K8S_CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//')
}


}

0 comments on commit a1bc12f

Please sign in to comment.