Skip to content

Commit

Permalink
Registry fix (#56)
Browse files Browse the repository at this point in the history
* registry fix for CN

* EOF fix

* registry lint fix

* revert .Version

* revert test values

* values scheme update

* Update helm/teleport-kube-agent/templates/delete_hook.yaml

Co-authored-by: Puru <5674762+tuladhar@users.noreply.github.com>

* fix teleport version

* CHANGELOG

---------

Co-authored-by: Puru <5674762+tuladhar@users.noreply.github.com>
  • Loading branch information
ssyno and tuladhar committed Jun 19, 2024
1 parent 439fde2 commit bbba002
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Changed the way registry is being parsed in helm templates

## [0.9.0] - 2024-04-18

### Added
Expand Down
8 changes: 8 additions & 0 deletions helm/teleport-kube-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ if serviceAccount is not defined or serviceAccount.name is empty, use .Release.N
{{- define "teleport-kube-agent.image" -}}
{{ include "teleport-kube-agent.baseImage" . }}:{{ include "teleport-kube-agent.version" . }}
{{- end -}}
{{- define "registry" }}
{{- $registry := .Values.image.registry -}}
{{- if and .Values.global (and .Values.global.image .Values.global.image.registry) -}}
{{- $registry = .Values.global.image.registry -}}
{{- end -}}
{{- printf "%s" $registry -}}
{{- end -}}
2 changes: 1 addition & 1 deletion helm/teleport-kube-agent/templates/delete_hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ spec:
fieldPath: metadata.namespace
- name: RELEASE_NAME
value: {{ .Release.Name }}
image: {{ include "teleport-kube-agent.image" . | quote }}
image: '{{ include "registry" . }}/{{ .Values.image.repository }}:{{ include "teleport-kube-agent.version" . }}'
{{- if .Values.imagePullPolicy }}
imagePullPolicy: {{ toYaml .Values.imagePullPolicy }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion helm/teleport-kube-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spec:
{{- end }}
containers:
- name: "teleport"
image: {{ include "teleport-kube-agent.image" . | quote }}
image: '{{ include "registry" . }}/{{ .Values.image.repository }}:{{ include "teleport-kube-agent.version" . }}'
{{- if .Values.imagePullPolicy }}
imagePullPolicy: {{ toYaml .Values.imagePullPolicy }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion helm/teleport-kube-agent/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spec:
{{- end }}
containers:
- name: "teleport"
image: {{ include "teleport-kube-agent.image" . | quote }}
image: '{{ include "registry" . }}/{{ .Values.image.repository }}:{{ include "teleport-kube-agent.version" . }}'
{{- if .Values.imagePullPolicy }}
imagePullPolicy: {{ toYaml .Values.imagePullPolicy }}
{{- end }}
Expand Down
7 changes: 6 additions & 1 deletion helm/teleport-kube-agent/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,15 @@
"$id": "#/properties/image",
"type": "object",
"properties": {
"registry": {
"$id": "#/properties/image/registry",
"type": "string",
"default": "public.ecr.aws"
},
"repository": {
"$id": "#/properties/image/repository",
"type": "string",
"default": "public.ecr.aws/gravitational/teleport-distroless"
"default": "gravitational/teleport-distroless"
}
}
},
Expand Down
5 changes: 4 additions & 1 deletion helm/teleport-kube-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ global:
podSecurityStandards:
enforced: false

image:
registry: ""
# roles(string) -- is a comma-separated list of services which will be enabled
# when running the `teleport-kube-agent` chart.
#
Expand Down Expand Up @@ -799,7 +801,8 @@ adminClusterRoleBinding:
# When running an enterprise version, you must use
# [`enterpriseImage`](#enterpriseImage) instead.
image:
repository: gsoci.azurecr.io/giantswarm/teleport-distroless
registry: &registry gsoci.azurecr.io
repository: giantswarm/teleport-distroless

# enterpriseImage(string) -- sets the container image used for Teleport Enterprise
# agent pods created by the chart.
Expand Down

0 comments on commit bbba002

Please sign in to comment.