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

Better profiles #1541

Merged
merged 4 commits into from
Feb 1, 2019
Merged

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Jan 28, 2019

This PR implements two features related to Profiles:

  • It makes it possible to patch individual configuration values using json patch syntax.
  • It makes it possible to auto-activate profiles by skaffold command, env variable or kubeContext

@codecov-io
Copy link

codecov-io commented Jan 28, 2019

Codecov Report

Merging #1541 into master will increase coverage by 0.4%.
The diff coverage is 75.75%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1541     +/-   ##
=========================================
+ Coverage   46.18%   46.58%   +0.4%     
=========================================
  Files         118      118             
  Lines        4961     5019     +58     
=========================================
+ Hits         2291     2338     +47     
- Misses       2439     2447      +8     
- Partials      231      234      +3
Impacted Files Coverage Δ
pkg/skaffold/config/options.go 88.23% <ø> (ø) ⬆️
cmd/skaffold/app/cmd/deploy.go 0% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/dev.go 0% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/run.go 0% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/runner.go 0% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/delete.go 0% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/build.go 0% <0%> (ø) ⬆️
pkg/skaffold/schema/profiles.go 90.83% <86.2%> (-1.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b62bfbb...cac573b. Read the comment docs.

@dgageot dgageot force-pushed the better-profiles branch 3 times, most recently from d8c952c to 0d32461 Compare January 29, 2019 05:39
# kubeContext: ctx1
# Also auto-activate `skaffold dev` is run
# - command: run
# Also auto-activate is the kubeContext is NOT `ctx2`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Also auto-activate is the kubeContext is NOT `ctx2`
# Also auto-activate if the kubeContext is NOT `ctx2`

expected []string
shouldErr bool
}{
{
Copy link
Contributor

@balopat balopat Jan 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no tests covering the case where the Activation array has multiple activations. It is unclear whether the relationship between multiple activations should be OR or AND - it looks like from the implementation that it's a logical OR - we should also mention this in the annotated-skaffold.yaml

Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!
This is closing #1536?

I marked some nits.

plus some items for discussion:

  • json patch:
    • why json? + now we'll start to have file sprawl instead of a single skaffold yaml describing the config
    • it doesn't have an integration test - would be nice to see an example

@dgageot
Copy link
Contributor Author

dgageot commented Jan 30, 2019

@balopat Thanks for the review!

  • I'm fixing the nits
  • I'll add an integration test
  • The doc is currently unclear about json patches. Those are not external files. I'll work on a sample and an integration test to make that clearer
  • I'll document the behaviour with regards to AND and OR

Signed-off-by: David Gageot <[email protected]>
@dgageot dgageot merged commit a5420e1 into GoogleContainerTools:master Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants