tilt
tilt copied to clipboard
helm() file watches can't be undone with watch_settings
Expected Behavior
After creating a helm settings file on disk from within the Tiltfile, then passing it to helm., the Tiltfile is re-creats the settings file everytime the Tiltfile is changed. The existing filewatch from helm() gets triggered on the settings file, causing the Tilefile to be reloaded in an infinite loop.
To stop this behavior, I tried using watching_setting(ignore=...)
, but it seems to be ignored.
Current Behavior
In the test case below, changes to the Tiltfile or the settings file causes an infinite reload of the Tiltfile.
Steps to Reproduce
Use this Tiltfile:
load('ext://helm_remote', 'helm_remote')
chart_values = {
'replicaCount': 2
}
rendered_values = os.path.dirname(os.getenv("TMPDIR")) + '/rendered-values.yaml'
local('cat > %s' % rendered_values,
stdin=encode_yaml(chart_values),
echo_off=True,
quiet=True)
helm_remote('hello', values=rendered_values, repo_name='cloudecho', repo_url='https://cloudecho.github.io/charts/')
watch_settings(ignore=rendered_values)
- touch/change either the Tiltfile or the settings file
Context
tilt doctor
Output
$ tilt doctor
Tilt: v0.32.4, built 2023-05-24
System: darwin-arm64
---
Docker
- Host: unix:///Users/bcotton/.docker/run/docker.sock
- Server Version: 20.10.21
- API Version: 1.41
- Builder: 2
- Compose Version: v2.12.2
---
Kubernetes
- Env: kind
- Context: kind-kind
- Cluster Name: kind-kind
- Namespace: default
- Container Runtime: containerd
- Version: v1.26.0
- Cluster Local Registry: &RegistryHosting{Host:localhost:49648,HostFromClusterNetwork:ctlptl-registry:5000,HostFromContainerRuntime:,Help:https://github.com/tilt-dev/ctlptl,SingleName:,}
---
Thanks for seeing the Tilt Doctor!
Please send the info above when filing bug reports. 💗
The info below helps us understand how you're using Tilt so we can improve,
but is not required to ask for help.
---
Analytics Settings
--> (These results reflect your personal opt in/out status and may be overridden by an `analytics_settings` call in your Tiltfile)
- User Mode: opt-in
- Machine: 5e9db8c45fdc6566d854189ae97e86bc
- Repo:
...
About Your Use Case
does it work if you do:
rendered_values = os.path.realpath(os.path.dirname(os.getenv("TMPDIR")) + '/rendered-values.yaml')
?
note the realpath
wrapper
my hunch is that this is an artifact of how:
- macos loves to jam symlinks in tmpdirs
- macos hates when there are symlinks in fsevents dirs
Yes, that does work. the temp file is no longer being watched.
If you don't ignore the file watch, it will loop. For a generated file that MUST be on disk, I guess that's ok.