From e474043a7cc0590bf377b911ec9ed33dfdb3f137 Mon Sep 17 00:00:00 2001 From: Tiago de Freitas Lima Date: Mon, 6 May 2024 19:50:37 -0300 Subject: [PATCH] Add githubaccesstoken CRD to kustomization.yaml (#3446) * Add githubaccesstoken CRD to kustomization.yaml Signed-off-by: Tiago de Freitas Lima * Update crd.generate script to update resources list from kustomization.yaml file Signed-off-by: Tiago de Freitas Lima --------- Signed-off-by: Tiago de Freitas Lima --- config/crds/bases/kustomization.yaml | 3 +++ hack/crd.generate.sh | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/config/crds/bases/kustomization.yaml b/config/crds/bases/kustomization.yaml index 0f86d9104..fdbf1dcbd 100644 --- a/config/crds/bases/kustomization.yaml +++ b/config/crds/bases/kustomization.yaml @@ -11,4 +11,7 @@ resources: - generators.external-secrets.io_ecrauthorizationtokens.yaml - generators.external-secrets.io_fakes.yaml - generators.external-secrets.io_gcraccesstokens.yaml + - generators.external-secrets.io_githubaccesstokens.yaml - generators.external-secrets.io_passwords.yaml + - generators.external-secrets.io_vaultdynamicsecrets.yaml + - generators.external-secrets.io_webhooks.yaml diff --git a/hack/crd.generate.sh b/hack/crd.generate.sh index abce2d018..46cecc19d 100755 --- a/hack/crd.generate.sh +++ b/hack/crd.generate.sh @@ -15,6 +15,11 @@ go run sigs.k8s.io/controller-tools/cmd/controller-gen crd \ paths="./apis/..." \ output:crd:artifacts:config="${CRD_DIR}/bases" +## Update resources list from kustomization.yaml +ls "${CRD_DIR}"/bases | grep -v "kustomization.yaml" | jq -R -s -c 'split("\n")[:-1]' | yq -p=json - > kustomize-files.yaml +yq -i '.resources = (load("kustomize-files.yaml"))' "${CRD_DIR}"/bases/kustomization.yaml +rm kustomize-files.yaml + # Remove extra header lines in generated CRDs # This is needed for building the helm chart for f in "${CRD_DIR}"/bases/*.yaml; do