Skip to content

Introduce config version v1beta2#1376

Merged
balopat merged 5 commits intoGoogleContainerTools:masterfrom
dgageot:config-v1beta2
Dec 8, 2018
Merged

Introduce config version v1beta2#1376
balopat merged 5 commits intoGoogleContainerTools:masterfrom
dgageot:config-v1beta2

Conversation

@dgageot
Copy link
Copy Markdown
Contributor

@dgageot dgageot commented Dec 8, 2018

Fixes #1373

Signed-off-by: David Gageot david@gageot.net

@codecov-io
Copy link
Copy Markdown

codecov-io commented Dec 8, 2018

Codecov Report

Merging #1376 into master will decrease coverage by 0.49%.
The diff coverage is 60.49%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1376     +/-   ##
=========================================
- Coverage   44.91%   44.42%   -0.5%     
=========================================
  Files         114      109      -5     
  Lines        4909     4540    -369     
=========================================
- Hits         2205     2017    -188     
+ Misses       2481     2317    -164     
+ Partials      223      206     -17
Impacted Files Coverage Δ
pkg/skaffold/schema/v1alpha5/upgrade.go 64.7% <ø> (ø) ⬆️
cmd/skaffold/app/cmd/runner.go 0% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/init.go 15.34% <0%> (ø) ⬆️
pkg/skaffold/schema/profiles.go 92.53% <0%> (ø) ⬆️
pkg/skaffold/schema/versions.go 65.85% <33.33%> (+0.85%) ⬆️
pkg/skaffold/schema/v1beta1/config.go 50% <50%> (ø)
pkg/skaffold/schema/v1alpha1/upgrade.go 60.93% <50%> (-9.38%) ⬇️
pkg/skaffold/schema/v1beta1/upgrade.go 58.62% <58.62%> (ø)
pkg/skaffold/schema/defaults/defaults.go 49.01% <72.97%> (ø)
pkg/skaffold/schema/latest/upgrade.go
... and 2 more

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 c1949f4...6205d10. Read the comment docs.

Copy link
Copy Markdown
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.

Review checklist:

  • diff between examples with integration/examples should be version changes v1beta1 vs v1beta2 for all non test- (integration test only) examples
    • there are small whitespace differences between bazel/WORKSPACE - but irrelevant
  • manual check that compiled thing works:
examples/getting-started  ../../out/skaffold dev                                                                                               Sat Dec  8 12:21:24 2018
WARN[0000] config version (skaffold/v1beta1) out of date: upgrading to latest (skaffold/v1beta2)
  • correct upgrade tests - found a copy paste error - v1alpha5 instead of v1beta1, comment added
  • upgrade documentation - in v1beta1/upgrade.go I'd like to keep the list of changes as a good practice - even if there are no changes yet - comment added

)

func TestUpgrade(t *testing.T) {
yaml := `apiVersion: skaffold/v1alpha5
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
yaml := `apiVersion: skaffold/v1alpha5
yaml := `apiVersion: skaffold/v1beta1

c.setDefaultKustomizePath()
c.setDefaultKubectlManifests()
// Set makes sure default values are set on a SkaffoldPipeline.
func Set(c *latest.SkaffoldPipeline) error {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is elegant, I like the defaults.Set form. Thank you!

"github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util"
)

// Upgrade upgrades a configuration to the next version.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Upgrade upgrades a configuration to the next version.
// Upgrade upgrades a configuration to the next version.
// Config changes from v1beta1 to v1beta2
// 1. No additions
// 2. No removals
// 3. No updates

Fixes GoogleContainerTools#1373

Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
+ Removes a lot of dead code
+ Make it easier to create new config versions

Signed-off-by: David Gageot <david@gageot.net>
@dgageot
Copy link
Copy Markdown
Contributor Author

dgageot commented Dec 8, 2018

@balopat Thanks for reviewing. It's still cumbersome to introduce a new version, no matter how hard I try to reduced the size of the changeset. With this PR, it should be a bit easier though.

@balopat
Copy link
Copy Markdown
Contributor

balopat commented Dec 8, 2018

Agreed - I think that some of the new version introduction should be scriptable, we can scaffold the basics based on an example of the current and the new config.

@balopat balopat merged commit dfad084 into GoogleContainerTools:master Dec 8, 2018
@dgageot dgageot deleted the config-v1beta2 branch December 28, 2018 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants