diff --git a/charts/portal/Chart.lock b/charts/portal/Chart.lock index 831646171..fa76da0ce 100644 --- a/charts/portal/Chart.lock +++ b/charts/portal/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: common repository: file://../common - version: 0.1.3 -digest: sha256:458eeb38012b33fb226ca0cb45ecbcdd21e2a28025619bc0b01dd71a079c9882 -generated: "2024-10-11T11:24:57.022871+02:00" + version: 0.1.4 +digest: sha256:05e31c3eb487f942d4ac07ce0dfe4e0620779b589ef481cdd6534c73a7f0ca27 +generated: "2024-11-20T11:36:34.0773803+02:00" diff --git a/charts/portal/Chart.yaml b/charts/portal/Chart.yaml index 80f9a1b1c..03b4b89dd 100644 --- a/charts/portal/Chart.yaml +++ b/charts/portal/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 appVersion: "0.164.0" description: Helm Chart for the openmfp Portal name: portal -version: 0.69.87 +version: 0.69.88 dependencies: - name: common repository: file://../common - version: 0.1.3 + version: 0.1.4 diff --git a/charts/portal/charts/common-0.1.4.tgz b/charts/portal/charts/common-0.1.4.tgz new file mode 100644 index 000000000..a82fafeec Binary files /dev/null and b/charts/portal/charts/common-0.1.4.tgz differ diff --git a/charts/portal/templates/deploy.yaml b/charts/portal/templates/deploy.yaml index 1b4efff89..6fa839a41 100644 --- a/charts/portal/templates/deploy.yaml +++ b/charts/portal/templates/deploy.yaml @@ -1,10 +1,10 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "entity.name" . }} + name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} labels: - app: {{ include "entity.name" . }} + app: {{ include "common.entity.name" . }} spec: strategy: rollingUpdate: @@ -13,19 +13,19 @@ spec: revisionHistoryLimit: 3 selector: matchLabels: - app: {{ include "entity.name" . }} + app: {{ include "common.entity.name" . }} template: metadata: labels: - app: {{ include "entity.name" . }} + app: {{ include "common.entity.name" . }} spec: - serviceAccountName: {{ include "entity.name" . }} + serviceAccountName: {{ include "common.entity.name" . }} securityContext: runAsUser: 1000 runAsGroup: 3000 fsGroup: 2000 containers: - - name: {{ include "entity.name" . }} + - name: {{ include "common.entity.name" . }} image: {{ .Values.image.name }}:{{ .Chart.AppVersion }} imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: diff --git a/charts/portal/templates/istio-destination-rule.yaml b/charts/portal/templates/istio-destination-rule.yaml index 6c210d77b..cbfa097fc 100644 --- a/charts/portal/templates/istio-destination-rule.yaml +++ b/charts/portal/templates/istio-destination-rule.yaml @@ -1,11 +1,11 @@ -{{- if .Values.istio.enabled -}} +{{- if eq (include "common.istioEnabled" .) "true" -}} apiVersion: "networking.istio.io/v1alpha3" kind: "DestinationRule" metadata: - name: {{ include "entity.name" . }} + name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} spec: - host: {{ include "entity.name" . }}.{{ .Release.Namespace }}.svc.cluster.local + host: {{ include "common.entity.name" . }}.{{ .Release.Namespace }}.svc.cluster.local trafficPolicy: tls: mode: ISTIO_MUTUAL diff --git a/charts/portal/templates/istio-peerauthentication.yaml b/charts/portal/templates/istio-peerauthentication.yaml index c12e10607..57be5b47c 100644 --- a/charts/portal/templates/istio-peerauthentication.yaml +++ b/charts/portal/templates/istio-peerauthentication.yaml @@ -1,13 +1,13 @@ -{{- if .Values.istio.enabled -}} +{{- if eq (include "common.istioEnabled" .) "true" -}} apiVersion: "security.istio.io/v1beta1" kind: "PeerAuthentication" metadata: - name: {{ include "entity.name" . }} + name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} spec: selector: matchLabels: - app: {{ include "entity.name" . }} + app: {{ include "common.entity.name" . }} mtls: mode: STRICT {{- end -}} \ No newline at end of file diff --git a/charts/portal/templates/istio-virtual-service.yaml b/charts/portal/templates/istio-virtual-service.yaml index f2a3bc134..f9a7262f0 100644 --- a/charts/portal/templates/istio-virtual-service.yaml +++ b/charts/portal/templates/istio-virtual-service.yaml @@ -1,15 +1,15 @@ -{{- if .Values.istio.enabled -}} +{{- if eq (include "common.istioEnabled" .) "true" -}} apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: - name: {{ include "entity.name" . }} + name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} spec: gateways: - {{ .Release.Namespace }}/gateway hosts: - {{- if (.Values.istio.virtualService).hosts }} -{{ .Values.istio.virtualService.hosts | toYaml | nindent 2}} + {{- if (.Values.virtualService).hosts }} +{{ .Values.virtualService.hosts | toYaml | nindent 2}} {{- else }} {{ range $domainName := .Values.baseDomains }} - {{ $domainName }} @@ -31,7 +31,7 @@ spec: - DELETE route: - destination: - host: {{ include "entity.name" . }}.{{ .Release.Namespace }}.svc.cluster.local + host: {{ include "common.entity.name" . }}.{{ .Release.Namespace }}.svc.cluster.local port: number: 8080 {{- end -}} \ No newline at end of file diff --git a/charts/portal/templates/rbac.yaml b/charts/portal/templates/rbac.yaml index 8b6f9fbf4..443444e1f 100644 --- a/charts/portal/templates/rbac.yaml +++ b/charts/portal/templates/rbac.yaml @@ -15,7 +15,7 @@ metadata: name: read-contentconfigurations-global subjects: - kind: ServiceAccount - name: {{ include "entity.name" . }} + name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole diff --git a/charts/portal/templates/sa.yaml b/charts/portal/templates/sa.yaml index a86085722..939d253d4 100644 --- a/charts/portal/templates/sa.yaml +++ b/charts/portal/templates/sa.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "entity.name" . }} + name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} imagePullSecrets: - name: {{ .Values.image.pullSecret }} diff --git a/charts/portal/templates/service.yaml b/charts/portal/templates/service.yaml index 93d46a049..94190ee6a 100644 --- a/charts/portal/templates/service.yaml +++ b/charts/portal/templates/service.yaml @@ -1,11 +1,11 @@ kind: Service apiVersion: v1 metadata: - name: {{ include "entity.name" . }} + name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} spec: selector: - app: {{ include "entity.name" . }} + app: {{ include "common.entity.name" . }} ports: - name: http protocol: TCP diff --git a/charts/portal/templates/sidecar.yaml b/charts/portal/templates/sidecar.yaml index 5a283ba2b..3d172bd63 100644 --- a/charts/portal/templates/sidecar.yaml +++ b/charts/portal/templates/sidecar.yaml @@ -1,13 +1,13 @@ -{{- if .Values.istio.enabled -}} +{{- if eq (include "common.istioEnabled" .) "true" -}} apiVersion: networking.istio.io/v1beta1 kind: Sidecar metadata: - name: {{ include "entity.name" . }} + name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} spec: workloadSelector: labels: - app: {{ include "entity.name" . }} + app: {{ include "common.entity.name" . }} outboundTrafficPolicy: mode: ALLOW_ANY {{- end -}} \ No newline at end of file diff --git a/charts/portal/tests/__snapshot__/istio_test.yaml.snap b/charts/portal/tests/__snapshot__/istio_test.yaml.snap index 25f5b37c9..749ad78d9 100644 --- a/charts/portal/tests/__snapshot__/istio_test.yaml.snap +++ b/charts/portal/tests/__snapshot__/istio_test.yaml.snap @@ -92,59 +92,6 @@ matches the snapshot: deletionPolicy: Retain name: portal-client-secret-portal 3: | - apiVersion: networking.istio.io/v1alpha3 - kind: DestinationRule - metadata: - name: RELEASE-NAME-portal - namespace: NAMESPACE - spec: - host: RELEASE-NAME-portal.NAMESPACE.svc.cluster.local - trafficPolicy: - tls: - mode: ISTIO_MUTUAL - 4: | - apiVersion: security.istio.io/v1beta1 - kind: PeerAuthentication - metadata: - name: RELEASE-NAME-portal - namespace: NAMESPACE - spec: - mtls: - mode: STRICT - selector: - matchLabels: - app: RELEASE-NAME-portal - 5: | - apiVersion: networking.istio.io/v1alpha3 - kind: VirtualService - metadata: - name: RELEASE-NAME-portal - namespace: NAMESPACE - spec: - gateways: - - NAMESPACE/gateway - hosts: - - portal.example.com - - portal.portal.example.com - - portal2.example.com - - portal.portal2.example.com - http: - - corsPolicy: - allowHeaders: - - Authorization - - Content-Type - - '*' - allowMethods: - - GET - - POST - - PUT - - DELETE - route: - - destination: - host: RELEASE-NAME-portal.NAMESPACE.svc.cluster.local - port: - number: 8080 - 6: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -158,7 +105,7 @@ matches the snapshot: - get - watch - list - 7: | + 4: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -171,7 +118,7 @@ matches the snapshot: - kind: ServiceAccount name: RELEASE-NAME-portal namespace: NAMESPACE - 8: | + 5: | apiVersion: v1 imagePullSecrets: - name: github @@ -179,7 +126,7 @@ matches the snapshot: metadata: name: RELEASE-NAME-portal namespace: NAMESPACE - 9: | + 6: | apiVersion: v1 kind: Service metadata: @@ -193,18 +140,6 @@ matches the snapshot: selector: app: RELEASE-NAME-portal type: ClusterIP - 10: | - apiVersion: networking.istio.io/v1beta1 - kind: Sidecar - metadata: - name: RELEASE-NAME-portal - namespace: NAMESPACE - spec: - outboundTrafficPolicy: - mode: ALLOW_ANY - workloadSelector: - labels: - app: RELEASE-NAME-portal matches the snapshot with istio disabled: 1: | apiVersion: apps/v1 diff --git a/charts/portal/tests/istio-virtual_service_test.yaml b/charts/portal/tests/istio-virtual_service_test.yaml index 478bfe100..2d302f27a 100644 --- a/charts/portal/tests/istio-virtual_service_test.yaml +++ b/charts/portal/tests/istio-virtual_service_test.yaml @@ -5,5 +5,9 @@ values: - ../test-values.yaml tests: - it: virtual service match the snapshot + set: + global: + istio: + enabled: true asserts: - matchSnapshot: {} diff --git a/charts/portal/tests/istio_test.yaml b/charts/portal/tests/istio_test.yaml index e5f10aa9e..fe1897498 100644 --- a/charts/portal/tests/istio_test.yaml +++ b/charts/portal/tests/istio_test.yaml @@ -4,6 +4,9 @@ chart: appVersion: 1.0.0 tests: - it: matches the snapshot + set: + istio: + enabled: false values: - ../test-values.yaml asserts: