UNCLASSIFIED - NO CUI

feat(scripts): add script that templates all package resources

General MR

Summary

This MR adds a script to Big Bang that will allow developers and users alike to see all resources that will be created in-cluster by a big-bang installation.

This script will enable helm unit tests at the Big Bang umbrella level that can assert deep into Big Bang's assorted packages, enabling more robust testing without the need for a running cluster.

Relevant logs/screenshots

Usage Scenarios

The script can be run in a few ways. It can stand in for helm template (running helm template under the hood):

❯ ./scripts/template-all.sh ./chart \
    --namespace bigbang \
    --values ignore/ib_creds.yaml | yq -N 'select(.kind != null) | .kind' | wc -l
[INFO] Templating Big Bang chart with Helm...
[INFO] All repositories successfully resolved.
[INFO] Templating completed successfully.
768

It can read templates generated by helm template from stdin:

❯ helm template ./chart \
    --namespace bigbang \
    --values ignore/ib_creds.yaml \
    | ./scripts/template-all.sh \
    | yq -N 'select(.kind != null) | .kind' | wc -l
[INFO] Reading Big Bang templates from stdin...
[INFO] All repositories successfully resolved.
[INFO] Templating completed successfully.
768

It can also be used directly by helm as a post-renderer:

❯ helm template ./chart \
    --namespace bigbang \
    --values ignore/ib_creds.yaml \
    --post-renderer ./scripts/template-all.sh \
    | yq -N 'select(.kind != null) | .kind' | wc -l
768

I'm still working through how best to incorporate this with our helm unit testing process, but the script itself is done.

Linked Issue

#2850 (closed)

Upgrade Notices

N/A

Merge request reports

Loading