-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an initial StepAction for ephemeral cluster provisioning
Signed-off-by: Alex Misstear <[email protected]>
- Loading branch information
Showing
6 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
stepactions/get-supported-ephemeral-cluster-versions/0.1/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# get-supported-ephemeral-cluster-versions stepaction | ||
|
||
This StepAction queries the hub cluster used to provision ephemeral clusters for testing. It returns a list of supported versions stored in a hypershift ConfigMap. | ||
|
||
## Parameters | ||
|name|description|default value|required| | ||
|---|---|---|---| | ||
|kubeconfigSecretLabelSelector|A label selector used to identify the secret containing the EaaS hub cluster kubeconfig|toolchain.dev.openshift.com/spacerequest=eaas|false| | ||
|insecureSkipTLSVerify|Skip TLS verification when accessing the EaaS hub cluster|false|false| | ||
|
||
## Results | ||
|name|description| | ||
|---|---| | ||
|versions|List of supported minor versions from newest to oldest. E.g. ["4.15","4.14","4.13"]| | ||
|
42 changes: 42 additions & 0 deletions
42
...et-supported-ephemeral-cluster-versions/0.1/get-supported-ephemeral-cluster-versions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: StepAction | ||
metadata: | ||
name: get-supported-ephemeral-cluster-versions | ||
spec: | ||
description: >- | ||
This StepAction queries the hub cluster used to provision ephemeral clusters for testing. | ||
It returns a list of supported versions stored in a hypershift ConfigMap. | ||
image: quay.io/redhat-appstudio/appstudio-utils@sha256:586149e3f18d966f681d956ab074b4e1d8433663d615ed86e19a3804ba952dfe | ||
params: | ||
- name: kubeconfigSecretLabelSelector | ||
type: string | ||
default: toolchain.dev.openshift.com/spacerequest=eaas | ||
description: A label selector used to identify the secret containing the EaaS hub cluster kubeconfig | ||
- name: insecureSkipTLSVerify | ||
type: string | ||
default: "false" | ||
description: Skip TLS verification when accessing the EaaS hub cluster | ||
env: | ||
- name: LABEL_SELECTOR | ||
value: "$(params.kubeconfigSecretLabelSelector)" | ||
- name: INSECURE_SKIP_TLS_VERIFY | ||
value: "$(params.insecureSkipTLSVerify)" | ||
results: | ||
- name: versions | ||
type: array | ||
description: List of supported minor versions from newest to oldest. E.g. ["4.15","4.14","4.13"] | ||
script: | | ||
#!/bin/bash | ||
set -eo pipefail | ||
TMP_KUBECONFIG=$(mktemp) | ||
trap 'rm "$TMP_KUBECONFIG"' EXIT | ||
oc get secret -l $LABEL_SELECTOR -o jsonpath="{.items[0].data.kubeconfig}" | base64 -d > $TMP_KUBECONFIG | ||
OC=(oc --insecure-skip-tls-verify=$INSECURE_SKIP_TLS_VERIFY --kubeconfig=$TMP_KUBECONFIG) | ||
SV=$(${OC[*]} get configmap supported-versions -n hypershift -o=jsonpath='{.data.supported-versions}') | ||
VERSIONS=$(echo "$SV" | jq -c '.versions') | ||
echo "Supported versions: $VERSIONS" | ||
echo -n "$VERSIONS" > $(step.results.versions.path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# See the OWNERS docs: https://go.k8s.io/owners | ||
|
||
approvers: | ||
- amisstea | ||
- oamsalem | ||
- avi-biton | ||
- yftacherzog | ||
- hmariset |