GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development

Home Page:https://skaffold.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remote chart name and local folder name conflict

hacktobeer opened this issue · comments

Expected behavior

When using a remoteChart value that has the same name as a local folder it should not error out.

Actual behavior

When the remoteChart has the same name as a local folder it should deploy like normal.
For example with a local folder name turbinia and using the below skaffold settings:

repo: https://google.github.io/osdfir-infrastructure/
remoteChart: turbinia

Information

  • Skaffold version: v2.9.0
  • Minikube version: v1.32.0
  • Operating system: Debian bullseye x86_64
  • Installed via: Default install with Google Cloud Extension in vscode (manages skaffold as dependency)
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta6
kind: Config
metadata:
  name: turbinia
build:
  local:
    useDockerCLI: true
    useBuildkit: true 
    concurrency: 0
  artifacts:
     - image: turbinia-server
       docker:
         dockerfile: docker/server/Dockerfile
       sync:
         infer:
         - turbinia/**
deploy:
  statusCheckDeadlineSeconds: 30
  helm:
    releases:
    - name: dev-release
      repo: https://google.github.io/osdfir-infrastructure/
      remoteChart: turbinia
      setValues:
        versioncheck.enabled: False
      setValueTemplates:
        server.image.repository: "{{.IMAGE_REPO_turbinia_server}}"
        server.image.tag: "{{.IMAGE_TAG_turbinia_server}}@{{.IMAGE_DIGEST_turbinia_server}}"

Steps to reproduce the behavior

  1. git clone https://github.com/google/turbinia.git
  2. copy above skaffold file in root of git repo in skaffold.yaml
  3. from root of repo execute skaffold dev
  4. Note: the git repo contains a folder named turbinia which is the same as the remoteChart

Relevant error output of skaffold dev:

Helm release dev-release not installed. Installing...
Error: INSTALLATION FAILED: Chart.yaml file is missing
Cleaning up...
Error: uninstall: Release not loaded: dev-release: release: not found
Cleaning up resources encountered an error, will continue to clean up other resources.
deploying "dev-release": install: exit status 1
  1. Now let's rename the turbinia folder to turbinia-old with mv turbinia turbinia-old
  2. run skaffold dev again

Now it runs fine.....I suspect skaffold tries to look into the local turbinia folder (name of remoteChart) for the helm charts instead of using the remote chart.