pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

Run stopSidecar logic even if TaskSpec has no sidecars to support injected sidecars such as istio-proxy

Open SaschaSchwarze0 opened this issue 2 years ago • 5 comments

Run stopSidecar logic even if TaskSpec has no sidecars to support injected sidecars such as istio-proxy

Signed-off-by: Sascha Schwarze [email protected]

Changes

Sidecars in a Tekton pod can be declared in the TaskSpec, but could theoretically also be injected by a webhook, such as the istio-proxy.

The logic in stopSidecars was optimized to omit loading a Pod unnecessarily. But that did not honor the webhook-injected sidecars.

I am changing the logic to only skip the stopSidecars logic if the running-in-environment-with-injected-sidecars feature flag is set to false (default is true).

Still need to work out the unit test.

/kind bug

Fixes #4731

Submitter Checklist

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

  • [x] Docs included if any changes are user facing
  • [ ] Tests included if any functionality added or changed
  • [x] Follows the commit message standard
  • [x] Meets the Tekton contributor standards (including functionality, content, code)
  • [x] Release notes block below has been filled in (if there are no user facing changes, use release note "NONE")

Release Notes

The logic to stop sidecars is now running also for TaskRuns without a sidecar in its spec, if the `running-in-environment-with-injected-sidecars` is set to `true`

SaschaSchwarze0 avatar Jul 04 '22 08:07 SaschaSchwarze0

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign pritidesai after the PR has been reviewed. You can assign the PR to them by writing /assign @pritidesai in a comment when ready.

The full list of commands accepted by this bot can be found 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 avatar Jul 04 '22 08:07 tekton-robot

Hi @SaschaSchwarze0. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 avatar Jul 04 '22 08:07 tekton-robot

/ok-to-test

afrittoli avatar Jul 05 '22 11:07 afrittoli

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/reconciler/taskrun/taskrun.go 80.9% 81.0% 0.1

tekton-robot avatar Jul 05 '22 11:07 tekton-robot

@SaschaSchwarze0 do you have any plans to continue working on this PR? Looking forward to this change!

tomkennedy513 avatar Sep 15 '22 14:09 tomkennedy513

@SaschaSchwarze0 do you have any plans to continue working on this PR? Looking forward to this change!

Sure, but beside asking for it, maybe you can help here https://github.com/tektoncd/pipeline/issues/4731#issuecomment-1173546389 ?

SaschaSchwarze0 avatar Oct 04 '22 09:10 SaschaSchwarze0

@SaschaSchwarze0 do you have any plans to continue working on this PR? Looking forward to this change!

Sure, but beside asking for it, maybe you can help here https://github.com/tektoncd/pipeline/issues/4731#issuecomment-1173546389 ?

I ended up taking a stab at the issue myself and made a new pr (#5565)

tomkennedy513 avatar Oct 04 '22 11:10 tomkennedy513

@SaschaSchwarze0: PR needs rebase.

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 avatar Dec 15 '22 02:12 tekton-robot

closing because there's a newer pull request addressing the same issue - https://github.com/tektoncd/pipeline/pull/5565 - thank you @SaschaSchwarze0 (feel free to reopen if needed)

/close

jerop avatar Feb 02 '23 14:02 jerop

@jerop: Closed this PR.

In response to this:

closing because there's a newer pull request addressing the same issue - https://github.com/tektoncd/pipeline/pull/5565 - thank you @SaschaSchwarze0 (feel free to reopen if needed)

/close

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 avatar Feb 02 '23 14:02 tekton-robot