Created
April 25, 2024 12:43
-
-
Save x95castle1/115b9acdcc88d4fa3662e76bf0f4b3a8 to your computer and use it in GitHub Desktop.
Add Labels to All TAP Namespaces During Installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@ load("@ytt:overlay", "overlay") | |
#@ def match_packageinstall(): | |
kind: PackageInstall | |
#@ end | |
--- | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: label-namespaces-overlay | |
namespace: tap-install #! TODO: configurable | |
stringData: | |
label-namespaces.yaml: | | |
#@ load("@ytt:overlay", "overlay") | |
#@ def match_namespace(): | |
kind: Namespace | |
#@ end | |
#@overlay/match by=overlay.subset(match_namespace()), expects="0+" | |
--- | |
metadata: | |
#@overlay/match missing_ok=True | |
labels: | |
#@overlay/match missing_ok=True | |
some-label: label-some #! TODO: configurable | |
#@overlay/match by=overlay.subset(match_packageinstall()), expects="1+" | |
--- | |
metadata: | |
#@overlay/match missing_ok=True | |
annotations: | |
#@overlay/match missing_ok=True | |
ext.packaging.carvel.dev/ytt-paths-from-secret-name.99: label-namespaces-overlay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: packaging.carvel.dev/v1alpha1 | |
kind: PackageInstall | |
metadata: | |
name: tap | |
namespace: tap-install | |
spec: | |
packageRef: | |
refName: tap.tanzu.vmware.com | |
versionSelection: | |
constraints: 1.6.8 | |
serviceAccountName: tap-installer-sa | |
values: | |
- secretRef: | |
name: tap-values | |
- secretRef: | |
name: tap-sensitive-values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment