diff --git a/charts/selenium-grid/configs/node/nodePreStop.sh b/charts/selenium-grid/configs/node/nodePreStop.sh index dded38676..7b6397b6d 100644 --- a/charts/selenium-grid/configs/node/nodePreStop.sh +++ b/charts/selenium-grid/configs/node/nodePreStop.sh @@ -1,6 +1,13 @@ #!/bin/bash +if [ ! -z "${SE_REGISTRATION_SECRET}" ]; +then + HEADERS="X-REGISTRATION-SECRET: ${SE_REGISTRATION_SECRET}" +else + HEADERS="X-REGISTRATION-SECRET;" +fi + if curl -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status; then - curl -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' + curl -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header "${HEADERS}" while curl -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status; do sleep 1; done else echo "Node is already drained. Shutting down gracefully!" diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index d30a6d800..ce7a49b48 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -177,7 +177,7 @@ Secret TLS fullname Is registration secret enabled */}} {{- define "seleniumGrid.tls.registrationSecret.enabled" -}} -{{- and .Values.tls.enabled .Values.tls.registrationSecret.enabled | ternary "true" "" -}} +{{- .Values.tls.registrationSecret.enabled | ternary "true" "" -}} {{- end -}} {{/* diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index f915d12c6..5d365c100 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -517,7 +517,7 @@ autoscaling: scaledJobOptions: scalingStrategy: # Change this to "accurate" when the calculation problem is fixed - strategy: default + strategy: accurate # Number of Completed jobs should be kept successfulJobsHistoryLimit: 0 # Number of Failed jobs should be kept (for troubleshooting purposes) diff --git a/tests/charts/ci/JobAutoscaling-values.yaml b/tests/charts/ci/JobAutoscaling-values.yaml index 35742e41a..ad8fe12f3 100644 --- a/tests/charts/ci/JobAutoscaling-values.yaml +++ b/tests/charts/ci/JobAutoscaling-values.yaml @@ -3,7 +3,7 @@ isolateComponents: false autoscaling: enableWithExistingKEDA: true scalingType: job - strategy: default + strategy: accurate scaledOptions: minReplicaCount: 0 maxReplicaCount: 5 diff --git a/tests/charts/refValues/sample-aws.yaml b/tests/charts/refValues/sample-aws.yaml index 097eb4277..88f9c7f58 100644 --- a/tests/charts/refValues/sample-aws.yaml +++ b/tests/charts/refValues/sample-aws.yaml @@ -44,7 +44,7 @@ autoscaling: successfulJobsHistoryLimit: 0 failedJobsHistoryLimit: 5 scalingStrategy: - strategy: default + strategy: accurate hub: subPath: *gridAppRoot diff --git a/tests/charts/refValues/simplex-minikube.yaml b/tests/charts/refValues/simplex-minikube.yaml index a67b0bbf2..109d91750 100644 --- a/tests/charts/refValues/simplex-minikube.yaml +++ b/tests/charts/refValues/simplex-minikube.yaml @@ -56,7 +56,7 @@ autoscaling: successfulJobsHistoryLimit: 0 failedJobsHistoryLimit: 5 scalingStrategy: - strategy: default + strategy: accurate hub: subPath: *gridAppRoot