Add teleport agent update
This commit is contained in:
@@ -7,8 +7,8 @@ tests:
|
||||
template: statefulset.yaml
|
||||
values:
|
||||
- ../.lint/stateful.yaml
|
||||
elease:
|
||||
isupgrade: true
|
||||
release:
|
||||
upgrade: true
|
||||
asserts:
|
||||
- isKind:
|
||||
of: StatefulSet
|
||||
@@ -179,30 +179,36 @@ tests:
|
||||
- matchSnapshot:
|
||||
path: spec.template.spec
|
||||
|
||||
- it: should set SecurityContext
|
||||
- it: should set a restricted-friendly SecurityContext by default
|
||||
template: statefulset.yaml
|
||||
values:
|
||||
- ../.lint/stateful.yaml
|
||||
- ../.lint/initcontainers.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
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
readOnlyRootFilesystem: true
|
||||
runAsNonRoot: true
|
||||
runAsUser: 9807
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
- 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
|
||||
path: spec.template.spec.initContainers[0].securityContext
|
||||
value:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
readOnlyRootFilesystem: true
|
||||
runAsNonRoot: true
|
||||
runAsUser: 9807
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
|
||||
- it: should set image and tag correctly
|
||||
template: statefulset.yaml
|
||||
@@ -217,6 +223,37 @@ tests:
|
||||
- matchSnapshot:
|
||||
path: spec.template.spec
|
||||
|
||||
- it: should have only one container when no `extraContainers` is set in values
|
||||
template: statefulset.yaml
|
||||
set:
|
||||
extraContainers: []
|
||||
proxyAddr: helm-lint.example.com
|
||||
kubeClusterName: helm-lint.example.com
|
||||
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: statefulset.yaml
|
||||
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
|
||||
template: statefulset.yaml
|
||||
values:
|
||||
@@ -372,7 +409,7 @@ tests:
|
||||
- it: should not add emptyDir for data when using StatefulSet
|
||||
template: statefulset.yaml
|
||||
release:
|
||||
isupgrade: true
|
||||
upgrade: true
|
||||
set:
|
||||
unitTestUpgrade: true
|
||||
values:
|
||||
@@ -404,11 +441,11 @@ tests:
|
||||
values:
|
||||
- ../.lint/stateful.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
|
||||
release:
|
||||
isupgrade: true
|
||||
upgrade: true
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.volumeClaimTemplates[0].spec
|
||||
@@ -420,7 +457,7 @@ tests:
|
||||
values:
|
||||
- ../.lint/stateful.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
|
||||
release:
|
||||
@@ -435,9 +472,9 @@ tests:
|
||||
values:
|
||||
- ../.lint/stateful.yaml
|
||||
release:
|
||||
isupgrade: true
|
||||
upgrade: true
|
||||
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
|
||||
|
||||
@@ -455,11 +492,11 @@ tests:
|
||||
values:
|
||||
- ../.lint/stateful.yaml
|
||||
release:
|
||||
isupgrade: true
|
||||
upgrade: true
|
||||
set:
|
||||
storage:
|
||||
requests: 256Mi
|
||||
# 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
|
||||
asserts:
|
||||
@@ -469,6 +506,46 @@ tests:
|
||||
- matchSnapshot:
|
||||
path: spec.template.spec
|
||||
|
||||
- it: should mount jamfCredentialsSecret.name when role is jamf
|
||||
template: statefulset.yaml
|
||||
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
|
||||
template: statefulset.yaml
|
||||
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
|
||||
template: statefulset.yaml
|
||||
values:
|
||||
@@ -525,7 +602,6 @@ tests:
|
||||
- matchSnapshot:
|
||||
path: spec.template.spec
|
||||
|
||||
|
||||
- it: should set serviceAccountName when set in values
|
||||
template: statefulset.yaml
|
||||
values:
|
||||
@@ -594,7 +670,7 @@ tests:
|
||||
values:
|
||||
- ../.lint/stateful.yaml
|
||||
set:
|
||||
storage:
|
||||
storage:
|
||||
enabled: false
|
||||
asserts:
|
||||
- contains:
|
||||
@@ -624,12 +700,12 @@ tests:
|
||||
- it: should generate Statefulset when storage is disabled and mode is a Upgrade
|
||||
template: statefulset.yaml
|
||||
release:
|
||||
isupgrade: true
|
||||
upgrade: true
|
||||
values:
|
||||
- ../.lint/stateful.yaml
|
||||
set:
|
||||
unitTestUpgrade: false
|
||||
storage:
|
||||
unitTestUpgrade: true
|
||||
storage:
|
||||
enabled: false
|
||||
asserts:
|
||||
- contains:
|
||||
@@ -682,14 +758,20 @@ tests:
|
||||
- it: should enable maintenance schedule export when updater is enabled
|
||||
template: statefulset.yaml
|
||||
values:
|
||||
- ../.lint/existing-tls-secret-with-ca.yaml
|
||||
- ../.lint/updater.yaml
|
||||
set:
|
||||
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
|
||||
|
||||
- it: should set the installation method environment variable
|
||||
template: statefulset.yaml
|
||||
|
||||
Reference in New Issue
Block a user