GoogleContainerTools / GoogleContainerTools/skaffold
Order of applying profiles is undefined
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
Skaffold's docs do not define the order in which profiles are applied. The implementation [applies profiles](https://github.com/GoogleContainerTools/skaffold/blob/ff33ac0a47dde7bc035eec1be8ae1fce01fa97d9/pkg/skaffold/schema/profiles.go#L42) in a somewhat surprising manner:
- auto-activated profiles (provided that they are not `!` from the command-line), in the order listed in the skaffold.yaml
- profiles specified on the command-line in the order specified on the command-line
It's hard to reason about and consistently define a set of profile patches to apply some change.
From inspection, it also seems that a profile can be applied twice when a profile is auto-activated _and_ specified from the command-line.
I suggest that:
- we apply profiles in the order specified in the `skaffold.yaml`
- we document this ordering
Contributor guide
Assessment
This issue has not been assessed yet.