GoogleContainerTools / GoogleContainerTools/skaffold
Patches applied to end of empty list error out
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
### Expected behavior
When using a `skaffold.yaml` that looks something like this (example uses YAML anchors to define releases):
```
deploy:
kubeContext: docker-desktop
helm:
releases: []
...
profiles:
# The set of common services that are required by all profiles
- name: common
patches:
- op: add
path: "/deploy/helm/releases/-"
value:
<<: *servicedeps
- op: add
path: "/deploy/helm/releases/-"
value:
<<: *accountsapi
```
I would expect that a patch to add a release to the end of an empty releases list would still work.
### Actual behavior
Instead I get this error output:
```
> skaffold run --profile common
parsing skaffold config: failed to apply profiles to config "backend" defined in file "/Users/mattmelgard/syndio/backend/skaffold.yaml": applying profile "common": invalid path: /deploy/helm/releases/-. There's an issue with one of the profiles defined in config "backend" in file "/Users/mattmelgard/syndio/backend/skaffold.yaml"; refer to the documentation on how to author valid profiles: https://skaffold.dev/docs/environment/profiles/.
```
The reason I know that this is because of the empty releases list is because I'm currently doing a bit of a refactor and have removed the one release I had in the default set of releases under the `deploy` key, and that is the only change I have made thus far to a, previously, fully working `skaffold.yaml` file.
### Information
- Skaffold version: `skaffold version` doesn't appear to provide output but the brew version I'm using is latest (2.3)
- Operating system: macOS Ventura 13.2.1
- Installed via: Homebrew
- Contents of skaffold.yaml: Happy to provide this later if needed, but I'd like to level set on whether this is something expected or not first and if there is some kind of workaround available
### Steps to reproduce the behavior
1. Add a few profiles with helm releases assigned to them that use patches to the key `/deploy/helm/releases/-`
2. Set the default `/deploy/helm/releases` value to an empty list
3. Try to run the profile with `skaffold run --profile `
4. See an error like the one mentioned above
Contributor guide
Assessment
This issue has not been assessed yet.