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

skaffold render passes incorrect global helm flags to helm dep build #9169

Open
sumeshpremraj opened this issue Nov 9, 2023 · 2 comments
Open
Assignees
Labels
area/render deploy/helm kind/bug Something isn't working priority/p2 May take a couple of releases

Comments

@sumeshpremraj
Copy link

sumeshpremraj commented Nov 9, 2023

Expected behavior

Helm dependency build worked as expected on skaffold 2.2.0 with the workaround mentioned in #5445 (comment)

The fix for that issue was merged and available since skaffold 2.4.0, so I tried to upgrade to the latest version and remove the workaround.

Actual behavior

Skaffold/helm breaks becasue of an error caused by global flags being passed to helm dep build. These flags are valid for helm template, but not helm dep.

I should note here that I am specifying helm global flags as a helm anchor.

Information

  • Skaffold version: 2.9.0
  • Operating system: macOS 13.5.2
  • Installed via: Homebrew
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta3
kind: Config
metadata:
  name: cluster
build:
  local:
    push: false

.helm_flags: &helm_flags
  global:
    - "--include-crds"
    - "--api-versions"
    - "apiregistration.k8s.io/v1"

.helm_release: &helm_release
  namespace: default
  chartPath: charts/k8s-infra
  skipBuildDependencies: false
  version: 1.0.0

profiles:
  - name: apps
    manifests:
      helm:
        flags: *helm_flags
        releases:
          - <<: *helm_release
            name: trv-data-apps-cluster
            valuesFiles:
              - charts/k8s-infra/values.yaml
              - charts/k8s-infra/values/apps.yaml

Steps to reproduce the behavior

$ skaffold -v debug render --filename ./skaffold.yaml  --profile apps --output ./output.yaml --offline=true
...
INFO[0000] Skaffold &{Version:v2.9.0 ConfigVersion:skaffold/v4beta8 GitVersion: GitCommit:6071a3f7574702c8666a243d89254e9b0d8ff4d7 BuildDate:2023-11-07T13:20:11Z GoVersion:go1.21.0 Compiler:gc Platform:darwin/arm64 User:}  subtask=-1 task=DevLoop
...
INFO[0000] Building helm dependencies...                 subtask=0 task=Render
DEBU[0000] Running command: [helm --kube-context CONTEXT dep build charts/k8s-infra --include-crds --api-versions apiregistration.k8s.io/v1]  subtask=0 task=Render
INFO[0000] Error: unknown flag: --include-crds           subtask=0 task=Render
DEBU[0000] Running command: [tput colors]                subtask=-1 task=DevLoop
DEBU[0000] Command output: [256]                        subtask=-1 task=DevLoop
building helm dependencies: exit status 1
@renzodavid9 renzodavid9 added kind/bug Something isn't working deploy/helm priority/p2 May take a couple of releases area/render labels Nov 9, 2023
@sumeshpremraj sumeshpremraj changed the title skaffold passes incorrect helm flags to helm dep build skaffold render passes incorrect global helm flags to helm dep build Nov 9, 2023
@renzodavid9
Copy link
Contributor

Hey @sumeshpremraj, thanks for opening this issue. I was able to reproduce this. As you mention, the global flags are used in all the Helm commands that Skaffold invoques behind the scene.

I would say then the best option here is to extend the helm.flags property to include something like helm.flags.dep and helm.flags.template to be more granular.

@renzodavid9
Copy link
Contributor

Looks related with #8227, something like manifests.helm.flags.template will help for that case

@renzodavid9 renzodavid9 self-assigned this Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/render deploy/helm kind/bug Something isn't working priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

2 participants