From 70b8201c8a5264850722f752942bf842de7862da Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Sun, 20 Nov 2022 22:15:51 +0200 Subject: [PATCH] fix probes --- .../pod/deployment_contaner_probe_test.yaml | 51 +++++++++---------- .../tests/pod/utils_primary_port_test.yaml | 6 +-- .../tests/pod/utils_primary_service_test.yaml | 6 +-- .../templates/lib/controller/_container.tpl | 3 +- 4 files changed, 32 insertions(+), 34 deletions(-) diff --git a/library/common-test/tests/pod/deployment_contaner_probe_test.yaml b/library/common-test/tests/pod/deployment_contaner_probe_test.yaml index 039fb179..1adf8982 100644 --- a/library/common-test/tests/pod/deployment_contaner_probe_test.yaml +++ b/library/common-test/tests/pod/deployment_contaner_probe_test.yaml @@ -9,9 +9,9 @@ tests: - documentIndex: &deploymentDoc 0 isKind: of: Deployment - - equal: - path: spec.template.spec.containers[0].probes - value: + - isSubset: + path: spec.template.spec.containers[0] + content: livenessProbe: httpGet: path: / @@ -201,7 +201,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: /path @@ -229,7 +229,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.readinessProbe + path: spec.template.spec.containers[0].readinessProbe value: httpGet: path: /path @@ -257,7 +257,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.startupProbe + path: spec.template.spec.containers[0].startupProbe value: httpGet: path: /path @@ -281,7 +281,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: / @@ -305,7 +305,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: / @@ -329,7 +329,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: tcpSocket: port: 999999 @@ -346,7 +346,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: tcpSocket: port: 999999 @@ -369,7 +369,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: /some_path @@ -394,7 +394,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: / @@ -420,7 +420,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: / @@ -445,7 +445,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: / @@ -472,7 +472,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: / @@ -498,7 +498,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: /ping @@ -519,7 +519,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: / @@ -540,7 +540,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: tcpSocket: port: 1234 @@ -562,7 +562,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: tcpSocket: port: 999999 @@ -579,7 +579,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: grpc: port: 999999 @@ -601,7 +601,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: exec: command: @@ -628,7 +628,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: exec: command: @@ -650,7 +650,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: exec: command: @@ -670,7 +670,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: exec: command: @@ -680,7 +680,6 @@ tests: timeoutSeconds: 5 periodSeconds: 10 - - it: should pass with with probe type exec single command and custom timings set: probes: @@ -695,7 +694,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: exec: command: diff --git a/library/common-test/tests/pod/utils_primary_port_test.yaml b/library/common-test/tests/pod/utils_primary_port_test.yaml index cb3d81f5..34011b4f 100644 --- a/library/common-test/tests/pod/utils_primary_port_test.yaml +++ b/library/common-test/tests/pod/utils_primary_port_test.yaml @@ -12,7 +12,7 @@ tests: of: Deployment - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: / @@ -37,7 +37,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: tcpSocket: port: 999999 @@ -64,7 +64,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: tcpSocket: port: 12345 diff --git a/library/common-test/tests/pod/utils_primary_service_test.yaml b/library/common-test/tests/pod/utils_primary_service_test.yaml index 073d2a1b..658ec1e0 100644 --- a/library/common-test/tests/pod/utils_primary_service_test.yaml +++ b/library/common-test/tests/pod/utils_primary_service_test.yaml @@ -12,7 +12,7 @@ tests: of: Deployment - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: httpGet: path: / @@ -51,7 +51,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: tcpSocket: port: 999999 @@ -79,7 +79,7 @@ tests: asserts: - equal: documentIndex: *deploymentDoc - path: spec.template.spec.containers[0].probes.livenessProbe + path: spec.template.spec.containers[0].livenessProbe value: tcpSocket: port: 12345 diff --git a/library/common/1.0.0/templates/lib/controller/_container.tpl b/library/common/1.0.0/templates/lib/controller/_container.tpl index 4dfc1380..dc93d6c5 100644 --- a/library/common/1.0.0/templates/lib/controller/_container.tpl +++ b/library/common/1.0.0/templates/lib/controller/_container.tpl @@ -52,8 +52,7 @@ So it can work on multiple places, like additional containers and not only the m {{- . | nindent 4 }} {{- end -}} {{- with (include "ix.v1.common.container.probes" . | trim) }} - probes: - {{- . | nindent 4 }} + {{- . | nindent 2 }} {{- end -}} {{- with (include "ix.v1.common.container.resources" (dict "resources" .Values.resources "SCALE" .Values.scaleGPU) | trim) }} resources: