skaffold docker doesn't tag correctly

Created on 18 Apr 2019  路  2Comments  路  Source: GoogleContainerTools/skaffold


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'
aretag good first issue kinbug metrelease mettesting taggegit

All 2 comments

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

Thank you for the quick response!

Was this page helpful?
0 / 5 - 0 ratings