GoogleContainerTools / GoogleContainerTools/skaffold

Endless deploy loop on using before hooks which generate yaml value files

Open
#7,183 6 comments 2 reactions 0 assignees View on GitHub
area/hooks kind/bug priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

My requirement is to generate the helm configuration based on certain Environment variables right before the helm deplyoment task starts.

### Expected behavior
Skaffold should deploy only once and skipped paths should respected
### Actual behavior
Regarding to the logs skaffold ignores my folder there a helm values file is autogenerated before the helm command is invoked
Skaffold recognize a change in the generated values file and try to redeploy the changes. The result is an endless loop of helm deployments.
### Information

- Skaffold version: 1.35.2
- Operating system: Ubuntu 20.04 on wsl
- Installed via: Download
- Contents of skaffold.yaml:

```yaml
deploy:
helm:
hooks:
before:
- host:
command: ["bash", "-c", "./build/skaffold/skaffold-init.sh"]
os: [linux]
releases:
- name: my-release
chartPath: build/charts/application
namespace: application-dev
upgradeOnChange: true
skipBuildDependencies: true
imageStrategy:
helm: {}
artifactOverrides:
image: registry.gitlab.com/application
valuesFiles:
- ./build/skaffold/skaffold-helm-values.yaml
```

### Steps to reproduce the behavior

1. implement a hook which regenerate the ./build/skaffold/skaffold-helm-values.yaml file on every helm run
2. `skaffold dev`
3. see the behavior

...
DEBU[0061] Skipping excluded path: build/skaffold
...
INFO[0062] files modified: [./build/skaffold/skaffold-helm-values.yaml] subtask=-1 task=DevLoop
...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.