-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
propagate profiles across imported configs by default; disable using propagate-profiles
flag
#5846
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5846 +/- ##
=======================================
Coverage 70.87% 70.87%
=======================================
Files 446 446
Lines 16729 16733 +4
=======================================
+ Hits 11857 11860 +3
Misses 3998 3998
- Partials 874 875 +1
Continue to review full report at Codecov.
|
Additionally the `activeProfiles` stanza can define the profiles to be activated in the required configs, via: | ||
Profiles specified by the `--profile` flag are also propagated to all configurations imported as dependencies, if they define them. This behavior can be disabled by setting the `--propagate-profiles` flag to `false`. | ||
|
||
You can additionally set up more granular and conditional profile activations across dependencies through the `activeProfiles` stanza: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it might helpful to add an example of how --propogate-profiles can be used w/ skaffold /examples directory if a user wants to see it in action easily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will take up as a followup item.
{path: "doc2/skaffold.yaml", configs: []mockCfg{{name: "cfg20", requiresStanza: ""}, {name: "cfg21", requiresStanza: ""}}}, | ||
}, | ||
expected: func(base string) []*latestV1.SkaffoldConfig { | ||
return []*latestV1.SkaffoldConfig{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: config_test.go is a bit long atm with 56 test cases in TestGetAllConfigs
. From looking at it, this is likely justified as we want the full set of combos for each config option and the test framework is the same for all of them but wanted to point it out as it might be hard for newer users to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree but didn't find any obvious way to simplify it. Do you have any ideas how this test can be better structured?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes: #5707
Related: #5755
Merge before/after: Dependent or prerequisite PRs
Description
Change the behavior of
--profile
flag for multi-config projects:--profile
are propagated across all imported configs recursively by default--propagate-profiles
tofalse
User facing changes (remove if N/A)
Before:
Users needed to defined this
activeProfiles
stanza for each and every config dependency in order to activateprofiles
with the same name (and behavior) across files.After:
Users no longer have to specify
activeProfiles
stanza if they want to activate the same named profile across configs.Follow-up Work (remove if N/A)
propagate-profiles
can be changed from a bool to accept an allow and deny-list of profile names. This can be revisited if there is enough ask for that.