kubernetes / kubectl

Issue tracker and mirror of kubectl code
Apache License 2.0
2.82k stars 909 forks source link

Unable to issue --enable-helm to kubectl delete command #1509

Open djryanj opened 10 months ago

djryanj commented 10 months ago

What happened:

Trying to kubectl delete -k <dir> --enable-helm results in kubectl reporting: error: unknown flag: --enable-helm. Removing --enable-helm results in

error: trouble configuring builtin HelmChartInflationGenerator with config: <config>: must specify --enable-helm

What you expected to happen:

delete should work the same as apply.

How to reproduce it (as minimally and precisely as possible):

Create a basic kustomize overlay that references some helm chart, e.g.:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: linkerd-viz

resources:
  - ../base

helmCharts:
- name: linkerd-viz
  repo: https://helm.linkerd.io/stable
  version: 30.12.2
  releaseName: linkerd-viz
  namespace: linkerd-viz
  valuesFile: values.yaml

Apply with kubectl apply -k <config dir> --enable-helm

Wait for it to apply

Try to delete it with kubectl delete-k <config dir> --enable-helm

Observe

Anything else we need to know?:

N/A Environment:

k8s-ci-robot commented 10 months ago

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
djryanj commented 10 months ago

In my ignorance I didn't realize that you can't do this via kubectl apply -k either. In order to use helm-based kustomize, you have to do kubectl kustomize -k <dir> --enable-helm | kubectl apply -f -. The same then works for delete.

This is inconsistent behaviour though, and one would expect to be able to do -k with the same set of flags as native kustomize, so not sure this isn't still a bug.

k8s-triage-robot commented 7 months ago

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

This bot triages un-triaged issues according to the following rules:

You can:

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

/lifecycle stale

k8s-triage-robot commented 6 months ago

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

This bot triages un-triaged issues according to the following rules:

You can:

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

/lifecycle rotten