Skip to content

Add option to make disable imperative #519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clustergroup/templates/imperative/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if not (eq .Values.enabled "plumbing") }}
{{- if $.Values.clusterGroup.imperative.enabled }}
{{/* This is always defined as we always unseal the cluster with an imperative job */}}
{{- if $.Values.clusterGroup.imperative.serviceAccountCreate }}
---
@@ -34,4 +35,5 @@ rules:
verbs:
- '*'
{{- end }} {{/* if $.Values.clusterGroup.imperative.adminServiceAccountCreate */}}
{{- end }} {{/* if $.Values.clusterGroup.imperative.enabled */}}
{{- end }}
2 changes: 2 additions & 0 deletions clustergroup/templates/imperative/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if not (eq .Values.enabled "plumbing") }}
{{- if $.Values.clusterGroup.imperative.enabled }}
{{/* This is always defined as we always unseal the cluster with an imperative job */}}
{{- $valuesyaml := toYaml $.Values -}}
apiVersion: v1
@@ -18,4 +19,5 @@ metadata:
annotations:
labels:
config.openshift.io/inject-trusted-cabundle: 'true'
{{- end }} {{/* if $.Values.clusterGroup.imperative.enabled */}}
{{- end }}
2 changes: 2 additions & 0 deletions clustergroup/templates/imperative/job.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- $hasInitContainerCapability := and (.Values.global.experimentalCapabilities) (has "initcontainers" (splitList "," .Values.global.experimentalCapabilities)) }}

{{- if not (eq .Values.enabled "plumbing") }}
{{- if $.Values.clusterGroup.imperative.enabled }}
{{/* Define this if needed (jobs defined */}}
{{- if (and $.Values.clusterGroup.imperative (gt (len $.Values.clusterGroup.imperative.jobs) 0)) -}}
---
@@ -77,4 +78,5 @@ spec:
{{- end }}
restartPolicy: Never
{{- end }}
{{- end }} {{/* if $.Values.clusterGroup.imperative.enabled */}}
{{- end }}
2 changes: 2 additions & 0 deletions clustergroup/templates/imperative/namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if not (eq .Values.enabled "plumbing") }}
{{- if $.Values.clusterGroup.imperative.enabled }}
{{/* This is always defined as we always unseal the cluster with an imperative job */}}
apiVersion: v1
kind: Namespace
@@ -7,4 +8,5 @@ metadata:
name: {{ $.Values.clusterGroup.imperative.namespace }}
argocd.argoproj.io/managed-by: {{ $.Values.global.pattern }}-{{ $.Values.clusterGroup.name }}
name: {{ $.Values.clusterGroup.imperative.namespace }}
{{- end }} {{/* if $.Values.clusterGroup.imperative.enabled */}}
{{- end }}
2 changes: 2 additions & 0 deletions clustergroup/templates/imperative/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if not (eq .Values.enabled "plumbing") }}
{{- if $.Values.clusterGroup.imperative.enabled }}
{{/* This is always defined as we always unseal the cluster with an imperative job */}}
{{- if $.Values.clusterGroup.imperative.serviceAccountCreate -}}
---
@@ -44,4 +45,5 @@ subjects:
name: {{ $.Values.clusterGroup.imperative.adminServiceAccountName }}
namespace: {{ $.Values.clusterGroup.imperative.namespace }}
{{- end }}
{{- end }} {{/* if $.Values.clusterGroup.imperative.enabled */}}
{{- end }}
2 changes: 2 additions & 0 deletions clustergroup/templates/imperative/role.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if not (eq .Values.enabled "plumbing") }}
{{- if $.Values.clusterGroup.imperative.enabled }}
{{/* This is always defined as we always unseal the cluster with an imperative job */}}
---
apiVersion: rbac.authorization.k8s.io/v1
@@ -17,4 +18,5 @@ rules:
verbs:
- '*'
{{- end }}
{{- end }} {{/* if $.Values.clusterGroup.imperative.enabled */}}
{{- end }}
2 changes: 2 additions & 0 deletions clustergroup/templates/imperative/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if not (eq .Values.enabled "plumbing") }}
{{- if $.Values.clusterGroup.imperative.enabled }}
{{/* This is always defined as we always unseal the cluster with an imperative job */}}
{{- if $.Values.clusterGroup.imperative.serviceAccountCreate }}
apiVersion: v1
@@ -15,4 +16,5 @@ metadata:
name: {{ $.Values.clusterGroup.imperative.adminServiceAccountName }}
namespace: {{ $.Values.clusterGroup.imperative.namespace }}
{{- end }}
{{- end }} {{/* if $.Values.clusterGroup.imperative.enabled */}}
{{- end }}
2 changes: 2 additions & 0 deletions clustergroup/templates/imperative/unsealjob.yaml
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
why we avoid using the default function */}}
{{- if or (eq .Values.global.secretStore.backend "vault") (not (hasKey .Values.global.secretStore "backend")) }}
{{- if not (eq .Values.enabled "plumbing") }}
{{- if $.Values.clusterGroup.imperative.enabled }}
{{- if $.Values.clusterGroup.isHubCluster }}
---
apiVersion: batch/v1
@@ -70,5 +71,6 @@ spec:
{{- end }}
restartPolicy: Never
{{- end }}
{{- end }} {{/* if $.Values.clusterGroup.imperative.enabled */}}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions clustergroup/values.schema.json
Original file line number Diff line number Diff line change
@@ -606,6 +606,10 @@
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"jobs": {
"type": "array",
"items": {
1 change: 1 addition & 0 deletions clustergroup/values.yaml
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ clusterGroup:
configManagementPlugins: []

imperative:
enabled: true
jobs: []
# This image contains ansible + kubernetes.core by default and is used to run the jobs
image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel9:latest
1 change: 1 addition & 0 deletions tests/clustergroup-industrial-edge-factory.expected.yaml
Original file line number Diff line number Diff line change
@@ -129,6 +129,7 @@ data:
clusterRoleName: imperative-cluster-role
clusterRoleYaml: ""
cronJobName: imperative-cronjob
enabled: true
image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel9:latest
imagePullPolicy: Always
insecureUnsealVaultInsideClusterSchedule: '*/5 * * * *'
1 change: 1 addition & 0 deletions tests/clustergroup-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
@@ -250,6 +250,7 @@ data:
clusterRoleName: imperative-cluster-role
clusterRoleYaml: ""
cronJobName: imperative-cronjob
enabled: true
image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel9:latest
imagePullPolicy: Always
insecureUnsealVaultInsideClusterSchedule: '*/5 * * * *'
1 change: 1 addition & 0 deletions tests/clustergroup-medical-diagnosis-hub.expected.yaml
Original file line number Diff line number Diff line change
@@ -233,6 +233,7 @@ data:
clusterRoleName: imperative-cluster-role
clusterRoleYaml: ""
cronJobName: imperative-cronjob
enabled: true
image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel9:latest
imagePullPolicy: Always
insecureUnsealVaultInsideClusterSchedule: '*/5 * * * *'
1 change: 1 addition & 0 deletions tests/clustergroup-naked.expected.yaml
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ data:
clusterRoleName: imperative-cluster-role
clusterRoleYaml: ""
cronJobName: imperative-cronjob
enabled: true
image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel9:latest
imagePullPolicy: Always
insecureUnsealVaultInsideClusterSchedule: '*/5 * * * *'
1 change: 1 addition & 0 deletions tests/clustergroup-normal.expected.yaml
Original file line number Diff line number Diff line change
@@ -141,6 +141,7 @@ data:
clusterRoleName: imperative-cluster-role
clusterRoleYaml: ""
cronJobName: imperative-cronjob
enabled: true
image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel9:latest
imagePullPolicy: Always
insecureUnsealVaultInsideClusterSchedule: '*/5 * * * *'
Loading