GoogleContainerTools/skaffold

`debug` should provide some notice that file changes are ignored

Aperta

#4445 aperta il 6 lug 2020

 (12 commenti) (0 reazioni) (0 assegnatari)Go (1416 fork)batch import
area/deployarea/devarea/portforwardhelp wantedkind/bugkind/frictionpriority/p3

Metriche repository

Star
 (12.822 stelle)
Metriche merge PR
 (Merge medio 3g 6h) (16 PR mergiate in 30 g)

Descrizione

Expected behavior

When code change, a code reload is made and the changed code reflects in the output.

Actual behavior

by running skaffold with verbosity DEBUG, I can see that skaffold detected some file changed but the result of the code doesn't appear as if the changes were applied.

Information

  • Skaffold version: 1.12.0
  • Operating system: Ubuntu 20.04 with minikube 1.11and kubectl 1.18
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta5
kind: Config
metadata:
  name: url-shortener
build:
  artifacts:
    - image: url_shortener
      context: shortener
      docker:
        dockerfile: build/docker/Dockerfile.dev
        noCache: false
deploy:
  kubectl:
    manifests:
      - shortener/deployments/kubernetes/shortener.yaml
  • Contents of Dockerfile.dev:
FROM golang:1.14 AS builder

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download
COPY . .

RUN CGO_ENABLED=0 go build -o /app.o ./cmd/shortener/shortener.go

FROM alpine:3.12
COPY --from=builder /app.o ./
COPY --from=builder /app ./
EXPOSE 3000
ENV GOTRACEBACK=all
CMD ["./app.o"]
  • Contents of shortener.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: url-shortener-deployment
spec:
  selector:
    matchLabels:
      app: url-shortener
  template:
    metadata:
      labels:
        app: url-shortener
    spec:
      containers:
        - name: url-shortener
          image: url_shortener
          ports:
            - containerPort: 3000
---
apiVersion: v1
kind: Service
metadata:
  name: url-shortener-service
spec:
  selector:
    app: url-shortener
  ports:
    - port: 3000
      nodePort: 30000
  type: NodePort

skaffold debug message output

time="2020-07-05T22:51:08+02:00" level=debug msg="Found dependencies for dockerfile: [{go.mod /app true} {go.sum /app true} {. /app true}]"
time="2020-07-05T22:51:08+02:00" level=info msg="files modified: [shortener/internal/handler/rest/rest.go]"

Steps to reproduce the behavior

  1. run skaffold dev
  2. make some code changes
  3. check the logs to see that skaffold detected the change
  4. run part of the code to see that the output is the newly changes code

Guida contributor