Created
September 13, 2022 21:46
-
-
Save kdvolder/d558145910c26a1e3111c6d40ed35def to your computer and use it in GitHub Desktop.
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:data", "data") | |
#@ load("@ytt:yaml", "yaml") | |
#@ load("@ytt:struct", "struct") | |
#!@ load("_profiles.star", "profiles") | |
#!@ if profiles.is_any_enabled([profiles.full, profiles.light, profiles.view]): | |
#!@ if profiles.is_pkg_enabled("backend.appliveview.tanzu.vmware.com"): | |
#@ def collect_values(data_values): | |
#@ values = { | |
#@ "ingressDomain": "", | |
#@ "ingressEnabled": False, | |
#@ "kubernetes_distribution": "" | |
#@ } | |
#@ if hasattr(data_values, "appliveview") and data_values.appliveview: | |
#@ values.update(struct.decode(data_values.appliveview)) | |
#@ end | |
#@ if hasattr(data_values.shared, "ingress_domain") and data_values.shared.ingress_domain: | |
#@ if not hasattr(data_values, "appliveview") or not hasattr(data_values.appliveview, "ingressDomain") or not data_values.appliveview.ingressDomain: | |
#@ values["ingressDomain"] = data_values.shared.ingress_domain | |
#@ values["ingressEnabled"] = True | |
#@ end | |
#@ end | |
#@ | |
#@ # Collect shared kubernetes distribution if not already specified by component config | |
#@ if not values.get("kubernetes_distribution", "") and hasattr(data.values.shared, "kubernetes_distribution") and data.values.shared.kubernetes_distribution: | |
#@ values["kubernetes_distribution"] = data.values.shared.kubernetes_distribution | |
#@ end | |
#@ | |
#@ return struct.encode(values) | |
#@ end | |
--- | |
apiVersion: packaging.carvel.dev/v1alpha1 | |
kind: PackageInstall | |
metadata: | |
name: appliveview | |
namespace: tap-install | |
annotations: | |
kapp.k14s.io/change-rule.conventions: "upsert after upserting conventions" | |
kapp.k14s.io/change-rule.serviceaccount: "delete before deleting serviceaccount" | |
kapp.k14s.io/change-rule.contour: "upsert after upserting contour" | |
spec: | |
serviceAccountName: tap-install-sa | |
packageRef: | |
refName: backend.appliveview.tanzu.vmware.com | |
versionSelection: | |
constraints: 1.3.0 | |
prereleases: {} | |
values: | |
- secretRef: | |
name: appliveview-values | |
--- | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: appliveview-values | |
namespace: tap-install | |
stringData: | |
values.yml: #@ yaml.encode(collect_values(data.values)) | |
#!#@ end | |
#!@ end |
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
#@data/values | |
--- | |
shared: | |
ingress_domain: appliveview.ga |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment