mirror of
https://github.com/gravitational/teleport.git
synced 2026-10-30 18:29:21 +08:00
kube-agent-updater fixes (#24468)
* helm: set TELEPORT_EXT_UPGRADER when updater is enabled * integrations/updater: exit when agent name or namespace is missing
This commit is contained in:
@@ -119,8 +119,12 @@ spec:
|
||||
{{- if .Values.imagePullPolicy }}
|
||||
imagePullPolicy: {{ toYaml .Values.imagePullPolicy }}
|
||||
{{- end }}
|
||||
{{- if or .Values.extraEnv .Values.tls.existingCASecretName }}
|
||||
{{- if or .Values.extraEnv .Values.tls.existingCASecretName .Values.updater.enabled }}
|
||||
env:
|
||||
{{- if .Values.updater.enabled }}
|
||||
- name: TELEPORT_EXT_UPGRADER
|
||||
value: kube
|
||||
{{- end }}
|
||||
{{- if (gt (len .Values.extraEnv) 0) }}
|
||||
{{- toYaml .Values.extraEnv | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -132,6 +132,10 @@ spec:
|
||||
fieldPath: metadata.namespace
|
||||
- name: RELEASE_NAME
|
||||
value: {{ .Release.Name }}
|
||||
{{- if .Values.updater.enabled }}
|
||||
- name: TELEPORT_EXT_UPGRADER
|
||||
value: kube
|
||||
{{- end }}
|
||||
{{- if .Values.tls.existingCASecretName }}
|
||||
- name: SSL_CERT_FILE
|
||||
value: /etc/teleport-tls-ca/ca.pem
|
||||
|
||||
@@ -678,3 +678,15 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].securityContext
|
||||
value: null
|
||||
|
||||
- it: should enable maintenance schedule export when updater is enabled
|
||||
template: statefulset.yaml
|
||||
values:
|
||||
- ../.lint/existing-tls-secret-with-ca.yaml
|
||||
- ../.lint/updater.yaml
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: TELEPORT_EXT_UPGRADER
|
||||
value: kube
|
||||
|
||||
@@ -84,9 +84,11 @@ func main() {
|
||||
|
||||
if agentName == "" {
|
||||
ctrl.Log.Error(trace.BadParameter("--agent-name empty"), "agent-name must be provided")
|
||||
os.Exit(1)
|
||||
}
|
||||
if agentNamespace == "" {
|
||||
ctrl.Log.Error(trace.BadParameter("--agent-namespace empty"), "agent-namespace must be provided")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
|
||||
|
||||
Reference in New Issue
Block a user