Skip to content

"skaffold deploy --force=false" still force updates deployments #2848

@nashyeung

Description

@nashyeung

Expected behavior

The command "skaffold deploy --force=false" should not recreate pods in the deployment.

Actual behavior

The command "skaffold deploy --force=false" recreates pods in the deployment.

Information

  • Skaffold version: v0.37.1
  • Operating system: ubuntu 18.04
  • Kubernetes environment: minikube v1.3.1 (vm-driver=none)
  • Kubectl version: v1.14.0
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1beta13
kind: Config

deploy:
  kubectl:
    manifests:
    - nginx-deployment.yaml
  • Contents of nginx-deployment.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 80

Steps to reproduce the behavior

  1. Put the 2 files above skaffold.yaml and nginx-deployment.yaml into the same folder
  2. Inside that folder, run skaffold deploy --force=false --verbosity=debug
  3. See these 3 lines at the end of log output, the nginx deployment is updated, nginx pods are recreated
DEBU[0000] Running command: [kubectl --context minikube apply -f - --force]
deployment.apps/nginx configured
Deploy complete in xxxxx ms
  1. Try skaffold deploy -v debug without specifying the --force option, which defaults to false. Still see kubectl ... -f - --force in debug logs, and nginx pods being recreated
  2. Try all other falsy values for the --force parameter, e.g. f, FALSE, 0. Still see kubectl ... -f - --force in the debug logs
  3. Try skaffold dev/run/debug. --force works well, i.e. no more kubectl ... --force in debug logs (although pods are still recreated, should be caused by Allow users to override the run-id #2752 I think)
  4. Try SKAFFOLD_FORCE=false skaffold deploy -v debug. No more kubectl ... --force this time.

Metadata

Metadata

Assignees

Labels

area/deploykind/bugSomething isn't workingpriority/p2May take a couple of releasestriage/duplicateThis issue or pull request already exists

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions