diff --git a/.forgejo/workflows/schemas.yaml b/.forgejo/workflows/schemas.yaml index 9199e584..ec1d9abc 100644 --- a/.forgejo/workflows/schemas.yaml +++ b/.forgejo/workflows/schemas.yaml @@ -76,6 +76,7 @@ jobs: # Array creation failed, signal to skip organization by group ORGANIZE_BY_GROUP=false fi + # Extract CRDs from cluster NUM_OF_CRDS=0 while read -r crd @@ -89,15 +90,15 @@ jobs: # Save name and group for later directory organization CRD_GROUPS["$resourceKind"]="$resourceGroup" + echo CRD_GROUPS: ${CRD_GROUPS[@]} let ++NUM_OF_CRDS done < <(kubectl get crds 2>&1 | sed -n '/NAME/,$p' | tail -n +2) echo numCRDs: $NUM_OF_CRDS - - cd $SCHEMAS_DIR # Download converter script curl https://raw.githubusercontent.com/yannh/kubeconform/master/scripts/openapi2jsonschema.py --output $TMP_CRD_DIR/openapi2jsonschema.py 2>/dev/null + cd $SCHEMAS_DIR # Convert crds to jsonSchema python3 $TMP_CRD_DIR/openapi2jsonschema.py $TMP_CRD_DIR/*.yaml conversionResult=$? @@ -115,6 +116,7 @@ jobs: crdFileName=$(basename $schema .json) crdKind=${crdFileName%%_*} crdGroup=${CRD_GROUPS[$crdKind]} + echo making directory $crdGroup mkdir -p $crdGroup mv $schema ./$crdGroup done