Skip to content

Commit

Permalink
Merge pull request #264 from vmware-tanzu/packaging-global-ann
Browse files Browse the repository at this point in the history
add overlay to automatically add packaging global ann
  • Loading branch information
ewrenn8 authored Jul 1, 2021
2 parents 83bdfcb + 49d94ce commit 0356add
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,8 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: packagerepositories.packaging.carvel.dev
annotations:
packaging.carvel.dev/global-namespace: kapp-controller-packaging-global
spec:
group: packaging.carvel.dev
names:
Expand Down
9 changes: 9 additions & 0 deletions hack/crd-overlay.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")

#@overlay/match by=overlay.subset({"kind": "CustomResourceDefinition"}), expects="0+"
---
metadata:
Expand Down Expand Up @@ -29,3 +31,10 @@ metadata:
spec:
names:
plural: internalpackagemetadatas

#@overlay/match by=overlay.subset({"metadata":{"name":"packagerepositories.packaging.carvel.dev"}})
---
metadata:
#@overlay/match missing_ok=True
annotations:
packaging.carvel.dev/global-namespace: #@ data.values.packaging_global_namespace
2 changes: 1 addition & 1 deletion hack/gen-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ go run ./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go \
output:dir=./tmp/crds \
paths=./pkg/apis/...

ytt -f tmp/crds -f ./hack/crd-overlay.yml > config/crds.yml
ytt -f tmp/crds -f ./hack/crd-overlay.yml -f ./config/values.yml > config/crds.yml

rm -rf tmp/crds

0 comments on commit 0356add

Please sign in to comment.