Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Allow custom image names for OSM Helm chart #4595

Merged
merged 1 commit into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions charts/osm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ The following table lists the configurable parameters of the osm chart and their
| osm.image.digest.osmInjector | string | `""` | osm-injector's image digest |
| osm.image.digest.osmPreinstall | string | `""` | osm-preinstall's image digest |
| osm.image.digest.osmSidecarInit | string | `""` | Sidecar init container's image digest |
| osm.image.name | object | `{"osmBootstrap":"osm-bootstrap","osmCRDs":"osm-crds","osmController":"osm-controller","osmHealthcheck":"osm-healthcheck","osmInjector":"osm-injector","osmPreinstall":"osm-preinstall","osmSidecarInit":"init"}` | Image name defaults |
| osm.image.name.osmBootstrap | string | `"osm-bootstrap"` | osm-boostrap's image name |
| osm.image.name.osmCRDs | string | `"osm-crds"` | osm-crds' image name |
| osm.image.name.osmController | string | `"osm-controller"` | osm-controller's image name |
| osm.image.name.osmHealthcheck | string | `"osm-healthcheck"` | osm-healthcheck's image name |
| osm.image.name.osmInjector | string | `"osm-injector"` | osm-injector's image name |
| osm.image.name.osmPreinstall | string | `"osm-preinstall"` | osm-preinstall's image name |
| osm.image.name.osmSidecarInit | string | `"init"` | Sidecar init container's image name |
| osm.image.pullPolicy | string | `"IfNotPresent"` | Container image pull policy for control plane containers |
| osm.image.registry | string | `"openservicemesh"` | Container image registry for control plane images |
| osm.image.tag | string | `"latest-main"` | Container image tag for control plane images |
Expand Down
28 changes: 14 additions & 14 deletions charts/osm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,62 +43,62 @@ securityContext:
{{/* osm-controller image */}}
{{- define "osmController.image" -}}
{{- if .Values.osm.image.tag -}}
{{- printf "%s/osm-controller:%s" .Values.osm.image.registry .Values.osm.image.tag -}}
{{- printf "%s/%s:%s" .Values.osm.image.registry .Values.osm.image.name.osmController .Values.osm.image.tag -}}
{{- else -}}
{{- printf "%s/osm-controller@%s" .Values.osm.image.registry .Values.osm.image.digest.osmController -}}
{{- printf "%s/%s@%s" .Values.osm.image.registry .Values.osm.image.name.osmController .Values.osm.image.digest.osmController -}}
{{- end -}}
{{- end -}}

{{/* osm-injector image */}}
{{- define "osmInjector.image" -}}
{{- if .Values.osm.image.tag -}}
{{- printf "%s/osm-injector:%s" .Values.osm.image.registry .Values.osm.image.tag -}}
{{- printf "%s/%s:%s" .Values.osm.image.registry .Values.osm.image.name.osmInjector .Values.osm.image.tag -}}
{{- else -}}
{{- printf "%s/osm-injector@%s" .Values.osm.image.registry .Values.osm.image.digest.osmInjector -}}
{{- printf "%s/%s@%s" .Values.osm.image.registry .Values.osm.image.name.osmInjector .Values.osm.image.digest.osmInjector -}}
{{- end -}}
{{- end -}}

{{/* Sidecar init image */}}
{{- define "osmSidecarInit.image" -}}
{{- if .Values.osm.image.tag -}}
{{- printf "%s/init:%s" .Values.osm.image.registry .Values.osm.image.tag -}}
{{- printf "%s/%s:%s" .Values.osm.image.registry .Values.osm.image.name.osmSidecarInit .Values.osm.image.tag -}}
{{- else -}}
{{- printf "%s/init@%s" .Values.osm.image.registry .Values.osm.image.digest.osmSidecarInit -}}
{{- printf "%s/%s@%s" .Values.osm.image.registry .Values.osm.image.name.osmSidecarInit .Values.osm.image.digest.osmSidecarInit -}}
{{- end -}}
{{- end -}}

{{/* osm-bootstrap image */}}
{{- define "osmBootstrap.image" -}}
{{- if .Values.osm.image.tag -}}
{{- printf "%s/osm-bootstrap:%s" .Values.osm.image.registry .Values.osm.image.tag -}}
{{- printf "%s/%s:%s" .Values.osm.image.registry .Values.osm.image.name.osmBootstrap .Values.osm.image.tag -}}
{{- else -}}
{{- printf "%s/osm-bootstrap@%s" .Values.osm.image.registry .Values.osm.image.digest.osmBootstrap -}}
{{- printf "%s/%s@%s" .Values.osm.image.registry .Values.osm.image.name.osmBootstrap .Values.osm.image.digest.osmBootstrap -}}
{{- end -}}
{{- end -}}

