Skip to content

Commit 5ba30c6

Browse files
authored
Build ubi image (#244)
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent e474baf commit 5ba30c6

33 files changed

+188
-48
lines changed

apis/installer/v1alpha1/kubestash_operator_types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,12 @@ type SeccompSpec struct {
205205
Enabled bool `json:"enabled"`
206206
}
207207

208+
// +kubebuilder:validation:Enum=all;catalog;operator
209+
type UBIMode string
210+
208211
type DistroSpec struct {
209-
Openshift bool `json:"openshift"`
212+
Openshift bool `json:"openshift"`
213+
UBI UBIMode `json:"ubi"`
210214
}
211215

212216
type NetVolAccessor struct {

charts/kubestash-catalog/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ The following table lists the configurable parameters of the `kubestash-catalog`
5757
| volumesnapshot.enabled | If true, deploys VolumeSnapshot addon | <code>true</code> |
5858
| workload.enabled | If true, deploys Workload addon | <code>true</code> |
5959
| manifest.enabled | If true, deploys Manifest addon | <code>true</code> |
60+
| distro.openshift | Set true, if installed in OpenShift | <code>false</code> |
61+
| distro.ubi | Set operator or all to use ubi images | <code>""</code> |
6062

6163

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

charts/kubestash-catalog/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,10 @@ Create the name of the service account to use
6565
{{- define "image.ghcr" -}}
6666
{{ list .Values.proxies.ghcr ._repo | compact | join "/" }}
6767
{{- end }}
68+
69+
{{/*
70+
Returns if ubi images are to be used
71+
*/}}
72+
{{- define "catalog.ubi" -}}
73+
{{ ternary "-ubi" "" (list "catalog" "all" | has .Values.distro.ubi) }}
74+
{{- end }}

charts/kubestash-catalog/templates/kubedump/kubedump-backup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ spec:
1919
- --exclude-namespaces=${ExcludeNamespaces:=}
2020
- --include-resources=${IncludeResources:=}
2121
- --exclude-resources=${ExcludeResources:=}
22-
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/kubedump") $) }}:v0.20.0'
22+
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/kubedump") $) }}:v0.20.0{{ include "catalog.ubi" $ }}'
2323
{{ end }}
2424

charts/kubestash-catalog/templates/kubedump/kubedump-restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ spec:
2323
- --override-resources=${OverrideResources:=}
2424
- --storage-class-mappings=${StorageClassMappings:=}
2525
- --restore-pvs=${RestorePVs:=}
26-
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/kubedump") $) }}:v0.20.0'
26+
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/kubedump") $) }}:v0.20.0{{ include "catalog.ubi" $ }}'
2727
{{ end }}
2828

charts/kubestash-catalog/templates/manifest/manifest-backup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ spec:
1313
- --enable-cache=${enableCache:=}
1414
- --scratch-dir=${scratchDir:=}
1515
- --include-rbac-resources=${includeRBACResources:=}
16-
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/manifest") $) }}:v0.13.0'
16+
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/manifest") $) }}:v0.13.0{{ include "catalog.ubi" $ }}'
1717
{{ end }}
1818

charts/kubestash-catalog/templates/manifest/manifest-restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ spec:
1515
- --scratch-dir=${scratchDir:=}
1616
- --include-rbac-resources=${includeRBACResources:=}
1717
- --override-resources=${overrideResources:=}
18-
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/manifest") $) }}:v0.13.0'
18+
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/manifest") $) }}:v0.13.0{{ include "catalog.ubi" $ }}'
1919
{{ end }}
2020

charts/kubestash-catalog/templates/pvc/pvc-backup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ spec:
1414
- --scratch-dir=${scratchDir:=}
1515
- --exclude=${exclude:=}
1616
- --paths=${paths:=}
17-
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/pvc") $) }}:v0.20.0'
17+
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/pvc") $) }}:v0.20.0{{ include "catalog.ubi" $ }}'
1818
{{ end }}
1919

charts/kubestash-catalog/templates/pvc/pvc-restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ spec:
1313
- --snapshot=${snapshot:=}
1414
- --enable-cache=${enableCache:=}
1515
- --scratch-dir=${scratchDir:=}
16-
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/pvc") $) }}:v0.20.0'
16+
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/pvc") $) }}:v0.20.0{{ include "catalog.ubi" $ }}'
1717
{{ end }}
1818

charts/kubestash-catalog/templates/volumesnapshot/volumesnapshot-backup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ spec:
1111
- --namespace=${namespace:=default}
1212
- --backupsession=${backupSession:=}
1313
- --volume-snapshot-class-name=${volumeSnapshotClassName:=}
14-
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/volume-snapshotter") $) }}:v0.20.0'
14+
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubestash/volume-snapshotter") $) }}:v0.20.0{{ include "catalog.ubi" $ }}'
1515
{{ end }}
1616

0 commit comments

Comments
 (0)