garden-io / garden

Automation for Kubernetes development and testing. Spin up production-like environments for development, testing, and CI on demand. Use the same configuration and workflows at every step of the process. Speed up your builds and test runs via shared result caching
https://garden.io
Mozilla Public License 2.0
3.33k stars 269 forks source link

0.13: [Bug]: `garden deploy --force-build` has no effect without also specifying `--force` #4800

Open stefreak opened 1 year ago

stefreak commented 1 year ago

Garden Bonsai (0.13) Bug

Current Behavior

  1. Run garden deploy
    ℹ deploy.nginx         → missing
    ℹ build.example        → Building example:v-dcb0e827a8...
    ✔ build.example        → Done (took 10.8 sec)
    ℹ deploy.nginx         → Deploying version v-368eff6e63...
    ℹ deploy.nginx         → Waiting for resources to be ready...
    ℹ deploy.nginx         → Resources ready
    ✔ deploy.nginx         → Done (took 2.7 sec)
  2. Run garden deploy --force-build
    ℹ deploy.nginx         → Already deployed

Expected behavior

I expect that garden rebuilds the example container and re-deploys the nginx service.

Garden 0.12 / Acorn behaves like this with --force-build:

✔ example                   → Building example:v-dcb0e827a8... → Done (took 3.3 sec)
✔ nginx                     → Deploying version v-9bec2e77fa... → Already deployed

Reproducible example

# garden.yml
kind: Project
apiVersion: garden.io/v1
name: repro
environments:
 - name: default
providers:
 - name: local-kubernetes

---
kind: Module
type: container
name: example
exclude:
  - node_modules/**
services:
  - name: nginx
# Dockerfile
FROM nginx

Workaround

garden deploy --force --force-build

Suggested solution(s)

Garden needs to detect where deploys need to be implicitly forced, as is the behaviour of latest garden acorn (0.12).

Additional context

Your environment

garden version edge-bonsai

stefreak commented 1 year ago

Interestingly, 0.12 also doesn't re-deploy the container, even though it re-built the image. Why do we even have the --force-build flag then?