From f6f1da32dc74237a1e3f1b4010984790cdbd07dc Mon Sep 17 00:00:00 2001 From: jfula Date: Tue, 19 Nov 2024 09:46:22 +0100 Subject: [PATCH 1/2] Adding consoleURL to results of get credentials and updating readme --- .../eaas-get-ephemeral-cluster-credentials/0.1/README.md | 4 ++++ .../0.1/eaas-get-ephemeral-cluster-credentials.yaml | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/README.md b/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/README.md index b4efdc9eb..fe1a1d827 100644 --- a/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/README.md +++ b/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/README.md @@ -14,4 +14,8 @@ This StepAction queries the EaaS hub cluster to get the kubeconfig for an epheme |name|description| |---|---| |kubeconfig|Relative path to the kubeconfig in the mounted volume| +|username|The username for the cluster| +|passwordPath|Relative path to the password file in the mounted volume| +|apiServerURL|API server URL of the cluster| +|consoleURL|Console URL of the cluster| diff --git a/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml b/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml index 527521099..adb38557d 100644 --- a/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml +++ b/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml @@ -32,6 +32,8 @@ spec: description: Relative path to the password file in the mounted volume - name: apiServerURL description: API server URL of the cluster + - name: consoleURL + description: Console URL of the cluster env: - name: CLUSTER_NAME value: "$(params.clusterName)" @@ -76,3 +78,6 @@ spec: API_SERVER_URL=$("${OC[@]}" get cti "$CLUSTER_NAME" -o=jsonpath='{.status.apiServerURL}') echo "API Server URL: $API_SERVER_URL" echo -n "$API_SERVER_URL" > "$(step.results.apiServerURL.path)" + CONSOLE_URL=https://$("${OC[@]}" get route console -n openshift-console -o go-template --template="{{.spec.host}}") + echo "Console URL: $CONSOLE_URL" + echo -n "$CONSOLE_URL" > "$(step.results.consoleURL.path)" \ No newline at end of file From 390b60d11560df2226d377acad49a5b3eace71cb Mon Sep 17 00:00:00 2001 From: jfula Date: Tue, 19 Nov 2024 16:05:19 +0100 Subject: [PATCH 2/2] exporting kubeconfig to set ephemeral cluster as context for oc --- .../0.1/eaas-get-ephemeral-cluster-credentials.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml b/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml index adb38557d..422834558 100644 --- a/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml +++ b/stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml @@ -78,6 +78,7 @@ spec: API_SERVER_URL=$("${OC[@]}" get cti "$CLUSTER_NAME" -o=jsonpath='{.status.apiServerURL}') echo "API Server URL: $API_SERVER_URL" echo -n "$API_SERVER_URL" > "$(step.results.apiServerURL.path)" - CONSOLE_URL=https://$("${OC[@]}" get route console -n openshift-console -o go-template --template="{{.spec.host}}") + export KUBECONFIG=$CLUSTER_KUBECONFIG + CONSOLE_URL=https://$(oc get route console -n openshift-console -o go-template --template="{{.spec.host}}") echo "Console URL: $CONSOLE_URL" echo -n "$CONSOLE_URL" > "$(step.results.consoleURL.path)" \ No newline at end of file