ingress-nginx icon indicating copy to clipboard operation
ingress-nginx copied to clipboard

Avoid returning "exit status 1" when using the ingress-nginx kubectl plugin with newer kubectl versions

Open morguldir opened this issue 8 months ago • 6 comments

What this PR does / why we need it:

kubectl exec [POD] [COMMAND] had been deprecated for 5 years, and they've just removed it now. After some gdb'ing i found the problem being stderr not going anywhere, and then i found https://github.com/kubernetes/kubernetes/pull/125437

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] CVE Report (Scanner found CVE and adding report)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation only

Which issue/s this PR fixes

How Has This Been Tested?

Before

~> go build && ./plugin  conf -n ingress-nginx -lapp.kubernetes.io/name=ingress-nginx
exit status 1

After stderr change

~> go build && ./plugin  conf -n ingress-nginx -lapp.kubernetes.io/name=ingress-nginx
error: exec [POD] [COMMAND] is not supported anymore. Use exec [POD] -- [COMMAND] instead
See 'kubectl exec -h' for help and examples

exit status 1

After

~> go build && ./plugin  conf -n ingress-nginx -lapp.kubernetes.io/name=ingress-nginx
... nginx.conf ...

Checklist:

  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I've read the CONTRIBUTION guide
  • [ ] I have added unit and/or e2e tests to cover my changes.
  • [ ] All new and existing tests passed.

morguldir avatar Mar 27 '25 22:03 morguldir

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: morguldir / name: morguldir (ac03447f6980bf9c725c97aff249cbe7a360fd63, 927ff87334803375706e05f278fdba369e21bade)

Welcome @morguldir!

It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/ingress-nginx has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Mar 27 '25 22:03 k8s-ci-robot

Hi @morguldir. Thanks for your PR.

I'm waiting for a kubernetes 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-sigs/prow repository.

k8s-ci-robot avatar Mar 27 '25 22:03 k8s-ci-robot

Deploy Preview for kubernetes-ingress-nginx ready!

Name Link
Latest commit ac03447f6980bf9c725c97aff249cbe7a360fd63
Latest deploy log https://app.netlify.com/sites/kubernetes-ingress-nginx/deploys/67e74760a961eb0008be7fcf
Deploy Preview https://deploy-preview-13102--kubernetes-ingress-nginx.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Mar 27 '25 22:03 netlify[bot]

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Gacko, morguldir

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

k8s-ci-robot avatar Mar 28 '25 13:03 k8s-ci-robot

/cherry-pick release-1.12

Gacko avatar Mar 28 '25 13:03 Gacko

@Gacko: once the present PR merges, I will cherry-pick it on top of release-1.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.12

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-sigs/prow repository.

/cherry-pick release-1.11

Gacko avatar Mar 28 '25 13:03 Gacko

@Gacko: once the present PR merges, I will cherry-pick it on top of release-1.11 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.11

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-sigs/prow repository.

You might need to amend your commit and force-push it, so Netlify tests get triggered again. They seem to have failed on the initial attempt and I cannot manually re-trigger them.

Gacko avatar Mar 28 '25 13:03 Gacko

New changes are detected. LGTM label has been removed.

k8s-ci-robot avatar Mar 29 '25 01:03 k8s-ci-robot

Nice, thank you! I kicked the failing tests, we should be good in a few minutes.

Gacko avatar Mar 29 '25 07:03 Gacko

@Gacko: new pull request created: #13112

In response to this:

/cherry-pick release-1.12

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-sigs/prow repository.

@Gacko: new pull request created: #13113

In response to this:

/cherry-pick release-1.11

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-sigs/prow repository.