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

add yq to image #10

Open
bjartek opened this issue Nov 11, 2021 · 0 comments
Open

add yq to image #10

bjartek opened this issue Nov 11, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@bjartek
Copy link

bjartek commented Nov 11, 2021

Is it possible to add yq to the generated image. We are planning to use this for validating manfiseste using kustomize/kubeconform and that script uses yq.

Script is attached blow for reference

#!/usr/bin/env bash

set -eo pipefail

find . -type f -name '*.yaml' -print0 | while IFS= read -r -d $'\0' file;
  do
    yq e 'true' "$file" > /dev/null || error_exit "found when validating file $file"
done

k="kustomization.yaml"
kustomize_flags="--load-restrictor=LoadRestrictionsNone"
find . -type f -name $k -print0 |  while IFS= read -r -d $'\0' file;
  do
    [[ $file == ./base/* ]] && continue
    echo "================================"
    echo "INFO - Validating kustomization ${file/%$k} with kubeconform"

    kustomize build "${file/%$k}" $kustomize_flags | kubeconform -exit-on-error -kubernetes-version 1.21.2 -strict -ignore-missing-schemas -schema-location default -schema-location 'policy/{{ .ResourceKind }}{{ .KindSuffix }}.json' --verbose
done
@HighwayofLife HighwayofLife added the good first issue Good for newcomers label Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants