From b86a9a2204d988fbd2b187f220d64b5a102c1ca3 Mon Sep 17 00:00:00 2001 From: Scott Date: Tue, 13 Apr 2021 14:31:15 +0000 Subject: [PATCH] Disable the default workingDir and HOME overrides Prior to this commit Steps were given a default HOME env var and a default workingDir. These defaults collide with any value set by the Step's image Dockerfile. This commit removes the default home and workingDir overrides (except in those few cases where they're still expected, like PipelineResources). See https://groups.google.com/g/tekton-dev/c/C-PL8VYN51E/m/el5Fca_PDAAJ for our tekton-dev announcement of this change. See https://github.com/tektoncd/pipeline/issues/1836 for the original problem description and workingDir tracking issue. See https://github.com/tektoncd/pipeline/issues/2013 for the HOME change tracking issue. See https://github.com/tektoncd/pipeline/blob/main/docs/deprecations.md for our documented dates for these deprecations. See https://github.com/tektoncd/pipeline/blob/main/api_compatibility_policy.md#alpha-beta-and-ga for our beta deprecation policy. , --- config/config-feature-flags.yaml | 18 +-- docs/deprecations.md | 7 +- docs/install.md | 16 +-- examples/v1alpha1/taskruns/dind-sidecar.yaml | 1 + examples/v1alpha1/taskruns/gcs-resource.yaml | 1 + examples/v1alpha1/taskruns/git-resource.yaml | 5 + examples/v1alpha1/taskruns/home-is-set.yaml | 3 + examples/v1alpha1/taskruns/step-script.yaml | 1 + examples/v1alpha1/taskruns/workingdir.yaml | 1 + .../alpha/authenticating-git-commands.yaml | 2 +- .../taskruns/authenticating-git-commands.yaml | 2 +- examples/v1beta1/taskruns/dind-sidecar.yaml | 1 + examples/v1beta1/taskruns/gcs-resource.yaml | 1 + examples/v1beta1/taskruns/git-resource.yaml | 3 + examples/v1beta1/taskruns/home-is-set.yaml | 3 + examples/v1beta1/taskruns/step-script.yaml | 1 + examples/v1beta1/taskruns/workingdir.yaml | 1 + pkg/apis/config/feature_flags.go | 4 +- pkg/apis/config/feature_flags_test.go | 14 +- pkg/pod/pod.go | 8 +- pkg/pod/pod_test.go | 120 ++++++++++-------- pkg/reconciler/taskrun/taskrun_test.go | 45 +------ test/entrypoint_test.go | 14 +- test/v1alpha1/entrypoint_test.go | 14 +- 24 files changed, 148 insertions(+), 138 deletions(-) diff --git a/config/config-feature-flags.yaml b/config/config-feature-flags.yaml index 595c380e7b0..9ab11ef6e4b 100644 --- a/config/config-feature-flags.yaml +++ b/config/config-feature-flags.yaml @@ -30,26 +30,18 @@ data: # https://github.com/tektoncd/pipeline/blob/main/docs/workspaces.md#affinity-assistant-and-specifying-workspace-order-in-a-pipeline # or https://github.com/tektoncd/pipeline/pull/2630 for more info. disable-affinity-assistant: "false" - # Setting this flag to "true" will prevent Tekton overriding your + # Setting this flag to "false" will allow Tekton to override your # Task container's $HOME environment variable. # - # The default behaviour currently is for Tekton to override the - # $HOME environment variable but this will change in an upcoming - # release. - # # See https://github.com/tektoncd/pipeline/issues/2013 for more # info. - disable-home-env-overwrite: "false" - # Setting this flag to "true" will prevent Tekton overriding your + disable-home-env-overwrite: "true" + # Setting this flag to "false" will allow Tekton to override your # Task container's working directory. # - # The default behaviour currently is for Tekton to override the - # working directory if not set by the user but this will change - # in an upcoming release. - # # See https://github.com/tektoncd/pipeline/issues/1836 for more # info. - disable-working-directory-overwrite: "false" + disable-working-directory-overwrite: "true" # Setting this flag to "true" will prevent Tekton scanning attached # service accounts and injecting any credentials it finds into your # Steps. @@ -61,7 +53,7 @@ data: # Note: setting this to "true" will prevent PipelineResources from # working. # - # See https://github.com/tektoncd/pipeline/issues/1836 for more + # See https://github.com/tektoncd/pipeline/issues/2791 for more # info. disable-creds-init: "false" # This option should be set to false when Pipelines is running in a diff --git a/docs/deprecations.md b/docs/deprecations.md index 7a943a0abb5..b33fb56c680 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -1,4 +1,3 @@ -