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

fix: update kubectl exec syntax to remove deprecation warning #2218

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

aknot242
Copy link
Contributor

Proposed changes

Problem: Deprecation warning from kubectl when using exec without the --

❯ kubectl exec -it -n nginx-gateway $NGINX_POD -c nginx /bin/sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
E0710 07:52:34.700510   45075 websocket.go:296] Unknown stream id 1, discarding message
/ $

Solution:

add the -- syntax before the command to be executed

Testing:

❯ kubectl exec -it -n nginx-gateway $NGINX_POD -c nginx -- /bin/sh
/ $ 

Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide
specific feedback, add them here.

Closes #2217

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.


@aknot242 aknot242 requested review from a team as code owners July 10, 2024 12:20
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jul 10, 2024
@aknot242
Copy link
Contributor Author

Thanks @sjberman and @mjang. What is the process to get this merged? I don't have merge permissions.

@kate-osborn
Copy link
Contributor

Thanks @sjberman and @mjang. What is the process to get this merged? I don't have merge permissions.

We can merge @aknot242. Thanks for the fix!

@kate-osborn kate-osborn merged commit 0edd3a8 into nginxinc:main Jul 10, 2024
37 checks passed
@kate-osborn kate-osborn mentioned this pull request Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Kubectl exec deprecation warning in troubleshooting document
4 participants