Skip to content

Commit

Permalink
fix utility output
Browse files Browse the repository at this point in the history
  • Loading branch information
hadar-co committed May 18, 2022
1 parent 9e42b37 commit 7e89bde
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# by deafult
# by default
@datreeio/product
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

# Check if python3 is installed
if ! command -v python3 &> /dev/null; then
printf "python3 is required for this plugin, and is not installed on your machine"
printf "please visit https://www.python.org/downloads/ and install it"
printf "python3 is required for this utility, and is not installed on your machine"
printf "please visit https://www.python.org/downloads/ to install it"
exit 1
fi
# Check if kubectl is installed
if ! command -v python3 &> /dev/null; then
printf "kubectl is required for this utility, and is not installed on your machine"
printf "please visit https://kubernetes.io/docs/tasks/tools/#kubectl to install it"
exit 1
fi

Expand Down Expand Up @@ -33,9 +39,10 @@ python3 $TMP_CRD_DIR/openapi2jsonschema.py $TMP_CRD_DIR/*.yaml

if [ $? == 0 ]; then
printf "Successfully converted $NUM_OF_CRDS CRDs to JSON schema\n"
printf "To execute a Datree policy check against your CRs - run 'datree test --schema-location $HOME/.datree/crdSchemas/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json /path/to/file'\n"
printf "\nWould you like your public CRs to be checked automatically in the future? No problem! Add your schemas to our CRD-catalog and help us support popular CRs in future Datree policy checks :)\n"
printf "For more information visit https://www.github.com/datreeio/crds-catalog \n"

printf "\nTo validate a CR using various tools, run the relevant command:\n"
printf "\n- kubeconform:\n\$kubeconform -summary -output json -schema-location default -schema-location '$HOME/.datree/crdSchemas/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json' /path/to/file\n"
printf "\n- datree:\n\$datree test --schema-location $HOME/.datree/crdSchemas/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json /path/to/file\n\n"
fi

rm -rf $TMP_CRD_DIR

0 comments on commit 7e89bde

Please sign in to comment.