Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ConfigConnector CRDs to v1.127.0 #451

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sawadakaku
Copy link
Contributor

source crd files: https://github.com/GoogleCloudPlatform/k8s-config-connector/tree/v1.127.0/crds

PR Checklist

The extractor script is modified a bit to read local CRD files.

diff --git a/Utilities/crd-extractor.sh b/Utilities/crd-extractor.sh
index 3b6ce3b..4827b10 100755
--- a/Utilities/crd-extractor.sh
+++ b/Utilities/crd-extractor.sh
@@ -2,7 +2,7 @@

 fetch_crd() {
     filename=${1%% *}
-    kubectl get crds "$filename" -o yaml >"$TMP_CRD_DIR/$filename.yaml" 2>&1
+    cp "$CNRM_CRD_DIR/$filename" "$TMP_CRD_DIR/$filename" 2>&1
 }

 # Check if python3 is installed
@@ -48,6 +48,8 @@ if ! echo 'import yaml' | python3 &>/dev/null; then
     done
 fi

+CNRM_CRD_DIR=$(pwd)/../k8s-config-connector/crds
+
 # Create temp folder for CRDs
 TMP_CRD_DIR=$HOME/.datree/crds
 mkdir -p "$TMP_CRD_DIR"
@@ -59,7 +61,7 @@ cd "$SCHEMAS_DIR" || exit 1

 # Get a list of all CRDs
 printf "Fetching list of CRDs...\n"
-IFS=$'\n' read -r -d '' -a CRD_LIST < <(kubectl get crds 2>&1 | sed -n '/NAME/,$p' | tail -n +2 && printf '\0')
+IFS=$'\n' read -r -d '' -a CRD_LIST < <(ls ${CNRM_CRD_DIR} && printf '\0')

 # If no CRDs exist in the cluster, exit
 if [ ${#CRD_LIST[@]} == 0 ]; then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant