Add teleport agent update

This commit is contained in:
Jonny Ervine
2024-08-15 22:45:43 +08:00
parent c0d65a0afb
commit b76e232ac2
143 changed files with 15355 additions and 676 deletions
+142 -46
View File
@@ -8,7 +8,7 @@ tests:
- it: creates a Deployment if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -22,7 +22,7 @@ tests:
- it: sets Deployment labels when specified if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -40,7 +40,7 @@ tests:
- it: sets Pod labels when specified if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -58,7 +58,7 @@ tests:
- it: sets Deployment annotations when specified if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -75,7 +75,7 @@ tests:
- it: sets Pod annotations when specified if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -93,7 +93,7 @@ tests:
- it: should have one replica when replicaCount is not set if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -108,7 +108,7 @@ tests:
- it: should have multiple replicas when replicaCount is set (using .replicaCount, deprecated) if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
replicaCount: 3
@@ -141,7 +141,7 @@ tests:
- it: should set affinity when set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -157,7 +157,7 @@ tests:
values:
- ../.lint/backwards-compatibility.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
@@ -181,7 +181,7 @@ tests:
values:
- ../.lint/backwards-compatibility.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
@@ -202,7 +202,7 @@ tests:
- it: should set tolerations when set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -216,7 +216,7 @@ tests:
- it: should set resources when set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -240,38 +240,31 @@ tests:
- it: should set SecurityContext if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
- ../.lint/backwards-compatibility.yaml
asserts:
- equal:
path: spec.template.spec.containers[0].securityContext.allowPrivilegeEscalation
value: false
- equal:
path: spec.template.spec.containers[0].securityContext.capabilities
path: spec.template.spec.containers[0].securityContext
value:
drop:
- all
- equal:
path: spec.template.spec.containers[0].securityContext.readOnlyRootFilesystem
value: true
- equal:
path: spec.template.spec.containers[0].securityContext.runAsNonRoot
value: true
- equal:
path: spec.template.spec.containers[0].securityContext.runAsUser
value: 9807
- matchSnapshot:
path: spec.template.spec
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 9807
seccompProfile:
type: RuntimeDefault
- it: should set image and tag correctly if action is Upgrade
template: deployment.yaml
values:
- ../.lint/backwards-compatibility.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
@@ -283,10 +276,44 @@ tests:
- matchSnapshot:
path: spec.template.spec
- it: should have only one container when no `extraContainers` is set in values
template: deployment.yaml
set:
extraContainers: []
proxyAddr: helm-lint.example.com
kubeClusterName: helm-lint.example.com
unitTestUpgrade: true
asserts:
- isNotNull:
path: spec.template.spec.containers[0]
- isNull:
path: spec.template.spec.containers[1]
- it: should add one more container when `extraContainers` is set in values
template: deployment.yaml
set:
unitTestUpgrade: true
values:
- ../.lint/extra-containers.yaml
asserts:
- equal:
path: spec.template.spec.containers[1]
value:
name: nscenter
command:
- /bin/bash
- -c
- sleep infinity & wait
image: praqma/network-multitool
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
runAsNonRoot: false
- it: should mount extraVolumes and extraVolumeMounts if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -311,7 +338,7 @@ tests:
values:
- ../.lint/backwards-compatibility.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
@@ -326,7 +353,7 @@ tests:
- it: should set environment when extraEnv set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
@@ -348,7 +375,7 @@ tests:
- it: should provision initContainer correctly when set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -383,7 +410,7 @@ tests:
values:
- ../.lint/backwards-compatibility.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
@@ -398,7 +425,7 @@ tests:
- it: should expose diag port if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -416,7 +443,7 @@ tests:
- it: should set nodeSelector if set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -432,7 +459,7 @@ tests:
- it: should add emptyDir for data when existingDataVolume is not set if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -454,7 +481,7 @@ tests:
- it: should correctly configure existingDataVolume when set if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -473,10 +500,58 @@ tests:
- matchSnapshot:
path: spec.template.spec
- it: should mount jamfCredentialsSecret.name when role is jamf and action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
- ../.lint/jamf-service.yaml
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: jamf-api-credentials
secret:
secretName: teleport-jamf-api-credentials
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
mountPath: /etc/teleport-jamf-api-credentials
name: jamf-api-credentials
readOnly: true
- matchSnapshot:
path: spec.template.spec
- it: should mount jamfCredentialsSecret if it already exists and when role is jamf and action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
- ../.lint/jamf-service-existing-secret.yaml
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: jamf-api-credentials
secret:
secretName: existing-teleport-jamf-secret
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
mountPath: /etc/teleport-jamf-api-credentials
name: jamf-api-credentials
readOnly: true
- matchSnapshot:
path: spec.template.spec
- it: should mount tls.existingCASecretName and set environment when set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -505,7 +580,7 @@ tests:
- it: should mount tls.existingCASecretName and set extra environment when set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -540,7 +615,7 @@ tests:
- it: should set priorityClassName when set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -555,7 +630,7 @@ tests:
- it: should set not set priorityClassName when not set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -569,7 +644,7 @@ tests:
- it: should set serviceAccountName when set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -584,7 +659,7 @@ tests:
- it: should set default serviceAccountName when not set in values if action is Upgrade
template: deployment.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
values:
@@ -685,3 +760,24 @@ tests:
- equal:
path: spec.template.spec.containers[0].securityContext
value: null
- it: should enable maintenance schedule export when updater is enabled if action is Upgrade
template: deployment.yaml
values:
- ../.lint/updater.yaml
set:
# unit test does not support lookup functions, so to test the behavior we use this undoc value
# https://github.com/helm/helm/issues/8137
unitTestUpgrade: true
teleportVersionOverride: 13.4.5
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: TELEPORT_EXT_UPGRADER
value: kube
- contains:
path: spec.template.spec.containers[0].env
content:
name: TELEPORT_EXT_UPGRADER_VERSION
value: 13.4.5