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

exec credential provider: handle wrapped exec errors #103772

Closed
wants to merge 1 commit into from

Conversation

ankeesler
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

  • The updated code now handles cases where running an exec plugin fails with wrapped errors.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 19, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ankeesler
To complete the pull request process, please assign mikedanese after the PR has been reviewed.
You can assign the PR to them by writing /assign @mikedanese 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

@k8s-ci-robot k8s-ci-robot added area/test needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 19, 2021
@ankeesler
Copy link
Contributor Author

/sig auth
/cc @enj
/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot requested a review from enj July 19, 2021 13:37
@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jul 19, 2021
)

case os.IsPermission(err):
return fmt.Errorf("exec: binary %s not executable", a.cmd)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not in love with changing this error message to say "binary" instead of "executable" (because the plugin could be a bash script, which I would not consider to be a binary), but I wanted to avoid the redundancy of the error message "executable blah is not executable". Any suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

A new unit test message binary ./testdata/not-executable.sh not executable seems a little odd as @ankeesler pointed at the above.
How about keeping "executable" for the other places and removing "executable" from the above case os.IsPermission only to avoid unnecessary confusions?

)

case os.IsPermission(err):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this how you were hoping to use os.IsPermission()?

execError := &exec.Error{}
exitError := &exec.ExitError{}
switch {
case errors.As(err, &execError): // Binary does not exist (see exec.Error).
Copy link
Contributor Author

@ankeesler ankeesler Jul 19, 2021

Choose a reason for hiding this comment

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

I couldn't figure out how to work in os.IsNotExist() here. I tried both errors.As(err, &execError) && os.IsNotExist(err) and errors.As(err, &execError) && os.IsNotExist(execError), but these logical expressions never evaluated to true for me.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>
@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jul 19, 2021
@enj enj added this to Needs Triage in SIG Auth Old Jul 19, 2021
@fedebongio
Copy link
Contributor

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jul 20, 2021
@enj
Copy link
Member

enj commented Jul 22, 2021

I think this is a small enough issue that can wait until 1.23.

/triage accepted
/priority important-longterm
/assign
/milestone v1.23

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Jul 22, 2021
@k8s-ci-robot k8s-ci-robot removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jul 22, 2021
@enj enj moved this from Needs Triage to In Review (v1.22) in SIG Auth Old Jul 22, 2021
@jyotimahapatra
Copy link
Contributor

Hi 👋 I'm the bug triage shadow. I wanted to check in and see if this PR is targeted for milestone 1.23 .

@ankeesler
Copy link
Contributor Author

@jyotimahapatra sure! That would be great if we could target this at 1.23

@jyotimahapatra
Copy link
Contributor

@ankeesler Im checking in again to check if we can coordinate with sig auth to get this PR approved and merge this in 1.23 time frame

@ankeesler
Copy link
Contributor Author

@jyotimahapatra - sorry for the delay. i am having trouble finding time to devote to kube currently, but i think this pr seems small enough. i wonder if @enj would be able to review this for 1.23?

@enj
Copy link
Member

enj commented Nov 17, 2021

/milestone v1.24

Ran out of time in 1.23

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.23, v1.24 Nov 17, 2021
@dims
Copy link
Member

dims commented Jan 4, 2022

@enj @ankeesler what more does this need?

/retest

@k8s-ci-robot
Copy link
Contributor

@ankeesler: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-integration b8fb5f3 link true /test pull-kubernetes-integration

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@enj
Copy link
Member

enj commented Jan 5, 2022

@enj @ankeesler what more does this need?

It is on my list of things to review in 1.24

@jyotimahapatra
Copy link
Contributor

Hi 👋 I'm checking in from the bug triage team for release 1.24. Is this PR targeted for release 1.24?

@jyotimahapatra
Copy link
Contributor

Hi @enj 👋 I'm from bug triage team. I wanted to check if we're tracking this for milestone 1.24.

@enj
Copy link
Member

enj commented Mar 28, 2022

I will try to review this for 1.24 but this does not block the release.

/milestone v1.25

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.24, v1.25 Mar 28, 2022
Copy link
Member

@oomichi oomichi left a comment

Choose a reason for hiding this comment

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

/cc @oomichi

)

case os.IsPermission(err):
return fmt.Errorf("exec: binary %s not executable", a.cmd)
Copy link
Member

Choose a reason for hiding this comment

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

A new unit test message binary ./testdata/not-executable.sh not executable seems a little odd as @ankeesler pointed at the above.
How about keeping "executable" for the other places and removing "executable" from the above case os.IsPermission only to avoid unnecessary confusions?

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 11, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 10, 2022
@helayoty
Copy link
Member

/milestone clear

@k8s-ci-robot k8s-ci-robot removed this from the v1.25 milestone Aug 15, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-none Denotes a PR that doesn't merit a release note. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Archived in project
SIG Auth Old
In Review
Development

Successfully merging this pull request may close these issues.

None yet

9 participants