From 31907b9e23f1a26e1f7dd9d22843651bbf0324ec Mon Sep 17 00:00:00 2001 From: Damien Dassieu Date: Fri, 31 May 2024 13:03:12 +0200 Subject: [PATCH] Adapt chart --- chart/0.0.1/templates/certmanager/certificate.yaml | 6 +++--- .../templates/config/bitbucket-configuration.yaml | 4 +++- .../templates/config/github-configuration.yaml | 4 +++- .../templates/config/gitlab-configuration.yaml | 4 +++- chart/0.0.1/templates/controller/manager.yaml | 4 ++-- .../templates/crd/kgio.dams.kgio_gitremotes.yaml | 6 ++++-- chart/0.0.1/templates/webhook/webhook-service.yaml | 4 ++-- chart/0.0.1/templates/webhook/webhook.yaml | 4 ++-- chart/0.0.1/values.yaml | 14 ++++++++------ 9 files changed, 30 insertions(+), 20 deletions(-) diff --git a/chart/0.0.1/templates/certmanager/certificate.yaml b/chart/0.0.1/templates/certmanager/certificate.yaml index ab417dc..85e3a50 100644 --- a/chart/0.0.1/templates/certmanager/certificate.yaml +++ b/chart/0.0.1/templates/certmanager/certificate.yaml @@ -25,12 +25,12 @@ metadata: name: operator-webhook-cert spec: dnsNames: - - {{ .Values.webhook.services.crd }}.{{ .Release.Namespace }}.svc - - {{ .Values.webhook.services.crd }}.{{ .Release.Namespace }}.svc.cluster.local + - webhook-crd-service.{{ .Release.Namespace }}.svc + - webhook-crd-service.{{ .Release.Namespace }}.svc.cluster.local - webhook-pusher-service.{{ .Release.Namespace }}.svc - webhook-pusher-service.{{ .Release.Namespace }}.svc.cluster.local issuerRef: kind: Issuer name: {{ .Release.Name }}-selfsigned-issuer - secretName: {{ .Values.webhook.certificate.secret }} + secretName: {{ .Values.webhook.certmanager.certificate.secret }} {{- end }} \ No newline at end of file diff --git a/chart/0.0.1/templates/config/bitbucket-configuration.yaml b/chart/0.0.1/templates/config/bitbucket-configuration.yaml index 9bb8558..b3f5434 100644 --- a/chart/0.0.1/templates/config/bitbucket-configuration.yaml +++ b/chart/0.0.1/templates/config/bitbucket-configuration.yaml @@ -1,6 +1,8 @@ +{{- if eq .Values.configuration.bitbucket true }} apiVersion: v1 kind: ConfigMap metadata: name: bitbucket.org data: - authenticationEndpoint: https://api.bitbucket.org/2.0/user \ No newline at end of file + authenticationEndpoint: https://api.bitbucket.org/2.0/user +{{- end }} \ No newline at end of file diff --git a/chart/0.0.1/templates/config/github-configuration.yaml b/chart/0.0.1/templates/config/github-configuration.yaml index f511b2c..9b1600a 100644 --- a/chart/0.0.1/templates/config/github-configuration.yaml +++ b/chart/0.0.1/templates/config/github-configuration.yaml @@ -1,6 +1,8 @@ +{{- if eq .Values.configuration.github true }} apiVersion: v1 kind: ConfigMap metadata: name: github.com data: - authenticationEndpoint: https://api.github.com/user \ No newline at end of file + authenticationEndpoint: https://api.github.com/user +{{- end }} \ No newline at end of file diff --git a/chart/0.0.1/templates/config/gitlab-configuration.yaml b/chart/0.0.1/templates/config/gitlab-configuration.yaml index 02da1ca..258ed8f 100644 --- a/chart/0.0.1/templates/config/gitlab-configuration.yaml +++ b/chart/0.0.1/templates/config/gitlab-configuration.yaml @@ -1,6 +1,8 @@ +{{- if eq .Values.configuration.gitlab true }} apiVersion: v1 kind: ConfigMap metadata: name: gitlab.com data: - authenticationEndpoint: https://gitlab.com/api/v4/user \ No newline at end of file + authenticationEndpoint: https://gitlab.com/api/v4/user +{{- end }} \ No newline at end of file diff --git a/chart/0.0.1/templates/controller/manager.yaml b/chart/0.0.1/templates/controller/manager.yaml index fd5ff1a..dc8c114 100644 --- a/chart/0.0.1/templates/controller/manager.yaml +++ b/chart/0.0.1/templates/controller/manager.yaml @@ -46,7 +46,7 @@ spec: - "--health-probe-bind-address=:8081" - "--metrics-bind-address={{ .Values.controller.metrics.bindAddress }}" {{- end }} - image: {{ .Values.imagePrefix }}/{{ .Chart.Name }}:{{ .Chart.Version }} + image: {{ .Values.controller.imagePrefix }}/{{ .Chart.Name }}:{{ .Chart.Version }} env: - name: MANAGER_NAMESPACE valueFrom: @@ -87,4 +87,4 @@ spec: - name: cert secret: defaultMode: 420 - secretName: {{ .Values.webhook.certificate.secret }} \ No newline at end of file + secretName: {{ .Values.webhook.certmanager.certificate.secret }} \ No newline at end of file diff --git a/chart/0.0.1/templates/crd/kgio.dams.kgio_gitremotes.yaml b/chart/0.0.1/templates/crd/kgio.dams.kgio_gitremotes.yaml index 5c7620c..34be928 100644 --- a/chart/0.0.1/templates/crd/kgio.dams.kgio_gitremotes.yaml +++ b/chart/0.0.1/templates/crd/kgio.dams.kgio_gitremotes.yaml @@ -40,7 +40,7 @@ spec: spec: description: GitRemoteSpec defines the desired state of GitRemote properties: - customGitProviderConfigRef: + customGitServerConfigRef: description: |- Reference to a ConfigMap to configuration the behavior of the GitRemote connexion with the distant server @@ -92,6 +92,8 @@ spec: type: string gitBaseDomainFQDN: type: string + insecureSkipTlsVerify: + type: boolean secretRef: description: |- SecretReference represents a Secret Reference. It has enough information to retrieve secret @@ -124,7 +126,7 @@ spec: status: type: string type: object - gitProviderConfiguration: + gitServerConfiguration: properties: authenticationEndpoint: type: string diff --git a/chart/0.0.1/templates/webhook/webhook-service.yaml b/chart/0.0.1/templates/webhook/webhook-service.yaml index 3ce90ac..18a9638 100644 --- a/chart/0.0.1/templates/webhook/webhook-service.yaml +++ b/chart/0.0.1/templates/webhook/webhook-service.yaml @@ -3,11 +3,11 @@ kind: Service metadata: labels: app.kubernetes.io/name: service - app.kubernetes.io/instance: {{ .Values.webhook.services.crd }} + app.kubernetes.io/instance: webhook-crd-service app.kubernetes.io/component: webhook app.kubernetes.io/created-by: {{ .Release.Name }} app.kubernetes.io/part-of: {{ .Release.Name }} - name: {{ .Values.webhook.services.crd }} + name: webhook-crd-service spec: ports: - port: 443 diff --git a/chart/0.0.1/templates/webhook/webhook.yaml b/chart/0.0.1/templates/webhook/webhook.yaml index 8225bf0..f3a768b 100644 --- a/chart/0.0.1/templates/webhook/webhook.yaml +++ b/chart/0.0.1/templates/webhook/webhook.yaml @@ -12,7 +12,7 @@ webhooks: - v1 clientConfig: service: - name: {{ .Values.webhook.services.crd }} + name: webhook-crd-service namespace: {{ .Release.Namespace }} path: /validate-kgio-dams-kgio-v1-gitremote failurePolicy: Fail @@ -32,7 +32,7 @@ webhooks: - v1 clientConfig: service: - name: {{ .Values.webhook.services.crd }} + name: webhook-crd-service namespace: {{ .Release.Namespace }} path: /validate-kgio-dams-kgio-v1-resourcesinterceptor failurePolicy: Fail diff --git a/chart/0.0.1/values.yaml b/chart/0.0.1/values.yaml index f078a16..711b832 100644 --- a/chart/0.0.1/values.yaml +++ b/chart/0.0.1/values.yaml @@ -1,13 +1,12 @@ webhook: certmanager: enable: true - certificate: - name: webhook-cert - secret: webhook-server-cert - services: - crd: webhook-crd-service + certificate: + name: webhook-cert + secret: webhook-server-cert controller: + imagePrefix: ghcr.io/damsien securityContext: runAsUser: 1000 allowPrivilegeEscalation: false @@ -57,4 +56,7 @@ monitoring: installCRD: true -imagePrefix: ghcr.io/damsien +configuration: + gitlab: true + github: true + bitbucket: true