From d606d3a8565d0c4bbd03b6d7a07d9017254398cd Mon Sep 17 00:00:00 2001 From: sa069q Date: Thu, 27 May 2021 15:24:11 +0530 Subject: [PATCH] Removed HelmRepository from helm-chart-collator and created as a seperate function Change-Id: Ic32fab2eccf41b851de5694d13584c6c4789d62c --- .../versions-airshipctl.yaml | 2 ++ .../helm-chart-collator/kustomization.yaml | 4 +--- .../helm-chart-collator/namespace.yaml | 2 +- .../helm-repository.yaml | 5 +++-- .../helm-chart-repository/kustomization.yaml | 4 ++++ .../replacements/kustomization.yaml | 4 ++++ .../replacements/versions.yaml | 19 +++++++++++++++++++ 7 files changed, 34 insertions(+), 6 deletions(-) rename manifests/function/{helm-chart-collator => helm-chart-repository}/helm-repository.yaml (56%) create mode 100644 manifests/function/helm-chart-repository/kustomization.yaml create mode 100644 manifests/function/helm-chart-repository/replacements/kustomization.yaml create mode 100644 manifests/function/helm-chart-repository/replacements/versions.yaml diff --git a/manifests/function/airshipctl-base-catalogues/versions-airshipctl.yaml b/manifests/function/airshipctl-base-catalogues/versions-airshipctl.yaml index 290cb7e1a..3824d2cca 100644 --- a/manifests/function/airshipctl-base-catalogues/versions-airshipctl.yaml +++ b/manifests/function/airshipctl-base-catalogues/versions-airshipctl.yaml @@ -10,6 +10,8 @@ spec: helm_repositories: ingress-nginx: url: https://kubernetes.github.io/ingress-nginx + helm_chart_collator: + url: http://helm-chart-collator.collator.svc:8080 charts: ingress-nginx: diff --git a/manifests/function/helm-chart-collator/kustomization.yaml b/manifests/function/helm-chart-collator/kustomization.yaml index 9d3da353c..51831340d 100644 --- a/manifests/function/helm-chart-collator/kustomization.yaml +++ b/manifests/function/helm-chart-collator/kustomization.yaml @@ -1,8 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization - resources: - namespace.yaml - helm-chart-collator.yaml - - helm-repository.yaml -namespace: collator \ No newline at end of file +namespace: helm-chart-collator \ No newline at end of file diff --git a/manifests/function/helm-chart-collator/namespace.yaml b/manifests/function/helm-chart-collator/namespace.yaml index 3e1933c70..38e416e9e 100644 --- a/manifests/function/helm-chart-collator/namespace.yaml +++ b/manifests/function/helm-chart-collator/namespace.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: collator \ No newline at end of file + name: helm-chart-collator \ No newline at end of file diff --git a/manifests/function/helm-chart-collator/helm-repository.yaml b/manifests/function/helm-chart-repository/helm-repository.yaml similarity index 56% rename from manifests/function/helm-chart-collator/helm-repository.yaml rename to manifests/function/helm-chart-repository/helm-repository.yaml index edf1059bb..be0dcd150 100644 --- a/manifests/function/helm-chart-collator/helm-repository.yaml +++ b/manifests/function/helm-chart-repository/helm-repository.yaml @@ -2,7 +2,8 @@ apiVersion: source.toolkit.fluxcd.io/v1beta1 kind: HelmRepository metadata: - name: helm-repo + name: collator + namespace: helm-chart-collator spec: interval: 5m - url: http://helm-chart-collator.collator.svc:8080 \ No newline at end of file + url: http://helm-chart-collator.helm-chart-collator.svc:8080 \ No newline at end of file diff --git a/manifests/function/helm-chart-repository/kustomization.yaml b/manifests/function/helm-chart-repository/kustomization.yaml new file mode 100644 index 000000000..305e2fffd --- /dev/null +++ b/manifests/function/helm-chart-repository/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - helm-repository.yaml \ No newline at end of file diff --git a/manifests/function/helm-chart-repository/replacements/kustomization.yaml b/manifests/function/helm-chart-repository/replacements/kustomization.yaml new file mode 100644 index 000000000..cce41d7ba --- /dev/null +++ b/manifests/function/helm-chart-repository/replacements/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - versions.yaml \ No newline at end of file diff --git a/manifests/function/helm-chart-repository/replacements/versions.yaml b/manifests/function/helm-chart-repository/replacements/versions.yaml new file mode 100644 index 000000000..8f376eb3a --- /dev/null +++ b/manifests/function/helm-chart-repository/replacements/versions.yaml @@ -0,0 +1,19 @@ +apiVersion: airshipit.org/v1alpha1 +kind: ReplacementTransformer +metadata: + name: helm-repository-versions-replacements + annotations: + config.kubernetes.io/function: |- + container: + image: quay.io/airshipit/replacement-transformer:v2 +replacements: +- source: + objref: + kind: VersionsCatalogue + name: versions-airshipctl + fieldref: "{.spec.helm_repositories.helm_chart_collator.url}" + target: + objref: + kind: HelmRepository + name: helm-repo + fieldrefs: ["{.spec.url}"] \ No newline at end of file