From a4ec280c7b9cb15b5c9e1b8e00460b3e34cd20fd Mon Sep 17 00:00:00 2001 From: mikhail-klimko Date: Wed, 19 Jun 2024 23:04:13 +0300 Subject: [PATCH] fix: reconcile-runtime sidecar container drift (#461) --- .gitignore | 3 + charts/cf-runtime/.ci/values-ci.yaml | 2 +- charts/cf-runtime/Chart.yaml | 6 +- charts/cf-runtime/README.md | 18 +++--- charts/cf-runtime/files/reconcile-runtime.sh | 2 - .../runtime/runtime-env-spec-tmpl.yaml | 57 ++++++++++++------- .../private_registry_test.yaml | 38 ++++++------- .../tests/runtime/runtime_onprem_test.yaml | 45 ++++++++------- .../tests/runtime/runtime_onprem_values.yaml | 3 +- .../tests/runtime/runtime_test.yaml | 42 +++++++------- .../tests/runtime/runtime_values.yaml | 4 +- charts/cf-runtime/values.yaml | 12 ++-- 12 files changed, 127 insertions(+), 105 deletions(-) diff --git a/.gitignore b/.gitignore index 320eaabb..390e68c5 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,6 @@ venona/venona # coverage **/cover + +# debug +**/debug \ No newline at end of file diff --git a/charts/cf-runtime/.ci/values-ci.yaml b/charts/cf-runtime/.ci/values-ci.yaml index 28753499..6e4dc8a4 100644 --- a/charts/cf-runtime/.ci/values-ci.yaml +++ b/charts/cf-runtime/.ci/values-ci.yaml @@ -34,7 +34,7 @@ runtime: cpu: 1000m memory: 1024Mi env: - DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: "true" + DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: true engine: podLabels: key: engine diff --git a/charts/cf-runtime/Chart.yaml b/charts/cf-runtime/Chart.yaml index 17ef6aaf..34a2b8a2 100644 --- a/charts/cf-runtime/Chart.yaml +++ b/charts/cf-runtime/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A Helm chart for Codefresh Runner name: cf-runtime -version: 6.3.33 +version: 6.3.34 keywords: - codefresh - runner @@ -17,8 +17,8 @@ annotations: artifacthub.io/containsSecurityUpdates: "false" # Supported kinds: `added`, `changed`, `deprecated`, `removed`, `fixed`, `security`: artifacthub.io/changes: | - - kind: changed - description: Upgrade cf-container-logger to v1.11.4 + - kind: fixed + description: Fix reconcile-runtime sidecar container drift in runner deployment dependencies: - name: cf-common repository: oci://quay.io/codefresh/charts diff --git a/charts/cf-runtime/README.md b/charts/cf-runtime/README.md index 92be11c1..f7e69710 100644 --- a/charts/cf-runtime/README.md +++ b/charts/cf-runtime/README.md @@ -1,6 +1,6 @@ ## Codefresh Runner -![Version: 6.3.33](https://img.shields.io/badge/Version-6.3.33-informational?style=flat-square) +![Version: 6.3.34](https://img.shields.io/badge/Version-6.3.34-informational?style=flat-square) Helm chart for deploying [Codefresh Runner](https://codefresh.io/docs/docs/installation/codefresh-runner/) to Kubernetes. @@ -1121,9 +1121,9 @@ Go to [https:///admin/runtime-environments/system](http | runtime.accounts | list | `[]` | (for On-Premise only) Assign accounts to runtime (list of account ids) | | runtime.agent | bool | `true` | (for On-Premise only) Enable agent | | runtime.description | string | `""` | Runtime description | -| runtime.dind | object | `{"affinity":{},"env":{"DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE":"true"},"image":{"pullPolicy":"IfNotPresent","registry":"quay.io","repository":"codefresh/dind","tag":"26.0.0-1.28.6"},"nodeSelector":{},"podAnnotations":{},"podLabels":{},"pvcs":{"dind":{"name":"dind","reuseVolumeSelector":"codefresh-app,io.codefresh.accountName","reuseVolumeSortOrder":"pipeline_id","storageClassName":"{{ include \"dind-volume-provisioner.storageClassName\" . }}","volumeSize":"16Gi"}},"resources":{"limits":{"cpu":"400m","memory":"800Mi"},"requests":null},"schedulerName":"","serviceAccount":"codefresh-engine","tolerations":[],"userAccess":true,"userVolumeMounts":{},"userVolumes":{}}` | Parameters for DinD (docker-in-docker) pod (aka "runtime" pod). | +| runtime.dind | object | `{"affinity":{},"env":{"DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE":true},"image":{"pullPolicy":"IfNotPresent","registry":"quay.io","repository":"codefresh/dind","tag":"26.0.0-1.28.6"},"nodeSelector":{},"podAnnotations":{},"podLabels":{},"pvcs":{"dind":{"name":"dind","reuseVolumeSelector":"codefresh-app,io.codefresh.accountName","reuseVolumeSortOrder":"pipeline_id","storageClassName":"{{ include \"dind-volume-provisioner.storageClassName\" . }}","volumeSize":"16Gi"}},"resources":{"limits":{"cpu":"400m","memory":"800Mi"},"requests":null},"schedulerName":"","serviceAccount":"codefresh-engine","tolerations":[],"userAccess":true,"userVolumeMounts":{},"userVolumes":{}}` | Parameters for DinD (docker-in-docker) pod (aka "runtime" pod). | | runtime.dind.affinity | object | `{}` | Set affinity | -| runtime.dind.env | object | `{"DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE":"true"}` | Set additional env vars. | +| runtime.dind.env | object | `{"DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE":true}` | Set additional env vars. | | runtime.dind.image | object | `{"pullPolicy":"IfNotPresent","registry":"quay.io","repository":"codefresh/dind","tag":"26.0.0-1.28.6"}` | Set dind image. | | runtime.dind.nodeSelector | object | `{}` | Set node selector. | | runtime.dind.podAnnotations | object | `{}` | Set pod annotations. | @@ -1142,15 +1142,15 @@ Go to [https:///admin/runtime-environments/system](http | runtime.dind.userVolumeMounts | object | `{}` | Add extra volume mounts | | runtime.dind.userVolumes | object | `{}` | Add extra volumes | | runtime.dindDaemon | object | See below | DinD pod daemon config | -| runtime.engine | object | `{"affinity":{},"command":["npm","run","start"],"env":{"CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS":"1000","FORCE_COMPOSE_SERIAL_PULL":"false","LOGGER_LEVEL":"debug","LOG_OUTGOING_HTTP_REQUESTS":"false","METRICS_PROMETHEUS_ENABLED":"true"},"image":{"pullPolicy":"IfNotPresent","registry":"quay.io","repository":"codefresh/engine","tag":"1.170.0"},"nodeSelector":{},"podAnnotations":{},"podLabels":{},"resources":{"limits":{"cpu":"1000m","memory":"2048Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"runtimeImages":{"COMPOSE_IMAGE":"quay.io/codefresh/compose:v2.20.3-1.4.0","CONTAINER_LOGGER_IMAGE":"quay.io/codefresh/cf-container-logger:1.11.4","CR_6177_FIXER":"quay.io/codefresh/alpine:edge","DOCKER_BUILDER_IMAGE":"quay.io/codefresh/cf-docker-builder:1.3.11","DOCKER_PULLER_IMAGE":"quay.io/codefresh/cf-docker-puller:8.0.17","DOCKER_PUSHER_IMAGE":"quay.io/codefresh/cf-docker-pusher:6.0.15","DOCKER_TAG_PUSHER_IMAGE":"quay.io/codefresh/cf-docker-tag-pusher:1.3.13","FS_OPS_IMAGE":"quay.io/codefresh/fs-ops:1.2.3","GC_BUILDER_IMAGE":"quay.io/codefresh/cf-gc-builder:0.5.3","GIT_CLONE_IMAGE":"quay.io/codefresh/cf-git-cloner:10.1.26","KUBE_DEPLOY":"quay.io/codefresh/cf-deploy-kubernetes:16.1.11","PIPELINE_DEBUGGER_IMAGE":"quay.io/codefresh/cf-debugger:1.3.0","TEMPLATE_ENGINE":"quay.io/codefresh/pikolo:0.14.0"},"schedulerName":"","serviceAccount":"codefresh-engine","tolerations":[],"userEnvVars":[],"workflowLimits":{"MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS":600,"MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION":86400,"MAXIMUM_ELECTED_STATE_AGE_ALLOWED":900,"MAXIMUM_RETRY_ATTEMPTS_ALLOWED":20,"MAXIMUM_TERMINATING_STATE_AGE_ALLOWED":900,"MAXIMUM_TERMINATING_STATE_AGE_ALLOWED_WITHOUT_UPDATE":300,"TIME_ENGINE_INACTIVE_UNTIL_TERMINATION":300,"TIME_ENGINE_INACTIVE_UNTIL_UNHEALTHY":60,"TIME_INACTIVE_UNTIL_TERMINATION":2700}}` | Parameters for Engine pod (aka "pipeline" orchestrator). | +| runtime.engine | object | `{"affinity":{},"command":["npm","run","start"],"env":{"CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS":1000,"FORCE_COMPOSE_SERIAL_PULL":false,"LOGGER_LEVEL":"debug","LOG_OUTGOING_HTTP_REQUESTS":false,"METRICS_PROMETHEUS_ENABLED":true},"image":{"pullPolicy":"IfNotPresent","registry":"quay.io","repository":"codefresh/engine","tag":"1.170.0"},"nodeSelector":{},"podAnnotations":{},"podLabels":{},"resources":{"limits":{"cpu":"1000m","memory":"2048Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"runtimeImages":{"COMPOSE_IMAGE":"quay.io/codefresh/compose:v2.20.3-1.4.0","CONTAINER_LOGGER_IMAGE":"quay.io/codefresh/cf-container-logger:1.11.4","CR_6177_FIXER":"quay.io/codefresh/alpine:edge","DOCKER_BUILDER_IMAGE":"quay.io/codefresh/cf-docker-builder:1.3.11","DOCKER_PULLER_IMAGE":"quay.io/codefresh/cf-docker-puller:8.0.17","DOCKER_PUSHER_IMAGE":"quay.io/codefresh/cf-docker-pusher:6.0.15","DOCKER_TAG_PUSHER_IMAGE":"quay.io/codefresh/cf-docker-tag-pusher:1.3.13","FS_OPS_IMAGE":"quay.io/codefresh/fs-ops:1.2.3","GC_BUILDER_IMAGE":"quay.io/codefresh/cf-gc-builder:0.5.3","GIT_CLONE_IMAGE":"quay.io/codefresh/cf-git-cloner:10.1.26","KUBE_DEPLOY":"quay.io/codefresh/cf-deploy-kubernetes:16.1.11","PIPELINE_DEBUGGER_IMAGE":"quay.io/codefresh/cf-debugger:1.3.0","TEMPLATE_ENGINE":"quay.io/codefresh/pikolo:0.14.0"},"schedulerName":"","serviceAccount":"codefresh-engine","tolerations":[],"userEnvVars":[],"workflowLimits":{"MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS":600,"MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION":86400,"MAXIMUM_ELECTED_STATE_AGE_ALLOWED":900,"MAXIMUM_RETRY_ATTEMPTS_ALLOWED":20,"MAXIMUM_TERMINATING_STATE_AGE_ALLOWED":900,"MAXIMUM_TERMINATING_STATE_AGE_ALLOWED_WITHOUT_UPDATE":300,"TIME_ENGINE_INACTIVE_UNTIL_TERMINATION":300,"TIME_ENGINE_INACTIVE_UNTIL_UNHEALTHY":60,"TIME_INACTIVE_UNTIL_TERMINATION":2700}}` | Parameters for Engine pod (aka "pipeline" orchestrator). | | runtime.engine.affinity | object | `{}` | Set affinity | | runtime.engine.command | list | `["npm","run","start"]` | Set container command. | -| runtime.engine.env | object | `{"CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS":"1000","FORCE_COMPOSE_SERIAL_PULL":"false","LOGGER_LEVEL":"debug","LOG_OUTGOING_HTTP_REQUESTS":"false","METRICS_PROMETHEUS_ENABLED":"true"}` | Set additional env vars. | -| runtime.engine.env.CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS | string | `"1000"` | Interval to check the exec status in the container-logger | -| runtime.engine.env.FORCE_COMPOSE_SERIAL_PULL | string | `"false"` | If "true", composition images will be pulled sequentially | +| runtime.engine.env | object | `{"CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS":1000,"FORCE_COMPOSE_SERIAL_PULL":false,"LOGGER_LEVEL":"debug","LOG_OUTGOING_HTTP_REQUESTS":false,"METRICS_PROMETHEUS_ENABLED":true}` | Set additional env vars. | +| runtime.engine.env.CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS | int | `1000` | Interval to check the exec status in the container-logger | +| runtime.engine.env.FORCE_COMPOSE_SERIAL_PULL | bool | `false` | If "true", composition images will be pulled sequentially | | runtime.engine.env.LOGGER_LEVEL | string | `"debug"` | Level of logging for engine | -| runtime.engine.env.LOG_OUTGOING_HTTP_REQUESTS | string | `"false"` | Enable debug-level logging of outgoing HTTP/HTTPS requests | -| runtime.engine.env.METRICS_PROMETHEUS_ENABLED | string | `"true"` | Enable emitting metrics from engine | +| runtime.engine.env.LOG_OUTGOING_HTTP_REQUESTS | bool | `false` | Enable debug-level logging of outgoing HTTP/HTTPS requests | +| runtime.engine.env.METRICS_PROMETHEUS_ENABLED | bool | `true` | Enable emitting metrics from engine | | runtime.engine.image | object | `{"pullPolicy":"IfNotPresent","registry":"quay.io","repository":"codefresh/engine","tag":"1.170.0"}` | Set image. | | runtime.engine.nodeSelector | object | `{}` | Set node selector. | | runtime.engine.podAnnotations | object | `{}` | Set pod annotations. | diff --git a/charts/cf-runtime/files/reconcile-runtime.sh b/charts/cf-runtime/files/reconcile-runtime.sh index 4f7a0473..21e43735 100755 --- a/charts/cf-runtime/files/reconcile-runtime.sh +++ b/charts/cf-runtime/files/reconcile-runtime.sh @@ -31,8 +31,6 @@ while true; do -o yaml \ | yq 'del(.version, .metadata.changedBy, .metadata.creationTime)' > /tmp/runtime.yaml - sed -i "s/'/\"/g" /tmp/runtime.yaml - kubectl get cm ${CONFIGMAP_NAME} -n ${KUBE_NAMESPACE} -o yaml \ | yq 'del(.metadata.resourceVersion, .metadata.uid)' \ | yq eval '.data["runtime.yaml"] = load_str("/tmp/runtime.yaml")' \ diff --git a/charts/cf-runtime/templates/runtime/runtime-env-spec-tmpl.yaml b/charts/cf-runtime/templates/runtime/runtime-env-spec-tmpl.yaml index c562c48e..f06bb1a1 100644 --- a/charts/cf-runtime/templates/runtime/runtime-env-spec-tmpl.yaml +++ b/charts/cf-runtime/templates/runtime/runtime-env-spec-tmpl.yaml @@ -11,7 +11,7 @@ metadata: runtimeScheduler: type: KubernetesPod {{- if $engineContext.image }} - image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $engineContext.image "context" .) | quote }} + image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $engineContext.image "context" .) | squote }} {{- end }} imagePullPolicy: {{ $engineContext.image.pullPolicy }} {{- with $engineContext.command }} @@ -19,19 +19,25 @@ runtimeScheduler: {{- end }} envVars: {{- with $engineContext.env }} - {{- toYaml . | nindent 4 }} - {{- end }} - COMPOSE_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.COMPOSE_IMAGE) | quote }} - CONTAINER_LOGGER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.CONTAINER_LOGGER_IMAGE) | quote }} - DOCKER_BUILDER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_BUILDER_IMAGE) | quote }} - DOCKER_PULLER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_PULLER_IMAGE) | quote }} - DOCKER_PUSHER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_PUSHER_IMAGE) | quote }} - DOCKER_TAG_PUSHER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_TAG_PUSHER_IMAGE) | quote }} - FS_OPS_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.FS_OPS_IMAGE) | quote }} - GIT_CLONE_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.GIT_CLONE_IMAGE) | quote }} - KUBE_DEPLOY: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.KUBE_DEPLOY) | quote }} - PIPELINE_DEBUGGER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.PIPELINE_DEBUGGER_IMAGE) | quote }} - TEMPLATE_ENGINE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.TEMPLATE_ENGINE) | quote }} + {{- range $key, $val := . }} + {{- if or (kindIs "bool" $val) (kindIs "int" $val) (kindIs "float64" $val) }} + {{ $key }}: {{ $val | squote }} + {{- else }} + {{ $key }}: {{ $val }} + {{- end }} + {{- end }} + {{- end }} + COMPOSE_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.COMPOSE_IMAGE) | squote }} + CONTAINER_LOGGER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.CONTAINER_LOGGER_IMAGE) | squote }} + DOCKER_BUILDER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_BUILDER_IMAGE) | squote }} + DOCKER_PULLER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_PULLER_IMAGE) | squote }} + DOCKER_PUSHER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_PUSHER_IMAGE) | squote }} + DOCKER_TAG_PUSHER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_TAG_PUSHER_IMAGE) | squote }} + FS_OPS_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.FS_OPS_IMAGE) | squote }} + GIT_CLONE_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.GIT_CLONE_IMAGE) | squote }} + KUBE_DEPLOY: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.KUBE_DEPLOY) | squote }} + PIPELINE_DEBUGGER_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.PIPELINE_DEBUGGER_IMAGE) | squote }} + TEMPLATE_ENGINE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.TEMPLATE_ENGINE) | squote }} {{- with $engineContext.userEnvVars }} userEnvVars: {{- toYaml . | nindent 4 }} {{- end }} @@ -64,7 +70,10 @@ runtimeScheduler: tolerations: {{- toYaml . | nindent 4 }} {{- end }} {{- with $engineContext.podAnnotations }} - annotations: {{- toYaml . | nindent 4 }} + annotations: + {{- range $key, $val := . }} + {{ $key }}: {{ $val | squote }} + {{- end }} {{- end }} {{- with $engineContext.podLabels }} labels: {{- toYaml . | nindent 4 }} @@ -79,14 +88,21 @@ runtimeScheduler: dockerDaemonScheduler: type: DindKubernetesPod {{- if $dindContext.image }} - dindImage: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $dindContext.image "context" .) | quote }} + dindImage: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $dindContext.image "context" .) | squote }} {{- end }} imagePullPolicy: {{ $dindContext.image.pullPolicy }} {{- with $dindContext.userAccess }} userAccess: {{ . }} {{- end }} {{- with $dindContext.env }} - envVars: {{- toYaml . | nindent 4 }} + envVars: + {{- range $key, $val := . }} + {{- if or (kindIs "bool" $val) (kindIs "int" $val) (kindIs "float64" $val) }} + {{ $key }}: {{ $val | squote }} + {{- else }} + {{ $key }}: {{ $val }} + {{- end }} + {{- end }} {{- end }} cluster: namespace: {{ .Release.Namespace }} @@ -114,7 +130,10 @@ dockerDaemonScheduler: tolerations: {{- toYaml . | nindent 4 }} {{- end }} {{- with $dindContext.podAnnotations }} - annotations: {{- toYaml . | nindent 4 }} + annotations: + {{- range $key, $val := . }} + {{ $key }}: {{ $val | squote }} + {{- end }} {{- end }} {{- with $dindContext.podLabels }} labels: {{- toYaml . | nindent 4 }} @@ -126,7 +145,7 @@ dockerDaemonScheduler: pvcs: {{- range $index, $pvc := $dindContext.pvcs }} - name: {{ $pvc.name }} - reuseVolumeSelector: {{ $pvc.reuseVolumeSelector | quote }} + reuseVolumeSelector: {{ $pvc.reuseVolumeSelector | squote }} reuseVolumeSortOrder: {{ $pvc.reuseVolumeSortOrder }} storageClassName: {{ include (printf "%v.tplrender" $cfCommonTplSemver) (dict "Values" $pvc.storageClassName "context" $) }} volumeSize: {{ $pvc.volumeSize }} diff --git a/charts/cf-runtime/tests/private-registry/private_registry_test.yaml b/charts/cf-runtime/tests/private-registry/private_registry_test.yaml index b40dda7c..765a9695 100644 --- a/charts/cf-runtime/tests/private-registry/private_registry_test.yaml +++ b/charts/cf-runtime/tests/private-registry/private_registry_test.yaml @@ -31,29 +31,29 @@ tests: agent: true runtimeScheduler: type: KubernetesPod - image: "somedomain.io/codefresh/engine:tagoverride" + image: 'somedomain.io/codefresh/engine:tagoverride' imagePullPolicy: IfNotPresent command: - npm - run - start envVars: - CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: "1000" - FORCE_COMPOSE_SERIAL_PULL: "false" - LOG_OUTGOING_HTTP_REQUESTS: "false" + CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: '1000' + FORCE_COMPOSE_SERIAL_PULL: 'false' LOGGER_LEVEL: debug - METRICS_PROMETHEUS_ENABLED: "true" - COMPOSE_IMAGE: "somedomain.io/codefresh/compose:tagoverride" - CONTAINER_LOGGER_IMAGE: "somedomain.io/codefresh/cf-container-logger:tagoverride" - DOCKER_BUILDER_IMAGE: "somedomain.io/codefresh/cf-docker-builder:tagoverride" - DOCKER_PULLER_IMAGE: "somedomain.io/codefresh/cf-docker-puller:tagoverride" - DOCKER_PUSHER_IMAGE: "somedomain.io/codefresh/cf-docker-pusher:tagoverride" - DOCKER_TAG_PUSHER_IMAGE: "somedomain.io/codefresh/cf-docker-tag-pusher:tagoverride" - FS_OPS_IMAGE: "somedomain.io/codefresh/fs-ops:tagoverride" - GIT_CLONE_IMAGE: "somedomain.io/codefresh/cf-git-cloner:tagoverride" - KUBE_DEPLOY: "somedomain.io/codefresh/cf-deploy-kubernetes:tagoverride" - PIPELINE_DEBUGGER_IMAGE: "somedomain.io/codefresh/cf-debugger:tagoverride" - TEMPLATE_ENGINE: "somedomain.io/codefresh/pikolo:tagoverride" + LOG_OUTGOING_HTTP_REQUESTS: 'false' + METRICS_PROMETHEUS_ENABLED: 'true' + COMPOSE_IMAGE: 'somedomain.io/codefresh/compose:tagoverride' + CONTAINER_LOGGER_IMAGE: 'somedomain.io/codefresh/cf-container-logger:tagoverride' + DOCKER_BUILDER_IMAGE: 'somedomain.io/codefresh/cf-docker-builder:tagoverride' + DOCKER_PULLER_IMAGE: 'somedomain.io/codefresh/cf-docker-puller:tagoverride' + DOCKER_PUSHER_IMAGE: 'somedomain.io/codefresh/cf-docker-pusher:tagoverride' + DOCKER_TAG_PUSHER_IMAGE: 'somedomain.io/codefresh/cf-docker-tag-pusher:tagoverride' + FS_OPS_IMAGE: 'somedomain.io/codefresh/fs-ops:tagoverride' + GIT_CLONE_IMAGE: 'somedomain.io/codefresh/cf-git-cloner:tagoverride' + KUBE_DEPLOY: 'somedomain.io/codefresh/cf-deploy-kubernetes:tagoverride' + PIPELINE_DEBUGGER_IMAGE: 'somedomain.io/codefresh/cf-debugger:tagoverride' + TEMPLATE_ENGINE: 'somedomain.io/codefresh/pikolo:tagoverride' workflowLimits: MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS: 600 MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION: 86400 @@ -79,11 +79,11 @@ tests: memory: 128Mi dockerDaemonScheduler: type: DindKubernetesPod - dindImage: "somedomain.io/codefresh/dind:tagoverride" + dindImage: 'somedomain.io/codefresh/dind:tagoverride' imagePullPolicy: IfNotPresent userAccess: true envVars: - DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: "true" + DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: 'true' cluster: namespace: codefresh serviceAccount: codefresh-engine @@ -92,7 +92,7 @@ tests: selector: my-context pvcs: - name: dind - reuseVolumeSelector: "codefresh-app,io.codefresh.accountName" + reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName' reuseVolumeSortOrder: pipeline_id storageClassName: dind-local-volumes-runner-codefresh volumeSize: 16Gi diff --git a/charts/cf-runtime/tests/runtime/runtime_onprem_test.yaml b/charts/cf-runtime/tests/runtime/runtime_onprem_test.yaml index 8862b295..4fbf5c8b 100644 --- a/charts/cf-runtime/tests/runtime/runtime_onprem_test.yaml +++ b/charts/cf-runtime/tests/runtime/runtime_onprem_test.yaml @@ -38,30 +38,30 @@ tests: agent: false runtimeScheduler: type: KubernetesPod - image: "quay.io/codefresh/engine:tagoverride" + image: 'quay.io/codefresh/engine:tagoverride' imagePullPolicy: IfNotPresent command: - one - two - three envVars: - CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: "1000" + CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: '1000' FOO: BAR - FORCE_COMPOSE_SERIAL_PULL: "false" - LOG_OUTGOING_HTTP_REQUESTS: "false" + FORCE_COMPOSE_SERIAL_PULL: 'false' LOGGER_LEVEL: debug - METRICS_PROMETHEUS_ENABLED: "true" - COMPOSE_IMAGE: "quay.io/codefresh/compose:tagoverride" - CONTAINER_LOGGER_IMAGE: "quay.io/codefresh/cf-container-logger:tagoverride" - DOCKER_BUILDER_IMAGE: "quay.io/codefresh/cf-docker-builder:tagoverride" - DOCKER_PULLER_IMAGE: "quay.io/codefresh/cf-docker-puller:tagoverride" - DOCKER_PUSHER_IMAGE: "quay.io/codefresh/cf-docker-pusher:tagoverride" - DOCKER_TAG_PUSHER_IMAGE: "quay.io/codefresh/cf-docker-tag-pusher:tagoverride" - FS_OPS_IMAGE: "quay.io/codefresh/fs-ops:tagoverride" - GIT_CLONE_IMAGE: "quay.io/codefresh/cf-git-cloner:tagoverride" - KUBE_DEPLOY: "quay.io/codefresh/cf-deploy-kubernetes:tagoverride" - PIPELINE_DEBUGGER_IMAGE: "quay.io/codefresh/cf-debugger:tagoverride" - TEMPLATE_ENGINE: "quay.io/codefresh/pikolo:tagoverride" + LOG_OUTGOING_HTTP_REQUESTS: 'false' + METRICS_PROMETHEUS_ENABLED: 'true' + COMPOSE_IMAGE: 'quay.io/codefresh/compose:tagoverride' + CONTAINER_LOGGER_IMAGE: 'quay.io/codefresh/cf-container-logger:tagoverride' + DOCKER_BUILDER_IMAGE: 'quay.io/codefresh/cf-docker-builder:tagoverride' + DOCKER_PULLER_IMAGE: 'quay.io/codefresh/cf-docker-puller:tagoverride' + DOCKER_PUSHER_IMAGE: 'quay.io/codefresh/cf-docker-pusher:tagoverride' + DOCKER_TAG_PUSHER_IMAGE: 'quay.io/codefresh/cf-docker-tag-pusher:tagoverride' + FS_OPS_IMAGE: 'quay.io/codefresh/fs-ops:tagoverride' + GIT_CLONE_IMAGE: 'quay.io/codefresh/cf-git-cloner:tagoverride' + KUBE_DEPLOY: 'quay.io/codefresh/cf-deploy-kubernetes:tagoverride' + PIPELINE_DEBUGGER_IMAGE: 'quay.io/codefresh/cf-debugger:tagoverride' + TEMPLATE_ENGINE: 'quay.io/codefresh/pikolo:tagoverride' workflowLimits: MAXIMUM_ALLOWED_TIME_BEFORE_PRE_STEPS_SUCCESS: 600 MAXIMUM_ALLOWED_WORKFLOW_AGE_BEFORE_TERMINATION: 86400 @@ -94,7 +94,7 @@ tests: operator: Equal value: engine annotations: - karpenter.sh/do-not-evict: "true" + karpenter.sh/do-not-evict: 'true' resources: limits: cpu: 200m @@ -104,12 +104,12 @@ tests: memory: 256Mi dockerDaemonScheduler: type: DindKubernetesPod - dindImage: "quay.io/codefresh/dind:tagoverride" + dindImage: 'quay.io/codefresh/dind:tagoverride' imagePullPolicy: IfNotPresent userAccess: true envVars: ALICE: BOB - DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: "true" + DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: 'true' cluster: namespace: codefresh serviceAccount: service-account-override @@ -132,10 +132,10 @@ tests: operator: Equal value: dinds annotations: - karpenter.sh/do-not-evict: "true" + karpenter.sh/do-not-evict: 'true' pvcs: - name: dind - reuseVolumeSelector: "codefresh-app,io.codefresh.accountName" + reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName' reuseVolumeSortOrder: pipeline_id storageClassName: my-custom-storage-class volumeSize: 8Gi @@ -166,7 +166,8 @@ tests: secret: secretName: codefresh-certs-server extends: - \[\] + - system/default description: some description accounts: - 59009117c102763beda7ce71 + systemHybrid: true diff --git a/charts/cf-runtime/tests/runtime/runtime_onprem_values.yaml b/charts/cf-runtime/tests/runtime/runtime_onprem_values.yaml index 0fd45143..399920f8 100644 --- a/charts/cf-runtime/tests/runtime/runtime_onprem_values.yaml +++ b/charts/cf-runtime/tests/runtime/runtime_onprem_values.yaml @@ -8,7 +8,8 @@ runtime: agent: false inCluster: true description: "some description" - runtimeExtends: [] + runtimeExtends: + - system/default accounts: - 59009117c102763beda7ce71 diff --git a/charts/cf-runtime/tests/runtime/runtime_test.yaml b/charts/cf-runtime/tests/runtime/runtime_test.yaml index 52ff86ad..03627f0f 100644 --- a/charts/cf-runtime/tests/runtime/runtime_test.yaml +++ b/charts/cf-runtime/tests/runtime/runtime_test.yaml @@ -39,30 +39,30 @@ tests: agent: true runtimeScheduler: type: KubernetesPod - image: "quay.io/codefresh/engine:tagoverride" + image: 'quay.io/codefresh/engine:tagoverride' imagePullPolicy: Always command: - one - two - three envVars: - CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: "1000" + CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: '1000' FOO: BAR - FORCE_COMPOSE_SERIAL_PULL: "false" - LOG_OUTGOING_HTTP_REQUESTS: "false" + FORCE_COMPOSE_SERIAL_PULL: 'false' LOGGER_LEVEL: debug - METRICS_PROMETHEUS_ENABLED: "true" - COMPOSE_IMAGE: "quay.io/codefresh/compose:tagoverride" - CONTAINER_LOGGER_IMAGE: "quay.io/codefresh/cf-container-logger:tagoverride" - DOCKER_BUILDER_IMAGE: "quay.io/codefresh/cf-docker-builder:tagoverride" - DOCKER_PULLER_IMAGE: "quay.io/codefresh/cf-docker-puller:tagoverride" - DOCKER_PUSHER_IMAGE: "quay.io/codefresh/cf-docker-pusher:tagoverride" - DOCKER_TAG_PUSHER_IMAGE: "quay.io/codefresh/cf-docker-tag-pusher:tagoverride" - FS_OPS_IMAGE: "quay.io/codefresh/fs-ops:tagoverride" - GIT_CLONE_IMAGE: "quay.io/codefresh/cf-git-cloner:tagoverride" - KUBE_DEPLOY: "quay.io/codefresh/cf-deploy-kubernetes:tagoverride" - PIPELINE_DEBUGGER_IMAGE: "quay.io/codefresh/cf-debugger:tagoverride" - TEMPLATE_ENGINE: "quay.io/codefresh/pikolo:tagoverride" + LOG_OUTGOING_HTTP_REQUESTS: 'false' + METRICS_PROMETHEUS_ENABLED: 'true' + COMPOSE_IMAGE: 'quay.io/codefresh/compose:tagoverride' + CONTAINER_LOGGER_IMAGE: 'quay.io/codefresh/cf-container-logger:tagoverride' + DOCKER_BUILDER_IMAGE: 'quay.io/codefresh/cf-docker-builder:tagoverride' + DOCKER_PULLER_IMAGE: 'quay.io/codefresh/cf-docker-puller:tagoverride' + DOCKER_PUSHER_IMAGE: 'quay.io/codefresh/cf-docker-pusher:tagoverride' + DOCKER_TAG_PUSHER_IMAGE: 'quay.io/codefresh/cf-docker-tag-pusher:tagoverride' + FS_OPS_IMAGE: 'quay.io/codefresh/fs-ops:tagoverride' + GIT_CLONE_IMAGE: 'quay.io/codefresh/cf-git-cloner:tagoverride' + KUBE_DEPLOY: 'quay.io/codefresh/cf-deploy-kubernetes:tagoverride' + PIPELINE_DEBUGGER_IMAGE: 'quay.io/codefresh/cf-debugger:tagoverride' + TEMPLATE_ENGINE: 'quay.io/codefresh/pikolo:tagoverride' userEnvVars: - name: ALICE valueFrom: @@ -102,7 +102,7 @@ tests: operator: Equal value: engine annotations: - karpenter.sh/do-not-evict: "true" + karpenter.sh/do-not-evict: 'true' labels: key: engine resources: @@ -114,12 +114,12 @@ tests: memory: 256Mi dockerDaemonScheduler: type: DindKubernetesPod - dindImage: "quay.io/codefresh/dind:tagoverride" + dindImage: 'quay.io/codefresh/dind:tagoverride' imagePullPolicy: Always userAccess: true envVars: ALICE: BOB - DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: "true" + DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: 'true' cluster: namespace: codefresh serviceAccount: service-account-override @@ -143,12 +143,12 @@ tests: operator: Equal value: dinds annotations: - karpenter.sh/do-not-evict: "true" + karpenter.sh/do-not-evict: 'true' labels: key: dind pvcs: - name: dind - reuseVolumeSelector: "codefresh-app,io.codefresh.accountName" + reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName' reuseVolumeSortOrder: pipeline_id storageClassName: my-custom-storage-class volumeSize: 8Gi diff --git a/charts/cf-runtime/tests/runtime/runtime_values.yaml b/charts/cf-runtime/tests/runtime/runtime_values.yaml index a3466535..1616e21a 100644 --- a/charts/cf-runtime/tests/runtime/runtime_values.yaml +++ b/charts/cf-runtime/tests/runtime/runtime_values.yaml @@ -18,7 +18,7 @@ runtime: env: ALICE: BOB podAnnotations: - karpenter.sh/do-not-evict: "true" + karpenter.sh/do-not-evict: 'true' podLabels: key: dind nodeSelector: @@ -85,7 +85,7 @@ runtime: name: alice-secret key: token podAnnotations: - karpenter.sh/do-not-evict: "true" + karpenter.sh/do-not-evict: 'true' podLabels: key: engine nodeSelector: diff --git a/charts/cf-runtime/values.yaml b/charts/cf-runtime/values.yaml index 19e8d8ea..bb19ef97 100644 --- a/charts/cf-runtime/values.yaml +++ b/charts/cf-runtime/values.yaml @@ -457,7 +457,7 @@ runtime: reuseVolumeSortOrder: pipeline_id # -- Set additional env vars. env: - DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: "true" + DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: true # -- Set pod annotations. podAnnotations: {} # -- Set pod labels. @@ -535,15 +535,15 @@ runtime: # -- Set additional env vars. env: # -- Interval to check the exec status in the container-logger - CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: '1000' + CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: 1000 # -- If "true", composition images will be pulled sequentially - FORCE_COMPOSE_SERIAL_PULL: 'false' + FORCE_COMPOSE_SERIAL_PULL: false # -- Level of logging for engine - LOGGER_LEVEL: 'debug' + LOGGER_LEVEL: debug # -- Enable debug-level logging of outgoing HTTP/HTTPS requests - LOG_OUTGOING_HTTP_REQUESTS: 'false' + LOG_OUTGOING_HTTP_REQUESTS: false # -- Enable emitting metrics from engine - METRICS_PROMETHEUS_ENABLED: 'true' + METRICS_PROMETHEUS_ENABLED: true # -- Set workflow limits. workflowLimits: # -- Maximum time allowed to the engine to wait for the pre-steps (aka "Initializing Process") to succeed; seconds.