diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/Chart.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/Chart.yaml index 9587b93fcc..6b127c37d0 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/Chart.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for Kubernetes -name: reference-chart_5-1-0 -version: 5.1.0 \ No newline at end of file +name: reference-chart_5-1-1 +version: 5.1.1 \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/README.md b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/README.md index fcd6785033..4e1126937d 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/README.md +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/README.md @@ -1,5 +1,5 @@ -# Rollout Deployment Chart - v5.0 +# Rollout Deployment Chart - v5.1 ## 1. Yaml File - diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/deployment.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/deployment.yaml index 53bf2bc86a..afcfc4e1e6 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/deployment.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/deployment.yaml @@ -750,10 +750,12 @@ spec: - {{ . }} {{- end }} {{- end }} + {{- else if .Values.deployment.strategy.canary.trafficRouting.customTrafficRouting }} +{{ toYaml .Values.deployment.strategy.canary.trafficRouting.customTrafficRouting | indent 8 }} {{- end }} {{- if .Values.deployment.strategy.canary.trafficRouting.managedRoutes }} managedRoutes: - {{ toYaml .Values.deployment.strategy.canary.trafficRouting.managedRoutes | indent 10 }} +{{ toYaml .Values.deployment.strategy.canary.trafficRouting.managedRoutes | indent 10 }} {{- end }} {{- end }} {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/externalsecrets.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/externalsecrets.yaml index efd291af5d..6b6682c0a6 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/externalsecrets.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/externalsecrets.yaml @@ -4,7 +4,11 @@ {{if (or (eq .externalType "ESO_GoogleSecretsManager") (eq .externalType "ESO_AWSSecretsManager") (eq .externalType "ESO_HashiCorpVault") (eq .externalType "ESO_AzureSecretsManager"))}} {{- if .esoSecretData.secretStore }} --- +{{- if $.Capabilities.APIVersions.Has "external-secrets.io/v1" }} +apiVersion: external-secrets.io/v1 +{{- else }} apiVersion: external-secrets.io/v1beta1 +{{- end }} kind: SecretStore metadata: name: {{ .name}} @@ -22,7 +26,11 @@ spec: {{- toYaml .esoSecretData.secretStore | nindent 4 }} {{- end }} --- -apiVersion: external-secrets.io/v1beta1 +{{- if $.Capabilities.APIVersions.Has "external-secrets.io/v1" }} +apiVersion: external-secrets.io/v1 +{{- else }} +apiVersion: external-secrets.io/v1beta1 +{{- end }} kind: ExternalSecret metadata: name: {{ .name }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-destinationrule.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-destinationrule.yaml index bc665e6ec0..b1eb429257 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-destinationrule.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-destinationrule.yaml @@ -12,6 +12,9 @@ metadata: {{- else }} name: {{ template ".Chart.Name .fullname" $ }}-destinationrule {{- end }} + {{- if .destinationRule.namespace }} + namespace: {{ .destinationRule.namespace }} + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-virtualservice.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-virtualservice.yaml index dae81522cb..4531346260 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-virtualservice.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-virtualservice.yaml @@ -12,6 +12,9 @@ metadata: {{- else }} name: {{ template ".Chart.Name .fullname" $ }}-virtualservice {{- end }} + {{- if .virtualService.namespace }} + namespace: {{ .virtualService.namespace }} + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/test_values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/test_values.yaml index 97e72df42e..e08224972c 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/test_values.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/test_values.yaml @@ -195,8 +195,12 @@ deployment: - pause: {} # final manual approval (optional) trafficRouting: - # managedRoutes: - # - name: api-canary + managedRoutes: + - name: api-canary + devtron: test + customTrafficRouting: + nginx: + stableIngress: rollouts-demo-stable istio: virtualService: name: api-vs diff --git a/scripts/sql/34604602_reference-5-1-1.down.sql b/scripts/sql/34604602_reference-5-1-1.down.sql new file mode 100644 index 0000000000..62a7ae3ac6 --- /dev/null +++ b/scripts/sql/34604602_reference-5-1-1.down.sql @@ -0,0 +1,15 @@ +DELETE FROM global_strategy_metadata_chart_ref_mapping +WHERE chart_ref_id IN ( + SELECT id + FROM "public"."chart_ref" + WHERE "version" = '5.1.0' + AND "location" = 'reference-chart_5-1-0' + AND "name" = 'Rollout Deployment' +) +AND global_strategy_metadata_id IN (1, 2, 3, 4); + +-- 2. Remove the chart reference (Parent) +DELETE FROM "public"."chart_ref" +WHERE "version" = '5.1.0' +AND "location" = 'reference-chart_5-1-0' +AND "name" = 'Rollout Deployment'; \ No newline at end of file diff --git a/scripts/sql/34604602_reference-5-1-1.up.sql b/scripts/sql/34604602_reference-5-1-1.up.sql new file mode 100644 index 0000000000..4c1fd69aaf --- /dev/null +++ b/scripts/sql/34604602_reference-5-1-1.up.sql @@ -0,0 +1,39 @@ +-- 1. Insert chart_ref if not exists +INSERT INTO "public"."chart_ref" ( + "location", "version", "deployment_strategy_path", + "is_default", "active", "created_on", "created_by", + "updated_on", "updated_by", "name" +) +SELECT + 'reference-chart_5-1-1', '5.1.1', 'pipeline-values.yaml', + 'f', 't', now(), 1, now(), 1, + 'Rollout Deployment' +WHERE NOT EXISTS ( + SELECT 1 + FROM "public"."chart_ref" + WHERE "version" = '5.1.1' + AND "location" = 'reference-chart_5-1-1' + AND "name" = 'Rollout Deployment' +); + +-- 2. Insert mappings based on the chart_ref above +INSERT INTO global_strategy_metadata_chart_ref_mapping ( + "global_strategy_metadata_id", "chart_ref_id", "active", + "created_on", "created_by", "updated_on", "updated_by", "default" +) +SELECT + m_ids.id, + cr.id, + true, now(), 1, now(), 1, + (m_ids.id = 1) +FROM + "public"."chart_ref" cr, + (VALUES (1), (2), (3), (4)) AS m_ids(id) +WHERE + cr.version = '5.1.1' AND cr.name = 'Rollout Deployment' + AND NOT EXISTS ( + SELECT 1 + FROM global_strategy_metadata_chart_ref_mapping existing + WHERE existing.global_strategy_metadata_id = m_ids.id + AND existing.chart_ref_id = cr.id + ); \ No newline at end of file