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

kustomize deletion not working as expected #2120

Closed
vedsmand opened this issue Jun 8, 2023 · 0 comments · Fixed by #2124
Closed

kustomize deletion not working as expected #2120

vedsmand opened this issue Jun 8, 2023 · 0 comments · Fixed by #2124

Comments

@vedsmand
Copy link
Contributor

vedsmand commented Jun 8, 2023




Describe the bug
after applying a kustomize directory containing kustomization.yaml,
the k9s Delete command is using -f instead of -k resulting in a kubectl error message, because kubectl tries to delete a kind:kustomization.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a kustomization directory with k9s dir command
  2. press <a> for applying the kustomization
  3. press <d> for deleting the kustomization
  4. see error:
    exit status 1 │
    │ message:
    ..redacted..
    error: resource mapping not found for name: "" namespace: "" from "/my-folder/kustomize/kustomization.yaml": no matches for kind "Kustomization" in version "kustomize.config.k8s.io/v1beta1" ensure CRDs are installed first

Expected behavior
k9s Delete command on a kustomization directory will delete the kustomization with kubectl delete -k <folder>

Versions (please complete the following information):

  • OS: [linux/pop-os]
  • K9s: [v0.27.4 ]
  • k8s: [v1.26.3]

Additional context
it seems to me that there is a missing conditional here

args = append(args, "-f")

the apply command has it set correct here:
opts = []string{"-k"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant