Skip to content

Commit 5a61778

Browse files
committed
Add ubi mode
Signed-off-by: Tamal Saha <[email protected]>
1 parent 83567b9 commit 5a61778

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+253
-31
lines changed

apis/installer/v1alpha1/types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ type NetworkPolicySpec struct {
104104
Enabled bool `json:"enabled"`
105105
}
106106

107+
// +kubebuilder:validation:Enum=all;catalog;operator
108+
type UBIMode string
109+
107110
type DistroSpec struct {
108-
Openshift bool `json:"openshift"`
111+
Openshift bool `json:"openshift"`
112+
UBI UBIMode `json:"ubi"`
109113
}

charts/kubedb-autoscaler/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ The following table lists the configurable parameters of the `kubedb-autoscaler`
9090
| recommender.cpuHistogramDecayHalfLife | | <code>"5m0s"</code> |
9191
| maxConcurrentReconciles | The maximum number of concurrent reconciles which can be run | <code>0</code> |
9292
| distro.openshift | | <code>false</code> |
93+
| distro.ubi | | <code>""</code> |
9394

9495

9596
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:

charts/kubedb-autoscaler/templates/_helpers.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,27 @@ Returns the registry used for operator docker image
8787
{{- list .Values.registryFQDN .Values.operator.registry | compact | join "/" }}
8888
{{- end }}
8989

90+
{{/*
91+
Returns the image tag used for operator docker image
92+
*/}}
93+
{{- define "operator.tag" -}}
94+
{{- .Values.operator.tag | default .Chart.AppVersion }}{{ ternary "-ubi" "" (list "operator" "all" | has .Values.distro.ubi) }}
95+
{{- end }}
96+
9097
{{/*
9198
Returns the registry used for waitfor docker image
9299
*/}}
93100
{{- define "waitfor.registry" -}}
94101
{{- list .Values.registryFQDN .Values.waitfor.registry | compact | join "/" }}
95102
{{- end }}
96103

104+
{{/*
105+
Returns the image tag used for waitfor docker image
106+
*/}}
107+
{{- define "waitfor.tag" -}}
108+
{{- .Values.waitfor.tag }}{{ ternary "-ubi" "" (list "operator" "all" | has .Values.distro.ubi) }}
109+
{{- end }}
110+
97111
{{- define "docker.imagePullSecrets" -}}
98112
{{- with .Values.imagePullSecrets -}}
99113
imagePullSecrets:

charts/kubedb-autoscaler/templates/statefulset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ spec:
5858
{{- if and .Values.global .Values.global.waitForWebhook }}
5959
initContainers:
6060
- name: wait
61-
image: {{ include "waitfor.registry" . }}/{{ .Values.waitfor.repository }}:{{ .Values.waitfor.tag }}
61+
image: {{ include "waitfor.registry" . }}/{{ .Values.waitfor.repository }}:{{ include "waitfor.tag" . }}
6262
imagePullPolicy: {{ .Values.imagePullPolicy }}
6363
command:
6464
- /bin/sh
@@ -84,7 +84,7 @@ spec:
8484
securityContext:
8585
{{- toYaml .Values.operator.securityContext | nindent 10 }}
8686
{{- end }}
87-
image: {{ include "operator.registry" . }}/{{ .Values.operator.repository }}:{{ .Values.operator.tag | default .Chart.AppVersion }}
87+
image: {{ include "operator.registry" . }}/{{ .Values.operator.repository }}:{{ include "operator.tag" . }}
8888
imagePullPolicy: {{ .Values.imagePullPolicy }}
8989
args:
9090
- operator

charts/kubedb-autoscaler/values.openapiv3_schema.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,8 +1316,15 @@ properties:
13161316
properties:
13171317
openshift:
13181318
type: boolean
1319+
ubi:
1320+
enum:
1321+
- all
1322+
- catalog
1323+
- operator
1324+
type: string
13191325
required:
13201326
- openshift
1327+
- ubi
13211328
type: object
13221329
fullnameOverride:
13231330
type: string

charts/kubedb-autoscaler/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,4 @@ maxConcurrentReconciles: 0
132132

133133
distro:
134134
openshift: false
135+
ubi: ""

charts/kubedb-crd-manager/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ The following table lists the configurable parameters of the `kubedb-crd-manager
9393
| removeUnusedCRDs | | <code>false</code> |
9494
| installGitOpsCRDs | | <code>false</code> |
9595
| distro.openshift | | <code>false</code> |
96+
| distro.ubi | | <code>""</code> |
9697

9798

9899
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:

charts/kubedb-crd-manager/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ Returns the registry used for image docker image
8888
{{- list .Values.registryFQDN .Values.image.registry | compact | join "/" }}
8989
{{- end }}
9090

91+
{{/*
92+
Returns the image tag used for operator docker image
93+
*/}}
94+
{{- define "image.tag" -}}
95+
{{- .Values.image.tag | default .Chart.AppVersion }}{{ ternary "-ubi" "" (list "operator" "all" | has .Values.distro.ubi) }}
96+
{{- end }}
97+
9198
{{- define "docker.imagePullSecrets" -}}
9299
{{- with .Values.imagePullSecrets -}}
93100
imagePullSecrets:

charts/kubedb-crd-manager/templates/job.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spec:
6565
securityContext:
6666
{{- toYaml .Values.securityContext | nindent 12 }}
6767
{{- end }}
68-
image: "{{ include "image.registry" . }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
68+
image: {{ include "image.registry" . }}/{{ .Values.image.repository }}:{{ include "image.tag" . }}
6969
imagePullPolicy: {{ .Values.imagePullPolicy }}
7070
args:
7171
- run
@@ -86,7 +86,7 @@ spec:
8686
securityContext:
8787
{{- toYaml .Values.securityContext | nindent 12 }}
8888
{{- end }}
89-
image: "{{ include "image.registry" . }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
89+
image: {{ include "image.registry" . }}/{{ .Values.image.repository }}:{{ include "image.tag" . }}
9090
imagePullPolicy: {{ .Values.imagePullPolicy }}
9191
args:
9292
- verify

charts/kubedb-crd-manager/values.openapiv3_schema.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,8 +1293,15 @@ properties:
12931293
properties:
12941294
openshift:
12951295
type: boolean
1296+
ubi:
1297+
enum:
1298+
- all
1299+
- catalog
1300+
- operator
1301+
type: string
12961302
required:
12971303
- openshift
1304+
- ubi
12981305
type: object
12991306
featureGates:
13001307
additionalProperties:

0 commit comments

Comments
 (0)