Skip to content

skaffold docker doesn't tag correctly #1979

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

Closed
kchygoe opened this issue Apr 18, 2019 · 2 comments · Fixed by #1987
Closed

skaffold docker doesn't tag correctly #1979

kchygoe opened this issue Apr 18, 2019 · 2 comments · Fixed by #1987
Labels
area/tag good first issue Good for newcomers kind/bug Something isn't working meta/release meta/testing Issues focused on testing Skaffold itself tagger/git

Comments

@kchygoe
Copy link

kchygoe commented Apr 18, 2019

When I run skaffold run on CircleCI with the image of gcr.io/k8s-skaffold/skaffold, following error occurs.

  • Case 1
    For the following,
  tagPolicy:
    gitCommit: {}

Error is

WARN[0000] Unable to find git commit: starting command &{git [git describe --tags --always] [] ../ <nil> 0xc0000f6720 0xc0000f6730 [] <nil> <nil> <nil> <nil> 0xc000809940 false [] [0xc0000f6720 0xc0000f6730] [0xc0000f6718 0xc0000f6728] [] <nil> <nil>}: exec: "git": executable file not found in $PATH 
  • Case 2
    For the dateTime tagging,
  tagPolicy:
    dateTime:
      timezone: "Asia/Tokyo"

Error is

Generating tags...
 - gcr.io/{project}/{imagename} -> FATA[0000] generating tag: generating tag for gcr.io/{project}/{imagename}: bad timezone provided: "Asia/Tokyo", error: open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory 
Exited with code 1

I guess the cause is required files/command are not in built docker image.
https://github.com/GoogleContainerTools/skaffold/blob/master/deploy/skaffold/Dockerfile

Expected behavior

tagPolicy: gitCommit / dateTime should work correctly even if using docker image

Actual behavior

  • gitCommit: WARN error and tag is always dirty
  • dateTime: FATAL error and exit

Information

  • Skaffold version: v0.27.0
  • Operating system: gcr.io/k8s-skaffold/skaffold
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1beta7
kind: Config
build:
  artifacts:
    - image: gcr.io/{project}/{imagename}
      context: ../
  tagPolicy:
    gitCommit: {}
deploy:
  kubectl:
    manifests:
      - k8s/staging/configmap_nginx_vhost-stg.yml
      - k8s/staging/deployment-stg.yml
profiles:
  - name: production
    build:
      tagPolicy:
        dateTime:
          timezone: "Asia/Tokyo"
    deploy:
      kubectl:
        manifests:
          - k8s/production/*
  - name: staging
    build:
      tagPolicy:
        dateTime:
          timezone: "Asia/Tokyo"
    deploy:
      kubectl:
        manifests:
          - k8s/staging/*

Steps to reproduce the behavior

  1. put skaffold file in current directory.
  2. docker run -ti --rm -v $PWD:/mnt gcr.io/k8s-skaffold/skaffold /bin/bash -c 'cd /mnt/ && skaffold run -p staging'
@balopat balopat added tagger/git area/tag kind/bug Something isn't working meta/release meta/testing Issues focused on testing Skaffold itself good first issue Good for newcomers labels Apr 18, 2019
@balopat
Copy link
Contributor

balopat commented Apr 18, 2019

Thank you for finding this! Yes your analysis seems right - the skaffold image doesn't have the right binaries.

1.) we should add git and the timezone specific files to the image
2.) we should cover this in integration tests

@kchygoe
Copy link
Author

kchygoe commented Apr 24, 2019

Thank you for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tag good first issue Good for newcomers kind/bug Something isn't working meta/release meta/testing Issues focused on testing Skaffold itself tagger/git
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants