-
Notifications
You must be signed in to change notification settings - Fork 920
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
Include Namespace in kubectl delete
Dry-Run Output
#1621
Include Namespace in kubectl delete
Dry-Run Output
#1621
Comments
Hi @totegamma , The dry run in fact checks the namespace, it is just not notified in output ,If you try to delete a pod which exist in other namespace the error will come out right . Adding namespace like |
Hello @Ritikaa96, Thank you for your reply. Yes, I know there are no problems with the internal mechanism. I just want to notify the namespace in the output for clarity. Hiding the namespace is a little unkind. When the applied manifest is too big, it is hard to grasp all resources. This often happens when we use generators such as Helm charts or Kustomize. We can check the manifest with other commands such as grep, but since kubectl already has a dry-run mode, it would be nice to print the namespace for clarity. |
/triage accepted |
@mpuckett159: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed In response to this:
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. |
/assign |
@totegamma Have you started working on it, or do you still plan to? If not, I'd love to take a crack at it, as it looks like a great first issue. Thanks |
@rezkam |
What would you like to be added:
Prefix namespace to kubectl delete dry-run result.
current:
proposed:
Why is this needed:
The current output is ambiguous, as the resource name should be identifiable as unique.
When working with multiple namespaces like "myapp-prod" and "myapp-dev", and intending to tear down some resources in "myapp-dev", the command might look like this:
From this output, it's unclear whether the manifest targets "myapp-dev" or "myapp-prod". This ambiguity requires additional checks to ensure the correct namespace is being targeted.
Printing the namespace in the dry-run output would enhance clarity and confidence in identifying the targeted resources.
Other considerations
This change can be applied for other operations like apply and replace. However, non-delete operations can be validate with the "diff" command.
Therefore, I think it is acceptable to add this feature only for the delete operation.
sample implementation would be like this: totegamma/kubernetes@65c1881
If this issue accepted, I want to get assigned and make a PR.
The text was updated successfully, but these errors were encountered: