-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
331 additions
and
116 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
2 changes: 2 additions & 0 deletions
2
ci-operator/step-registry/cucushift/hypershift-extended/capi/OWNERS
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
approvers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh | ||
reviewers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh |
2 changes: 2 additions & 0 deletions
2
ci-operator/step-registry/cucushift/hypershift-extended/capi/clear/OWNERS
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
approvers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh | ||
reviewers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh |
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
2 changes: 2 additions & 0 deletions
2
ci-operator/step-registry/cucushift/hypershift-extended/capi/deprovision/OWNERS
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
approvers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh | ||
reviewers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh |
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
8 changes: 8 additions & 0 deletions
8
ci-operator/step-registry/cucushift/hypershift-extended/capi/enable-hc/OWNERS
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 @@ | ||
approvers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh | ||
reviewers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh |
58 changes: 58 additions & 0 deletions
58
...pershift-extended/capi/enable-hc/cucushift-hypershift-extended-capi-enable-hc-commands.sh
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,58 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
export KUBECONFIG="${SHARED_DIR}/kubeconfig" | ||
if [[ -f "${SHARED_DIR}/mgmt_kubeconfig" ]]; then | ||
export KUBECONFIG="${SHARED_DIR}/mgmt_kubeconfig" | ||
fi | ||
|
||
# get cluster namesapce | ||
CLUSTER_NAME=$(cat "${SHARED_DIR}/cluster-name") | ||
if [[ -z "${CLUSTER_NAME}" ]] ; then | ||
echo "Error: cluster name not found" | ||
exit 1 | ||
fi | ||
|
||
read -r namespace _ _ <<< "$(oc get cluster -A | grep ${CLUSTER_NAME})" | ||
if [[ -z "${namespace}" ]]; then | ||
echo "Error: capi cluster name not found, ${CLUSTER_NAME}" | ||
exit 1 | ||
fi | ||
|
||
secret_name="${CLUSTER_NAME}-kubeconfig" | ||
if [[ "${ENABLE_EXTERNAL_OIDC}" == "true" ]]; then | ||
secret_name="${CLUSTER_NAME}-bootstrap-kubeconfig" | ||
fi | ||
|
||
max_retries=10 | ||
retry_delay=30 | ||
retries=0 | ||
secret="" | ||
while (( retries < max_retries )); do | ||
secret=$(oc get secret -n ${namespace} ${secret_name} --ignore-not-found -ojsonpath='{.data.value}') | ||
if [[ ! -z "$secret" ]]; then | ||
echo "find the secret ${secret_name} in ${namespace}" | ||
break | ||
fi | ||
|
||
retries=$(( retries + 1 )) | ||
if (( retries < max_retries )); then | ||
echo "Retrying in $retry_delay seconds..." | ||
sleep $retry_delay | ||
else | ||
oc get secret -n ${namespace} | ||
echo "capi kubeconfig not found, exit" | ||
exit 1 | ||
fi | ||
done | ||
|
||
if [[ ! -f "${SHARED_DIR}/mgmt_kubeconfig" ]] ; then | ||
mv $KUBECONFIG "${SHARED_DIR}/mgmt_kubeconfig" | ||
fi | ||
|
||
echo "${secret}" | base64 -d > "${SHARED_DIR}/kubeconfig" | ||
echo "hosted cluster kubeconfig is switched" | ||
oc whoami | ||
|
||
|
15 changes: 15 additions & 0 deletions
15
...ft-extended/capi/enable-hc/cucushift-hypershift-extended-capi-enable-hc-ref.metadata.json
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 @@ | ||
{ | ||
"path": "cucushift/hypershift-extended/capi/enable-hc/cucushift-hypershift-extended-capi-enable-hc-ref.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"LiangquanLi930", | ||
"heliubj18", | ||
"fxierh" | ||
], | ||
"reviewers": [ | ||
"LiangquanLi930", | ||
"heliubj18", | ||
"fxierh" | ||
] | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
.../hypershift-extended/capi/enable-hc/cucushift-hypershift-extended-capi-enable-hc-ref.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,19 @@ | ||
ref: | ||
as: cucushift-hypershift-extended-capi-enable-hc | ||
from_image: | ||
namespace: ocp | ||
name: "4.12" | ||
tag: upi-installer | ||
grace_period: 5m | ||
cli: latest | ||
commands: cucushift-hypershift-extended-capi-enable-hc-commands.sh | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
env: | ||
- name: ENABLE_EXTERNAL_OIDC | ||
default: "false" | ||
documentation: Enable external OIDC. | ||
documentation: |- | ||
prepare some resources to install capi and capa controllers |
2 changes: 2 additions & 0 deletions
2
ci-operator/step-registry/cucushift/hypershift-extended/capi/health-check/OWNERS
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
approvers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh | ||
reviewers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh |
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
2 changes: 2 additions & 0 deletions
2
ci-operator/step-registry/cucushift/hypershift-extended/capi/init/OWNERS
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
approvers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh | ||
reviewers: | ||
- LiangquanLi930 | ||
- heliubj18 | ||
- fxierh |
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
Oops, something went wrong.