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

ci: add checks to generated Kubernetes configs #7

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions .github/workflows/yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,19 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: azure/setup-kubectl@v3
- name: kustomize build operators
- uses: azure/[email protected]
- uses: bmuschko/setup-kubeconform@v1
- name: validate kustomize with kubeconform
run: |
for operator in $(find operators -maxdepth 1 -mindepth 1 -type d); do
echo "${operator}"
kubectl kustomize --enable-helm "${operator}" > /dev/null
done
echo "apps/operators"
kubectl kustomize apps/operators > /dev/null
- name: kustomize build components
run: |
for component in $(find components -maxdepth 1 -mindepth 1 -type d); do
if [[ "${component}" =~ "secrets" ]]; then
echo "Skipping secrets"
else
echo "${component}"
kubectl kustomize --enable-helm "${component}" > /dev/null
fi
set -o errexit
set -o pipefail
items=$(find bootstrap -maxdepth 2 -name kustomization.yaml -exec dirname {} \;)
items+=($(find operators -maxdepth 2 -name kustomization.yaml -exec dirname {} \;))
items+=($(find components -maxdepth 2 -name kustomization.yaml -exec dirname {} \;))
items+=($(find apps -maxdepth 2 -name kustomization.yaml -exec dirname {} \;))

for item in ${items}; do
echo "${item}"
kubectl kustomize --enable-helm "${item}" | \
kubeconform -skip=Secret -strict -ignore-missing-schemas
done
echo "apps/components"
kubectl kustomize apps/components > /dev/null
3 changes: 1 addition & 2 deletions components/10-keystone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ git clone https://github.com/openstack/openstack-helm
git clone https://github.com/openstack/openstack-helm-infra
# update the dependencies cause we can't use real helm references
./scripts/openstack-helm-depend-sync.sh keystone
cd components/10-keystone
```

## Deploy Keystone
Expand All @@ -41,7 +40,7 @@ Secrets Reference:
helm --namespace openstack template \
keystone \
./openstack-helm/keystone/ \
-f aio-values.yaml \
-f components/10-keystone/aio-values.yaml \
--set endpoints.identity.auth.admin.password="$(kubectl --namespace openstack get secret keystone-admin -o jsonpath='{.data.password}' | base64 -d)" \
--set endpoints.oslo_db.auth.admin.password="$(kubectl --namespace openstack get secret mariadb -o jsonpath='{.data.root-password}' | base64 -d)" \
--set endpoints.oslo_db.auth.keystone.password="$(kubectl --namespace openstack get secret keystone-db-password -o jsonpath='{.data.password}' | base64 -d)" \
Expand Down
3 changes: 2 additions & 1 deletion scripts/openstack-helm-sealed-secrets.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -x

# function to process each YAML file
process_yaml() {
Expand Down Expand Up @@ -37,3 +37,4 @@ done

# process the last one
[[ -n $yaml_acc ]] && process_yaml "$yaml_acc"
exit 0
Loading