Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable the default workingDir and HOME overrides #3878

Merged
merged 1 commit into from May 10, 2021
Merged

Disable the default workingDir and HOME overrides #3878

merged 1 commit into from May 10, 2021

Conversation

ghost
Copy link

@ghost ghost commented Apr 13, 2021

Changes

Prior to this commit Steps were given a default HOME env var of "/tekton/home" and a default workingDir of "/workspace". 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 #1836 for the original problem description and workingDir tracking issue.

See #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.

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in or deleted (only if no user facing changes)

Release Notes

Steps no longer receive a default HOME env var of "/tekton/home", nor a default workingDir of "/workspace". 

action required: if you rely on these defaults you now have a choice to make: either update your Task steps to include the workingDir and HOME env or set the "disable-home-env-overwrite" and "disable-working-directory-overwrite" feature flags to "false". We plan to continue supporting these flags for another 9 months following the release of 0.24 and then they too will be removed.

@tekton-robot tekton-robot added the release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. label Apr 13, 2021
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 13, 2021
@ghost
Copy link
Author

ghost commented Apr 13, 2021

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 13, 2021
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@ghost ghost added this to the Pipelines 0.24 milestone Apr 13, 2021
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@tekton-robot tekton-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 22, 2021
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@tekton-robot tekton-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 29, 2021
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@ghost
Copy link
Author

ghost commented May 4, 2021

=== RUN   TestRealRunnerTimeout
    runner_test.go:37: step didn't timeout
--- FAIL: TestRealRunnerTimeout (0.04s)

This doesn't reproduce for me locally. Retrying.

/test tekton-pipeline-unit-tests

@ghost
Copy link
Author

ghost commented May 4, 2021

This PR should be up to date now with the latest enable-api-fields flag.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2021
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this, really nice!
I think we should start the deprecation of the feature flag right away, but it's also ok if you prefer to do it in a different PR.
Either case I'd like to start the deprecation in v0.24.

docs/deprecations.md Show resolved Hide resolved
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@ghost
Copy link
Author

ghost commented May 6, 2021

/test pull-tekton-pipeline-build-tests

@ghost
Copy link
Author

ghost commented May 7, 2021

I don't understand why these tests are all failing. They're all complaining about a lint error that doesn't exist in the latest commit:

=========================================
==== TESTING IF GOLINT HAS BEEN DONE ====
=========================================
level=warning msg="[runner] Can't run linter goanalysis_metalinter: deadcode: analysis skipped: errors in package: [/home/prow/go/src/github.com/tektoncd/pipeline/pkg/pod/pod_test.go:941:17: undeclared name: implicitEnvVars]"
level=error msg="Running error: deadcode: analysis skipped: errors in package: [/home/prow/go/src/github.com/tektoncd/pipeline/pkg/pod/pod_test.go:941:17: undeclared name: implicitEnvVars]"
==============================
==== GO LINT TESTS FAILED ====
==============================

implicitEnvVars does not exist in pod_test.go anymore but somehow these errors persist.

I'm going to try opening a new PR to see if that gets things moving again.

@ghost ghost mentioned this pull request May 7, 2021
5 tasks
@ghost ghost closed this May 7, 2021
@ghost
Copy link
Author

ghost commented May 7, 2021

/reopen

@tekton-robot tekton-robot reopened this May 7, 2021
@tekton-robot
Copy link
Collaborator

@sbwsg: Reopened this PR.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@afrittoli
Copy link
Member

I don't understand why these tests are all failing. They're all complaining about a lint error that doesn't exist in the latest commit:

=========================================
==== TESTING IF GOLINT HAS BEEN DONE ====
=========================================
level=warning msg="[runner] Can't run linter goanalysis_metalinter: deadcode: analysis skipped: errors in package: [/home/prow/go/src/github.com/tektoncd/pipeline/pkg/pod/pod_test.go:941:17: undeclared name: implicitEnvVars]"
level=error msg="Running error: deadcode: analysis skipped: errors in package: [/home/prow/go/src/github.com/tektoncd/pipeline/pkg/pod/pod_test.go:941:17: undeclared name: implicitEnvVars]"
==============================
==== GO LINT TESTS FAILED ====
==============================

implicitEnvVars does not exist in pod_test.go anymore but somehow these errors persist.

I'm going to try opening a new PR to see if that gets things moving again.

It looks like you might need a rebase?

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@ghost
Copy link
Author

ghost commented May 10, 2021

so close. added a workingDir to the step-script examples which write to a file.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 10, 2021
@afrittoli
Copy link
Member

        >>> Container step-git-clone-and-check:
        + '[' -d /tekton/home/.ssh ]
        + cp /messages/known_hosts /home/nonroot/ssh/known_hosts
        cp: can't create '/home/nonroot/ssh/known_hosts': No such file or directory

Should it be /home/nonroot/.ssh/known_hosts instead, like in the non-alpha folder?

@ghost
Copy link
Author

ghost commented May 10, 2021

Yup, that was exactly it, very well spotted.

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 #1836 for the
original problem description and workingDir tracking issue.

See #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.
,
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label May 10, 2021
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 87.4% 86.6% -0.8

@afrittoli
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 10, 2021
@tekton-robot tekton-robot merged commit b86a9a2 into tektoncd:main May 10, 2021
@wlynch wlynch mentioned this pull request Sep 14, 2021
3 tasks
xuzhu-591 pushed a commit to xuzhu-591/helm-charts that referenced this pull request Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants