Skip to content

Rename SkaffoldConfig to SkaffoldPipeline #1087

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

Merged
merged 3 commits into from
Oct 5, 2018

Conversation

nkubala
Copy link
Contributor

@nkubala nkubala commented Oct 3, 2018

This change is to eliminate internal confusion between the configuration specified in the skaffold.yaml, and for the global configuration values set through the skaffold config command.

This also removes the Kind: Config field from the skaffold.yaml, since it serves no purpose.

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.

In general I'm in favor for this!
One comment: I'd just probably keep it Pipeline instead of SkaffoldPipeline!

  • nits below

@@ -155,15 +155,15 @@ func (t *TestWatcher) Run(ctx context.Context, pollInterval time.Duration, onCha
func TestNewForConfig(t *testing.T) {
var tests = []struct {
description string
config *latest.SkaffoldConfig
config *latest.SkaffoldPipeline
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: rename config -> pipeline

// if we're here, the user has no skaffold yaml so we need to generate one
// if the user doesn't have any k8s yamls, generate one for each dockerfile
logrus.Info("generating skaffold config")

config := &latest.SkaffoldConfig{
config := &latest.SkaffoldPipeline{
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: config -> pipeline

@@ -231,14 +231,13 @@ func processBuildArtifacts(pairs []dockerfilePair) latest.BuildConfig {
return config
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: config -> pipeline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left BuildConfig and DeployConfig as they are, WDYT?

@@ -129,7 +129,7 @@ func doInit(out io.Writer) error {
}
}

cfg, err := generateSkaffoldConfig(k8sConfigs, pairs)
cfg, err := generateSkaffoldPipeline(k8sConfigs, pairs)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: cfg -> pipeline

Copy link
Contributor

@r2d4 r2d4 left a comment

Choose a reason for hiding this comment

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

Why? I don't think calling the skaffold.yaml the skaffold pipeline makes things much clearer.

The Kind allows us to make skaffold a real k8s resource at some point, such as a CRD.

// NewForConfig returns a new SkaffoldRunner for a SkaffoldConfig
func NewForConfig(opts *config.SkaffoldOptions, cfg *latest.SkaffoldConfig) (*SkaffoldRunner, error) {
// NewForConfig returns a new SkaffoldRunner for a SkaffoldPipeline
func NewForConfig(opts *config.SkaffoldOptions, cfg *latest.SkaffoldPipeline) (*SkaffoldRunner, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think its going to be a lot more confusing if functions like NewForConfig takes in a latest.SkaffoldPipeline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can always rename NewForConfig to NewForPipeline

@balopat
Copy link
Contributor

balopat commented Oct 4, 2018

Why? I don't think calling the skaffold.yaml the skaffold pipeline makes things much clearer.

@r2d4 the conversation started in #1057 (comment) - I think "global config" is a poor name - local config, global config ... it makes it very confusing to navigate the code (just like the 3 configs are in minikube).
The responsibility of skaffold.yaml is to configure the phases of your local pipeline and how they look in different environments - hence the pipeline makes sense as a name.

The Kind allows us to make skaffold a real k8s resource at some point, such as a CRD.

Maybe. If this is the only thing that makes a yaml a k8s resource then we can introduce it later. If there are other things - like metadata - we don't have those yet as they are not used for anything else...I'm not sure I'm convinced that we need this right now.

@nkubala
Copy link
Contributor Author

nkubala commented Oct 4, 2018

I don't think calling the skaffold.yaml the skaffold pipeline makes things much clearer.

This is mostly internal terminology, you can still refer to your skaffold.yaml as your "skaffold config", and your ~/.skaffold/config as your "global config".

The clash between the global config and the skaffold config file is getting a little confusing so I want to try and solve it. We could rename the global config to the "global preferences", but I'm not really a huge fan of that. It to me seems like more of a config file than the skaffold.yaml, which is really just specifying the pipeline that Skaffold should execute when it runs. Hence, the SkaffoldPipeline. WDYT?

@codecov-io
Copy link

codecov-io commented Oct 4, 2018

Codecov Report

Merging #1087 into master will increase coverage by 0.01%.
The diff coverage is 21.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1087      +/-   ##
==========================================
+ Coverage   43.16%   43.17%   +0.01%     
==========================================
  Files          74       74              
  Lines        3408     3407       -1     
==========================================
  Hits         1471     1471              
+ Misses       1799     1798       -1     
  Partials      138      138
Impacted Files Coverage Δ
pkg/skaffold/schema/versions.go 53.12% <ø> (ø) ⬆️
cmd/skaffold/app/cmd/init.go 0% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/runner.go 0% <0%> (ø) ⬆️
pkg/skaffold/runner/runner.go 51.68% <100%> (ø) ⬆️
pkg/skaffold/schema/profiles.go 92.53% <100%> (ø) ⬆️

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 d5853d4...07bca7d. Read the comment docs.

@nkubala
Copy link
Contributor Author

nkubala commented Oct 4, 2018

I added the Kind field back for now. I'll remove it later on in a different PR if we decide to go that route.

@nkubala
Copy link
Contributor Author

nkubala commented Oct 4, 2018

@balopat I'm not sure I like Pipeline over SkaffoldPipeline, for the reason the we had SkaffoldConfig instead of Config to make it more clear that "this is what Skaffold is going to run". I'll change it if you still think I should though.

@dgageot
Copy link
Contributor

dgageot commented Oct 5, 2018

I'm ok with the renaming. Not that I really thought it was required

@nkubala nkubala merged commit ee4f75b into GoogleContainerTools:master Oct 5, 2018
@nkubala nkubala deleted the pipeline branch October 5, 2018 20:46
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.

5 participants