{{/* osm-crds image */}}
{{- define "osmCRDs.image" -}}
{{- if .Values.osm.image.tag -}}
{{- printf "%s/osm-crds:%s" .Values.osm.image.registry .Values.osm.image.tag -}}
{{- printf "%s/%s:%s" .Values.osm.image.registry .Values.osm.image.name.osmCRDs .Values.osm.image.tag -}}
{{- else -}}
{{- printf "%s/osm-crds@%s" .Values.osm.image.registry .Values.osm.image.digest.osmCRDs -}}
{{- printf "%s/%s@%s" .Values.osm.image.registry .Values.osm.image.name.osmCRDs .Values.osm.image.digest.osmCRDs -}}
{{- end -}}
{{- end -}}

{{/* osm-preinstall image */}}
{{- define "osmPreinstall.image" -}}
{{- if .Values.osm.image.tag -}}
{{- printf "%s/osm-preinstall:%s" .Values.osm.image.registry .Values.osm.image.tag -}}
{{- printf "%s/%s:%s" .Values.osm.image.registry .Values.osm.image.name.osmPreinstall .Values.osm.image.tag -}}
{{- else -}}
{{- printf "%s/osm-preinstall@%s" .Values.osm.image.registry .Values.osm.image.digest.osmPreinstall -}}
{{- printf "%s/%s@%s" .Values.osm.image.registry .Values.osm.image.name.osmPreinstall .Values.osm.image.digest.osmPreinstall -}}
{{- end -}}
{{- end -}}

{{/* osm-healthcheck image */}}
{{- define "osmHealthcheck.image" -}}
{{- if .Values.osm.image.tag -}}
{{- printf "%s/osm-healthcheck:%s" .Values.osm.image.registry .Values.osm.image.tag -}}
{{- printf "%s/%s:%s" .Values.osm.image.registry .Values.osm.image.name.osmHealthcheck .Values.osm.image.tag -}}
{{- else -}}
{{- printf "%s/osm-healthcheck@%s" .Values.osm.image.registry .Values.osm.image.digest.osmHealthcheck -}}
{{- printf "%s/%s@%s" .Values.osm.image.registry .Values.osm.image.name.osmHealthcheck .Values.osm.image.digest.osmHealthcheck -}}
{{- end -}}
{{- end -}}
60 changes: 60 additions & 0 deletions charts/osm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
],
"required": [
"registry",
"name",
"pullPolicy",
"tag",
"digest"
Expand All @@ -264,6 +265,65 @@
"openservicemesh"
]
},
"name": {
"$id": "#/properties/osm/properties/image/properties/name",
"type": "object",
"title": "Default image names",
"description": "Default image names for control plane.",
"required": [
"osmController",
"osmInjector",
"osmSidecarInit",
"osmBootstrap",
"osmCRDs",
"osmPreinstall",
"osmHealthcheck"
],
"properties": {
"osmController": {
"$id": "#/properties/osm/properties/image/properties/name/properties/osmController",
"type": "string",
"title": "osm-controller's image names",
"description": "osm-controller container's image names."
},
"osmInjector": {
"$id": "#/properties/osm/properties/image/properties/name/properties/osmInjector",
"type": "string",
"title": "osm-injector's image name",
"description": "osm-injector container's image name."
},
"osmSidecarInit": {
"$id": "#/properties/osm/properties/image/properties/name/properties/osmSidecarInit",
"type": "string",
"title": "osm-osmSidecarInit's image name",
"description": "osm-osmSidecarInit container's image name."
},
"osmBootstrap": {
"$id": "#/properties/osm/properties/image/properties/name/properties/osmBootstrap",
"type": "string",
"title": "osm-boostrap's image name",
"description": "osm-bootstrap container's image name."
},
"osmCRDs": {
"$id": "#/properties/osm/properties/image/properties/name/properties/osmCRDs",
"type": "string",
"title": "osm-crds' image name",
"description": "osm-crds container's image name."
},
"osmPreinstall": {
"$id": "#/properties/osm/properties/image/properties/name/properties/osmPreinstall",
"type": "string",
"title": "osm-preinstall's image name",
"description": "osm-preinstall container's image name."
},
"osmHealthcheck": {
"$id": "#/properties/osm/properties/image/properties/name/properties/osmHealthcheck",
"type": "string",
"title": "osm-healthcheck's image name",
"description": "osm-healthcheck container's image name."
}
}
},
"pullPolicy": {
"$id": "#/properties/osm/properties/image/properties/pullPolicy",
"type": "string",
Expand Down
16 changes: 16 additions & 0 deletions charts/osm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ osm:
pullPolicy: IfNotPresent
# -- Container image tag for control plane images
tag: "latest-main"
# -- Image name defaults
name:
# -- osm-controller's image name
osmController: osm-controller
# -- osm-injector's image name
osmInjector: osm-injector
# -- Sidecar init container's image name
osmSidecarInit: init
# -- osm-boostrap's image name
osmBootstrap: osm-bootstrap
# -- osm-crds' image name
osmCRDs: osm-crds
# -- osm-preinstall's image name
osmPreinstall: osm-preinstall
# -- osm-healthcheck's image name
osmHealthcheck: osm-healthcheck
# -- Image digest (defaults to latest compatible tag)
digest:
# -- osm-controller's image digest
Expand Down