Skip to content

Instantly share code, notes, and snippets.

@cdoan1
cdoan1 / gaps.md
Created September 16, 2026 20:23
gaps between test/e2e-cli (rosactl) and tests/e2e (rosa)

Test Case Comparison: test/e2e-cli vs ../rosa/tests/e2e

┌─────┬──────────────────────────────────────────────────────────────────────────┬─────────────────────────────────────┬────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────┬───────────────────────────────────────────────────────────────┐ │ # │ Test Case in test/e2e-cli │ Label │ Similar/Matching Test in ../rosa/tests/e2e │ File │ Notes │ ├─────┼──────────────────────────────────────────────────────────────────────────┼─────────────────────────────────────┼────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ │ 1 │ should be able to have help

@cdoan1
cdoan1 / README.md
Created September 9, 2026 00:45
Example
✗ export API_URL=https://5abcsz88t2.execute-api.us-east-1.amazonaws.com/prod
✗ ./rosa login --hyperfleet-url $API_URL
I: Logged in to Platform API: https://5abcsz88t2.execute-api.us-east-1.amazonaws.com/prod

✗ ./rosa list clusters
E: Failed to list clusters: AUTH-004: Account is not provisioned for ROSA authorization. Contact your administrator.

✗ ./rosa list clusters
I: No clusters available
#!/bin/bash
mask() {
local n=8 # number of chars to leave
local a="${1:0:${#1}-n}" # take all but the last n chars
local b="${1:${#1}-n}" # take the final n chars
printf "%s%s\n" "${a//?/*}" "$b" # substitute a with asterisks
}
#!/bin/bash
#
# use this script to force the certiifcate renew for the default ingress certificate of a hcp.
#
function convert() {
echo $(date -d "$1" "+%s")
}
function dlog() {
echo $(date -u +"%Y-%m-%d-%I:%M:%S") $1
}
#!/bin/bash
node=${1}
list=$(oc get hc -A --sort-by=.metadata.creationTimestamp -ojson \
| jq -r '.items[] | select(.metadata.name | contains("sdq")) | .metadata.name,.metadata.creationTimestamp,.metadata.namespace')
ma=($list)
for ((i=0;i<${#ma[@]};i+=3))
do
#!/bin/bash
oc patch mch multiclusterhub -n multicluster-hub --type=merge \
-p "{\"spec\":{\"overrides\":{\"components\":[{\"name\":\"cluster-backup\",\"enabled\":true}]}}}"
oc patch mce multiclusterengine -n multicluster-engine --type=merge \
-p "{\"spec\":{\"overrides\":{\"components\":[{\"name\":\"managedserviceaccount-preview\",\"enabled\":true}]}}}"
BACKUP_NS=openshift-velero
SECRET_NAME=velero-iam-credentials
@cdoan1
cdoan1 / rotate-certificate.sh
Created March 16, 2023 15:09
Roate Certificate
#!/bin/bash
function convert() {
echo $(date -d "$1" "+%s")
}
function dlog() {
echo $(date -u +"%Y-%m-%d-%I:%M:%S") $1
}
for certificate in $(oc get certificate -n default -o name)
+-----------------------+                  +-------------------+            +-------------------+       +--------------------+
|                       |                  |                   |            |                   |       |                    |
|                       |                  |                   |            |                   |       |                    |
|                       |                  |                   |            |                   |       |                    |
|                       |                  |                   |            |                   |       |                    |
|      Managed Cluster  --------------------      BIG IP       --------------       API         --------|         HUB        |
|                       |                  |      WAF          |            |       Gateway     |       |                    |
|                       |                  |                   |            |                   |       |                    |
# get CRD sorted
oc get crd -A --sort-by=.metadata.creationTimestamp
# inline template
oc get route keycloak --template "http://{{.spec.host}} "
# Enable DEX
@cdoan1
cdoan1 / monitor.sh
Created July 8, 2021 01:10
Monitor Proxy Settings
#!/bin/bash
oc get deployment \
| grep -v "NAME" \
| awk '{print $1}' \
| xargs -I % sh -c 'echo %; oc get deployment % -o yaml | grep "sre-registry"'
oc get deployment \
| grep -v "NAME" \
| awk '{print $1}' \