Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting specific profile with flag should override any activations (which are 'implicit') #3261

Closed
botwhytho opened this issue Nov 17, 2019 · 1 comment · Fixed by #3278
Closed
Assignees
Labels
area/profiles kind/bug Something isn't working priority/p2 May take a couple of releases

Comments

@botwhytho
Copy link

botwhytho commented Nov 17, 2019

Expected behavior

We have some profiles with kubecontext activation in our skaffold configs but have other profiles ('testing' for example) that are unable to run even when running skaffold run -p test because the kubecontext activation seems to override that profile.

It is a common pattern for runtime flags to take precedence of more 'implicitly set' values like a config file or the default values. Skaffold seems to break this assumption/pattern

Actual behavior

At least with kubeContext activations (haven't tested with others), the profile with that activation will be triggered as opposed to the profile explicitly set with -p/--profile [PROFILE NAME]. Also, documentation doesn't make it clear if two profiles would run at once if activation would trigger both of them (I am aware that one can explicitly run more than one profile, not sure if this works with activations as well).

Finally skaffold should probably print to stdout what profile is using as this would aid a lot in troubleshooting such issues.

Information

  • Skaffold version: v0.36.0
  • Operating system: both observed in macOS 10.14.6 and Debian Stretch docker container

Steps to reproduce the behavior

I cannot post specific kubeContext values here but a skaffold.yaml with two profiles should reproduce this easily:

  • One profile ('profile-a') can deploy service a and have a kubeContext activation
  • The other one ('profile-b') can deploy service b and have no activation
  • Running skaffold deploy -p profile-b with the Kubernetes context of profile a as the current context will deploy service a and NOT service b
@dgageot dgageot self-assigned this Nov 18, 2019
@balopat balopat added kind/feature-request priority/p2 May take a couple of releases area/profiles kind/bug Something isn't working and removed kind/feature-request labels Nov 18, 2019
@balopat
Copy link
Contributor

balopat commented Nov 18, 2019

Thank you for opening @botwhytho - this should be relatively easy to fix and I agree that we are breaking here a conventional pattern. @dgageot you want to take a shot at this, I see you self-assigned?

dgageot added a commit to dgageot/skaffold that referenced this issue Nov 21, 2019
dgageot added a commit to dgageot/skaffold that referenced this issue Nov 22, 2019
dgageot added a commit to dgageot/skaffold that referenced this issue Nov 26, 2019
dgageot added a commit that referenced this issue Nov 26, 2019
* Profile activated with flag override auto-activated profiles

Fix #3261

Signed-off-by: David Gageot <[email protected]>

* Fix long label made of profile names

Fix #3277

Signed-off-by: David Gageot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/profiles kind/bug Something isn't working priority/p2 May take a couple of releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants