diff --git a/charts/vela-core/templates/addons/fluxcd.yaml b/charts/vela-core/templates/addons/fluxcd.yaml index 2768b66be..abe523875 100644 --- a/charts/vela-core/templates/addons/fluxcd.yaml +++ b/charts/vela-core/templates/addons/fluxcd.yaml @@ -5918,37 +5918,52 @@ data: cue: template: "output: {\n\tapiVersion: \"source.toolkit.fluxcd.io/v1beta1\"\n\tmetadata: {\n\t\tname: context.name\n\t}\n\tif parameter.repoType == \"git\" - {\n\t\tkind: \"GitRepository\"\n\t\tspec: {\n\t\t\turl: parameter.repoUrl\n\t\t\tref:\n\t\t\t\tbranch: - parameter.branch\n\t\t\tinterval: parameter.pullInterval\n\t\t}\n\t}\n\tif + {\n\t\tkind: \"GitRepository\"\n\t\tspec: {\n\t\t\turl: parameter.url\n\t\t\tif + parameter.git.branch != _|_ {\n\t\t\t\tref: branch: parameter.git.branch\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif + parameter.repoType == \"oss\" {\n\t\tkind: \"Bucket\"\n\t\tspec: + {\n\t\t\tendpoint: parameter.url\n\t\t\tbucketName: parameter.oss.bucketName\n\t\t\tprovider: + \ parameter.oss.provider\n\t\t\tif parameter.oss.region != _|_ + {\n\t\t\t\tregion: parameter.oss.region\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif parameter.repoType == \"helm\" {\n\t\tkind: \"HelmRepository\"\n\t\tspec: - {\n\t\t\tinterval: parameter.pullInterval\n\t\t\turl: parameter.repoUrl\n\t\t\tif - parameter.secretRef != _|_ {\n\t\t\t\tsecretRef: {\n\t\t\t\t\tname: - parameter.secretRef\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\noutputs: + {\n\t\t\turl: parameter.url\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n}\n\noutputs: release: {\n\tapiVersion: \"helm.toolkit.fluxcd.io/v2beta1\"\n\tkind: \ \"HelmRelease\"\n\tmetadata: {\n\t\tname: context.name\n\t}\n\tspec: {\n\t\tinterval: parameter.pullInterval\n\t\tchart: {\n\t\t\tspec: {\n\t\t\t\tchart: parameter.chart\n\t\t\t\tversion: parameter.version\n\t\t\t\tsourceRef: {\n\t\t\t\t\tif parameter.repoType == \"git\" {\n\t\t\t\t\t\tkind: \"GitRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif parameter.repoType - == \"helm\" {\n\t\t\t\t\t\tkind: \"HelmRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tname: + == \"helm\" {\n\t\t\t\t\t\tkind: \"HelmRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif + parameter.repoType == \"oss\" {\n\t\t\t\t\t\tkind: \"Bucket\"\n\t\t\t\t\t}\n\t\t\t\t\tname: \ context.name\n\t\t\t\t\tnamespace: context.namespace\n\t\t\t\t}\n\t\t\t\tinterval: parameter.pullInterval\n\t\t\t}\n\t\t}\n\t\tif parameter.targetNamespace - != _|_ {\n\t\t\ttargetNamespace: parameter.targetNamespace\n\t\t}\n - \ if parameter.releaseName != _|_ {\n\t\t\treleaseName: parameter.releaseName\n\t\t}\n\n\t\tif - parameter.values != _|_ {\n\t\t\tvalues: parameter.values\n\t\t}\n\t}\n}\n\nparameter: - {\n\trepoType: \"git\" | \"helm\"\n\t// +usage=The Git or Helm repository - URL, accept HTTP/S or SSH address as git url.\n\trepoUrl: string\n\t// - +usage=The interval at which to check for repository and relese - updates.\n\tpullInterval: *\"5m\" | string\n\t// +usage=1.The relative - path to helm chart for git source. 2. chart name for helm resource\n\tchart: - string\n\t// +usage=Chart version\n\tversion: *\"*\" | string\n\t// - +usage=The Git reference to checkout and monitor for changes, defaults - to master branch.\n\tbranch: *\"master\" | string\n\t// +usage=The - name of the secret containing authentication credentials for the - Helm repository.\n\tsecretRef?: string\n\t// +usage=The namespace - for helm chart\n\ttargetNamespace?: string\n\t// +usage=Chart version\n\tvalue?: - #nestedmap\n // +usage=The release name\n releaseName?: string\n}\n\n#nestedmap: - {\n\t...\n} \n" + != _|_ {\n\t\t\ttargetNamespace: parameter.targetNamespace\n\t\t}\n\t\tif + parameter.releaseName != _|_ {\n\t\t\treleaseName: parameter.releaseName\n\t\t}\n\t\tif + parameter.values != _|_ {\n\t\t\tvalues: parameter.values\n\t\t}\n\t}\n}\n\n_secret: + {\n\tif parameter.secretRef != _|_ {\n\t\tsecretRef: {\n\t\t\tname: + parameter.secretRef\n\t\t}\n\t}\n}\n\n_sourceCommonArgs: {\n\tinterval: + parameter.pullInterval\n\tif parameter.timeout != _|_ {\n\t\ttimeout: + parameter.timeout\n\t}\n}\n\nparameter: {\n\trepoType: *\"helm\" + | \"git\" | \"oss\"\n\t// +usage=The interval at which to check + for repository/bucket and relese updates, default to 5m\n\tpullInterval: + *\"5m\" | string\n\t// +usage=The Git or Helm repository URL, OSS + endpoint, accept HTTP/S or SSH address as git url,\n\turl: string\n\t// + +usage=The name of the secret containing authentication credentials\n\tsecretRef?: + string\n\t// +usage=The timeout for operations like download index/clone + repository, optional\n\ttimeout?: string\n\n\tgit?: {\n\t\t// +usage=The + Git reference to checkout and monitor for changes, defaults to master + branch\n\t\tbranch: string\n\t}\n\toss?: {\n\t\t// +usage=The bucket's + name, required if repoType is oss\n\t\tbucketName: string\n\t\t// + +usage=\"generic\" for Minio, Amazon S3, Google Cloud Storage, Alibaba + Cloud OSS, \"aws\" for retrieve credentials from the EC2 service + when credentials not specified, default \"generic\"\n\t\tprovider: + *\"generic\" | \"aws\"\n\t\t// +usage=The bucket region, optional\n\t\tregion?: + string\n\t}\n\n\t// +usage=1.The relative path to helm chart for + git/oss source. 2. chart name for helm resource 3. relative path + for chart package(e.g. ./charts/podinfo-1.2.3.tgz)\n\tchart: string\n\t// + +usage=Chart version\n\tversion: *\"*\" | string\n\t// +usage=The + namespace for helm chart, optional\n\ttargetNamespace?: string\n\t// + +usage=The release name\n\treleaseName?: string\n\t// +usage=Chart + values\n\tvalues?: #nestedmap\n}\n\n#nestedmap: {\n\t...\n} \n" workload: type: autodetects.core.oam.dev type: raw diff --git a/charts/vela-core/templates/addons/keda.yaml b/charts/vela-core/templates/addons/keda.yaml index e79fc15ee..ee51728c1 100644 --- a/charts/vela-core/templates/addons/keda.yaml +++ b/charts/vela-core/templates/addons/keda.yaml @@ -16,7 +16,7 @@ data: properties: chart: keda repoType: helm - repoUrl: https://kedacore.github.io/charts + url: https://kedacore.github.io/charts type: helm status: rollout: diff --git a/charts/vela-core/templates/addons/kruise.yaml b/charts/vela-core/templates/addons/kruise.yaml index e88d84024..4b2a5781e 100644 --- a/charts/vela-core/templates/addons/kruise.yaml +++ b/charts/vela-core/templates/addons/kruise.yaml @@ -15,10 +15,11 @@ data: components: - name: kruise properties: - branch: master chart: ./charts/kruise/v0.9.0 + git: + branch: master repoType: git - repoUrl: https://github.com/openkruise/kruise + url: https://github.com/openkruise/kruise values: featureGates: PreDownloadImageForInPlaceUpdate=true type: helm diff --git a/charts/vela-core/templates/addons/observability.yaml b/charts/vela-core/templates/addons/observability.yaml index 9786ecb41..52df48f9d 100644 --- a/charts/vela-core/templates/addons/observability.yaml +++ b/charts/vela-core/templates/addons/observability.yaml @@ -14,11 +14,12 @@ data: components: - name: grafana-registration properties: - branch: master chart: ./chart + git: + branch: master repoType: git - repoUrl: https://github.com/oam-dev/grafana-registration targetNamespace: observability + url: https://github.com/oam-dev/grafana-registration values: replicaCount: 1 type: helm @@ -27,8 +28,8 @@ data: chart: grafana releaseName: grafana repoType: helm - repoUrl: https://grafana.github.io/helm-charts targetNamespace: observability + url: https://grafana.github.io/helm-charts version: 6.14.1 traits: - properties: @@ -51,8 +52,8 @@ data: chart: loki-stack releaseName: loki repoType: helm - repoUrl: https://grafana.github.io/helm-charts targetNamespace: observability + url: https://grafana.github.io/helm-charts version: 2.4.1 traits: - properties: @@ -72,8 +73,8 @@ data: chart: prometheus releaseName: prometheus repoType: helm - repoUrl: https://prometheus-community.github.io/helm-charts targetNamespace: observability + url: https://prometheus-community.github.io/helm-charts values: alertmanager: persistentVolume: @@ -104,8 +105,8 @@ data: properties: chart: kube-state-metrics repoType: helm - repoUrl: https://prometheus-community.github.io/helm-charts targetNamespace: observability + url: https://prometheus-community.github.io/helm-charts values: image: repository: oamdev/kube-state-metrics diff --git a/charts/vela-core/templates/addons/prometheus.yaml b/charts/vela-core/templates/addons/prometheus.yaml index c9e026ab8..5aa8466fd 100644 --- a/charts/vela-core/templates/addons/prometheus.yaml +++ b/charts/vela-core/templates/addons/prometheus.yaml @@ -17,7 +17,7 @@ data: properties: chart: premetheus repoType: helm - repoUrl: https://prometheus-community.github.io/helm-charts + url: https://prometheus-community.github.io/helm-charts type: helm status: rollout: diff --git a/charts/vela-core/templates/addons/terraform.yaml b/charts/vela-core/templates/addons/terraform.yaml index 16aafbfff..e7dce336c 100644 --- a/charts/vela-core/templates/addons/terraform.yaml +++ b/charts/vela-core/templates/addons/terraform.yaml @@ -17,7 +17,7 @@ data: properties: chart: ./chart repoType: git - repoUrl: https://github.com/oam-dev/terraform-controller + url: https://github.com/oam-dev/terraform-controller type: helm - name: terraform-system properties: diff --git a/e2e/addon/addon_test.go b/e2e/addon/addon_test.go index 21ea6843d..08e97f6d3 100644 --- a/e2e/addon/addon_test.go +++ b/e2e/addon/addon_test.go @@ -73,7 +73,7 @@ var _ = Describe("Addon Test", func() { Context("Test addon receive input", func() { It("Enable addon with input", func() { - output, err := e2e.LongTimeExec("vela addon enable test-input-addon repoUrl=https://charts.bitnami.com/bitnami chart=redis", 300*time.Second) + output, err := e2e.LongTimeExec("vela addon enable test-input-addon url=https://charts.bitnami.com/bitnami chart=redis", 300*time.Second) Expect(err).NotTo(HaveOccurred()) Expect(output).To(ContainSubstring("Successfully enable addon")) }) @@ -164,7 +164,7 @@ data: properties: chart: [[ index .Args "chart" ]] repoType: helm - repoUrl: [[ index .Args "repoUrl" ]] + url: [[ index .Args "url" ]] type: helm status: rollout: diff --git a/vela-templates/addons/auto-gen/fluxcd.yaml b/vela-templates/addons/auto-gen/fluxcd.yaml index ed3ef021b..5a2fda2cc 100644 --- a/vela-templates/addons/auto-gen/fluxcd.yaml +++ b/vela-templates/addons/auto-gen/fluxcd.yaml @@ -5915,37 +5915,52 @@ spec: cue: template: "output: {\n\tapiVersion: \"source.toolkit.fluxcd.io/v1beta1\"\n\tmetadata: {\n\t\tname: context.name\n\t}\n\tif parameter.repoType == \"git\" - {\n\t\tkind: \"GitRepository\"\n\t\tspec: {\n\t\t\turl: parameter.repoUrl\n\t\t\tref:\n\t\t\t\tbranch: - parameter.branch\n\t\t\tinterval: parameter.pullInterval\n\t\t}\n\t}\n\tif + {\n\t\tkind: \"GitRepository\"\n\t\tspec: {\n\t\t\turl: parameter.url\n\t\t\tif + parameter.git.branch != _|_ {\n\t\t\t\tref: branch: parameter.git.branch\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif + parameter.repoType == \"oss\" {\n\t\tkind: \"Bucket\"\n\t\tspec: + {\n\t\t\tendpoint: parameter.url\n\t\t\tbucketName: parameter.oss.bucketName\n\t\t\tprovider: + \ parameter.oss.provider\n\t\t\tif parameter.oss.region != _|_ + {\n\t\t\t\tregion: parameter.oss.region\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif parameter.repoType == \"helm\" {\n\t\tkind: \"HelmRepository\"\n\t\tspec: - {\n\t\t\tinterval: parameter.pullInterval\n\t\t\turl: parameter.repoUrl\n\t\t\tif - parameter.secretRef != _|_ {\n\t\t\t\tsecretRef: {\n\t\t\t\t\tname: - parameter.secretRef\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\noutputs: + {\n\t\t\turl: parameter.url\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n}\n\noutputs: release: {\n\tapiVersion: \"helm.toolkit.fluxcd.io/v2beta1\"\n\tkind: \ \"HelmRelease\"\n\tmetadata: {\n\t\tname: context.name\n\t}\n\tspec: {\n\t\tinterval: parameter.pullInterval\n\t\tchart: {\n\t\t\tspec: {\n\t\t\t\tchart: parameter.chart\n\t\t\t\tversion: parameter.version\n\t\t\t\tsourceRef: {\n\t\t\t\t\tif parameter.repoType == \"git\" {\n\t\t\t\t\t\tkind: \"GitRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif parameter.repoType - == \"helm\" {\n\t\t\t\t\t\tkind: \"HelmRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tname: + == \"helm\" {\n\t\t\t\t\t\tkind: \"HelmRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif + parameter.repoType == \"oss\" {\n\t\t\t\t\t\tkind: \"Bucket\"\n\t\t\t\t\t}\n\t\t\t\t\tname: \ context.name\n\t\t\t\t\tnamespace: context.namespace\n\t\t\t\t}\n\t\t\t\tinterval: parameter.pullInterval\n\t\t\t}\n\t\t}\n\t\tif parameter.targetNamespace - != _|_ {\n\t\t\ttargetNamespace: parameter.targetNamespace\n\t\t}\n - \ if parameter.releaseName != _|_ {\n\t\t\treleaseName: parameter.releaseName\n\t\t}\n\n\t\tif - parameter.values != _|_ {\n\t\t\tvalues: parameter.values\n\t\t}\n\t}\n}\n\nparameter: - {\n\trepoType: \"git\" | \"helm\"\n\t// +usage=The Git or Helm repository - URL, accept HTTP/S or SSH address as git url.\n\trepoUrl: string\n\t// - +usage=The interval at which to check for repository and relese - updates.\n\tpullInterval: *\"5m\" | string\n\t// +usage=1.The relative - path to helm chart for git source. 2. chart name for helm resource\n\tchart: - string\n\t// +usage=Chart version\n\tversion: *\"*\" | string\n\t// - +usage=The Git reference to checkout and monitor for changes, defaults - to master branch.\n\tbranch: *\"master\" | string\n\t// +usage=The - name of the secret containing authentication credentials for the - Helm repository.\n\tsecretRef?: string\n\t// +usage=The namespace - for helm chart\n\ttargetNamespace?: string\n\t// +usage=Chart version\n\tvalue?: - #nestedmap\n // +usage=The release name\n releaseName?: string\n}\n\n#nestedmap: - {\n\t...\n} \n" + != _|_ {\n\t\t\ttargetNamespace: parameter.targetNamespace\n\t\t}\n\t\tif + parameter.releaseName != _|_ {\n\t\t\treleaseName: parameter.releaseName\n\t\t}\n\t\tif + parameter.values != _|_ {\n\t\t\tvalues: parameter.values\n\t\t}\n\t}\n}\n\n_secret: + {\n\tif parameter.secretRef != _|_ {\n\t\tsecretRef: {\n\t\t\tname: + parameter.secretRef\n\t\t}\n\t}\n}\n\n_sourceCommonArgs: {\n\tinterval: + parameter.pullInterval\n\tif parameter.timeout != _|_ {\n\t\ttimeout: + parameter.timeout\n\t}\n}\n\nparameter: {\n\trepoType: *\"helm\" + | \"git\" | \"oss\"\n\t// +usage=The interval at which to check + for repository/bucket and relese updates, default to 5m\n\tpullInterval: + *\"5m\" | string\n\t// +usage=The Git or Helm repository URL, OSS + endpoint, accept HTTP/S or SSH address as git url,\n\turl: string\n\t// + +usage=The name of the secret containing authentication credentials\n\tsecretRef?: + string\n\t// +usage=The timeout for operations like download index/clone + repository, optional\n\ttimeout?: string\n\n\tgit?: {\n\t\t// +usage=The + Git reference to checkout and monitor for changes, defaults to master + branch\n\t\tbranch: string\n\t}\n\toss?: {\n\t\t// +usage=The bucket's + name, required if repoType is oss\n\t\tbucketName: string\n\t\t// + +usage=\"generic\" for Minio, Amazon S3, Google Cloud Storage, Alibaba + Cloud OSS, \"aws\" for retrieve credentials from the EC2 service + when credentials not specified, default \"generic\"\n\t\tprovider: + *\"generic\" | \"aws\"\n\t\t// +usage=The bucket region, optional\n\t\tregion?: + string\n\t}\n\n\t// +usage=1.The relative path to helm chart for + git/oss source. 2. chart name for helm resource 3. relative path + for chart package(e.g. ./charts/podinfo-1.2.3.tgz)\n\tchart: string\n\t// + +usage=Chart version\n\tversion: *\"*\" | string\n\t// +usage=The + namespace for helm chart, optional\n\ttargetNamespace?: string\n\t// + +usage=The release name\n\treleaseName?: string\n\t// +usage=Chart + values\n\tvalues?: #nestedmap\n}\n\n#nestedmap: {\n\t...\n} \n" workload: type: autodetects.core.oam.dev type: raw diff --git a/vela-templates/addons/auto-gen/keda.yaml b/vela-templates/addons/auto-gen/keda.yaml index a55099a7a..e183bc5ca 100644 --- a/vela-templates/addons/auto-gen/keda.yaml +++ b/vela-templates/addons/auto-gen/keda.yaml @@ -13,7 +13,7 @@ spec: properties: chart: keda repoType: helm - repoUrl: https://kedacore.github.io/charts + url: https://kedacore.github.io/charts type: helm status: rollout: diff --git a/vela-templates/addons/auto-gen/kruise.yaml b/vela-templates/addons/auto-gen/kruise.yaml index 3b88c78de..2f434937a 100644 --- a/vela-templates/addons/auto-gen/kruise.yaml +++ b/vela-templates/addons/auto-gen/kruise.yaml @@ -12,10 +12,11 @@ spec: components: - name: kruise properties: - branch: master chart: ./charts/kruise/v0.9.0 + git: + branch: master repoType: git - repoUrl: https://github.com/openkruise/kruise + url: https://github.com/openkruise/kruise values: featureGates: PreDownloadImageForInPlaceUpdate=true type: helm diff --git a/vela-templates/addons/auto-gen/observability.yaml b/vela-templates/addons/auto-gen/observability.yaml index 12d9517c5..a9a1ae7bf 100644 --- a/vela-templates/addons/auto-gen/observability.yaml +++ b/vela-templates/addons/auto-gen/observability.yaml @@ -11,11 +11,12 @@ spec: components: - name: grafana-registration properties: - branch: master chart: ./chart + git: + branch: master repoType: git - repoUrl: https://github.com/oam-dev/grafana-registration targetNamespace: observability + url: https://github.com/oam-dev/grafana-registration values: replicaCount: 1 type: helm @@ -24,8 +25,8 @@ spec: chart: grafana releaseName: grafana repoType: helm - repoUrl: https://grafana.github.io/helm-charts targetNamespace: observability + url: https://grafana.github.io/helm-charts version: 6.14.1 traits: - properties: @@ -48,8 +49,8 @@ spec: chart: loki-stack releaseName: loki repoType: helm - repoUrl: https://grafana.github.io/helm-charts targetNamespace: observability + url: https://grafana.github.io/helm-charts version: 2.4.1 traits: - properties: @@ -69,8 +70,8 @@ spec: chart: prometheus releaseName: prometheus repoType: helm - repoUrl: https://prometheus-community.github.io/helm-charts targetNamespace: observability + url: https://prometheus-community.github.io/helm-charts values: alertmanager: persistentVolume: @@ -101,8 +102,8 @@ spec: properties: chart: kube-state-metrics repoType: helm - repoUrl: https://prometheus-community.github.io/helm-charts targetNamespace: observability + url: https://prometheus-community.github.io/helm-charts values: image: repository: oamdev/kube-state-metrics diff --git a/vela-templates/addons/auto-gen/prometheus.yaml b/vela-templates/addons/auto-gen/prometheus.yaml index acca0d93d..67ebd7b55 100644 --- a/vela-templates/addons/auto-gen/prometheus.yaml +++ b/vela-templates/addons/auto-gen/prometheus.yaml @@ -14,7 +14,7 @@ spec: properties: chart: premetheus repoType: helm - repoUrl: https://prometheus-community.github.io/helm-charts + url: https://prometheus-community.github.io/helm-charts type: helm status: rollout: diff --git a/vela-templates/addons/auto-gen/terraform.yaml b/vela-templates/addons/auto-gen/terraform.yaml index 366bf8fd1..57900111a 100644 --- a/vela-templates/addons/auto-gen/terraform.yaml +++ b/vela-templates/addons/auto-gen/terraform.yaml @@ -14,7 +14,7 @@ spec: properties: chart: ./chart repoType: git - repoUrl: https://github.com/oam-dev/terraform-controller + url: https://github.com/oam-dev/terraform-controller type: helm - name: terraform-system properties: diff --git a/vela-templates/addons/fluxcd/definitions/helm-release.yaml b/vela-templates/addons/fluxcd/definitions/helm-release.yaml index fc63b82a5..6890c7468 100644 --- a/vela-templates/addons/fluxcd/definitions/helm-release.yaml +++ b/vela-templates/addons/fluxcd/definitions/helm-release.yaml @@ -19,22 +19,33 @@ spec: if parameter.repoType == "git" { kind: "GitRepository" spec: { - url: parameter.repoUrl - ref: - branch: parameter.branch - interval: parameter.pullInterval + url: parameter.url + if parameter.git.branch != _|_ { + ref: branch: parameter.git.branch + } + _secret + _sourceCommonArgs + } + } + if parameter.repoType == "oss" { + kind: "Bucket" + spec: { + endpoint: parameter.url + bucketName: parameter.oss.bucketName + provider: parameter.oss.provider + if parameter.oss.region != _|_ { + region: parameter.oss.region + } + _secret + _sourceCommonArgs } } if parameter.repoType == "helm" { kind: "HelmRepository" spec: { - interval: parameter.pullInterval - url: parameter.repoUrl - if parameter.secretRef != _|_ { - secretRef: { - name: parameter.secretRef - } - } + url: parameter.url + _secret + _sourceCommonArgs } } } @@ -58,6 +69,9 @@ spec: if parameter.repoType == "helm" { kind: "HelmRepository" } + if parameter.repoType == "oss" { + kind: "Bucket" + } name: context.name namespace: context.namespace } @@ -67,36 +81,64 @@ spec: if parameter.targetNamespace != _|_ { targetNamespace: parameter.targetNamespace } - if parameter.releaseName != _|_ { + if parameter.releaseName != _|_ { releaseName: parameter.releaseName } - if parameter.values != _|_ { values: parameter.values } } } + _secret: { + if parameter.secretRef != _|_ { + secretRef: { + name: parameter.secretRef + } + } + } + + _sourceCommonArgs: { + interval: parameter.pullInterval + if parameter.timeout != _|_ { + timeout: parameter.timeout + } + } + parameter: { - repoType: "git" | "helm" - // +usage=The Git or Helm repository URL, accept HTTP/S or SSH address as git url. - repoUrl: string - // +usage=The interval at which to check for repository and relese updates. + repoType: *"helm" | "git" | "oss" + // +usage=The interval at which to check for repository/bucket and relese updates, default to 5m pullInterval: *"5m" | string - // +usage=1.The relative path to helm chart for git source. 2. chart name for helm resource + // +usage=The Git or Helm repository URL, OSS endpoint, accept HTTP/S or SSH address as git url, + url: string + // +usage=The name of the secret containing authentication credentials + secretRef?: string + // +usage=The timeout for operations like download index/clone repository, optional + timeout?: string + + git?: { + // +usage=The Git reference to checkout and monitor for changes, defaults to master branch + branch: string + } + oss?: { + // +usage=The bucket's name, required if repoType is oss + bucketName: string + // +usage="generic" for Minio, Amazon S3, Google Cloud Storage, Alibaba Cloud OSS, "aws" for retrieve credentials from the EC2 service when credentials not specified, default "generic" + provider: *"generic" | "aws" + // +usage=The bucket region, optional + region?: string + } + + // +usage=1.The relative path to helm chart for git/oss source. 2. chart name for helm resource 3. relative path for chart package(e.g. ./charts/podinfo-1.2.3.tgz) chart: string // +usage=Chart version version: *"*" | string - // +usage=The Git reference to checkout and monitor for changes, defaults to master branch. - branch: *"master" | string - // +usage=The name of the secret containing authentication credentials for the Helm repository. - secretRef?: string - // +usage=The namespace for helm chart + // +usage=The namespace for helm chart, optional targetNamespace?: string - // +usage=Chart version - value?: #nestedmap - // +usage=The release name - releaseName?: string + // +usage=The release name + releaseName?: string + // +usage=Chart values + values?: #nestedmap } #nestedmap: { diff --git a/vela-templates/addons/keda/template.yaml b/vela-templates/addons/keda/template.yaml index d9c4344f3..a17a0c596 100644 --- a/vela-templates/addons/keda/template.yaml +++ b/vela-templates/addons/keda/template.yaml @@ -19,7 +19,7 @@ spec: type: helm properties: repoType: helm - repoUrl: https://kedacore.github.io/charts + url: https://kedacore.github.io/charts chart: keda {{ range .ResourceFiles }} - name: {{ .Name }} diff --git a/vela-templates/addons/kruise/template.yaml b/vela-templates/addons/kruise/template.yaml index 279c3d5ca..e22cba795 100644 --- a/vela-templates/addons/kruise/template.yaml +++ b/vela-templates/addons/kruise/template.yaml @@ -19,9 +19,10 @@ spec: type: helm properties: repoType: git - repoUrl: https://github.com/openkruise/kruise + url: https://github.com/openkruise/kruise chart: ./charts/kruise/v0.9.0 - branch: master + git: + branch: master values: featureGates: PreDownloadImageForInPlaceUpdate=true {{ range .ResourceFiles }} diff --git a/vela-templates/addons/observability/template.yaml b/vela-templates/addons/observability/template.yaml index 525fd1289..d4cca201e 100644 --- a/vela-templates/addons/observability/template.yaml +++ b/vela-templates/addons/observability/template.yaml @@ -24,8 +24,9 @@ spec: type: helm properties: repoType: git - repoUrl: https://github.com/oam-dev/grafana-registration - branch: master + url: https://github.com/oam-dev/grafana-registration + git: + branch: master chart: ./chart targetNamespace: observability values: @@ -35,7 +36,7 @@ spec: chart: grafana version: 6.14.1 repoType: helm - repoUrl: https://grafana.github.io/helm-charts + url: https://grafana.github.io/helm-charts targetNamespace: observability releaseName: grafana type: helm @@ -60,7 +61,7 @@ spec: chart: loki-stack version: 2.4.1 repoType: helm - repoUrl: https://grafana.github.io/helm-charts + url: https://grafana.github.io/helm-charts targetNamespace: observability releaseName: loki traits: @@ -81,7 +82,7 @@ spec: chart: prometheus version: 14.4.1 repoType: helm - repoUrl: https://prometheus-community.github.io/helm-charts + url: https://prometheus-community.github.io/helm-charts targetNamespace: observability releaseName: prometheus values: @@ -113,7 +114,7 @@ spec: chart: kube-state-metrics version: 3.4.1 repoType: helm - repoUrl: https://prometheus-community.github.io/helm-charts + url: https://prometheus-community.github.io/helm-charts targetNamespace: observability values: image: diff --git a/vela-templates/addons/prometheus/template.yaml b/vela-templates/addons/prometheus/template.yaml index 6b6244ac1..708a3c0d7 100644 --- a/vela-templates/addons/prometheus/template.yaml +++ b/vela-templates/addons/prometheus/template.yaml @@ -19,7 +19,7 @@ spec: type: helm properties: repoType: helm - repoUrl: https://prometheus-community.github.io/helm-charts + url: https://prometheus-community.github.io/helm-charts chart: premetheus {{ range .DefinitionFiles }} - name: {{ .Name }} diff --git a/vela-templates/addons/terraform/template.yaml b/vela-templates/addons/terraform/template.yaml index 706b2d094..a7a484b63 100644 --- a/vela-templates/addons/terraform/template.yaml +++ b/vela-templates/addons/terraform/template.yaml @@ -19,7 +19,7 @@ spec: type: helm properties: repoType: git - repoUrl: https://github.com/oam-dev/terraform-controller + url: https://github.com/oam-dev/terraform-controller chart: ./chart {{ range .ResourceFiles }} - name: {{ .Name }}