Skip to content

Commit

Permalink
Merge pull request #2015 from dgageot/fix-2005
Browse files Browse the repository at this point in the history
Rename SkaffoldPipeline to SkaffoldConfig
  • Loading branch information
nkubala authored Apr 24, 2019
2 parents 8eae1a8 + 7318c86 commit 3d87a2a
Show file tree
Hide file tree
Showing 51 changed files with 193 additions and 193 deletions.
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -263,7 +263,7 @@
],
"additionalProperties": false
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1alpha2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -611,7 +611,7 @@
"description": "contains the configuration for the SHA tagger.",
"x-intellij-html-description": "contains the configuration for the SHA tagger."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1alpha3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -628,7 +628,7 @@
"description": "contains the configuration for the SHA tagger.",
"x-intellij-html-description": "contains the configuration for the SHA tagger."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1alpha4.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -761,7 +761,7 @@
"description": "contains the configuration for the SHA tagger.",
"x-intellij-html-description": "contains the configuration for the SHA tagger."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1alpha5.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -805,7 +805,7 @@
"description": "contains the configuration for the SHA tagger.",
"x-intellij-html-description": "contains the configuration for the SHA tagger."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -783,7 +783,7 @@
"description": "contains the configuration for the SHA tagger.",
"x-intellij-html-description": "contains the configuration for the SHA tagger."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -791,7 +791,7 @@
"description": "contains the configuration for the SHA tagger.",
"x-intellij-html-description": "contains the configuration for the SHA tagger."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1beta3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -820,7 +820,7 @@
"description": "contains the configuration for the SHA tagger.",
"x-intellij-html-description": "contains the configuration for the SHA tagger."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1beta4.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -855,7 +855,7 @@
"description": "contains the configuration for the SHA tagger.",
"x-intellij-html-description": "contains the configuration for the SHA tagger."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1beta5.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -1331,7 +1331,7 @@
"description": "*beta* tags images with their sha256 digest.",
"x-intellij-html-description": "<em>beta</em> tags images with their sha256 digest."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1beta6.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -1380,7 +1380,7 @@
"description": "*beta* tags images with their sha256 digest.",
"x-intellij-html-description": "<em>beta</em> tags images with their sha256 digest."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/schemas/v1beta7.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/SkaffoldPipeline"
"$ref": "#/definitions/SkaffoldConfig"
}
],
"$schema": "http://json-schema-org/draft-07/schema#",
Expand Down Expand Up @@ -1481,7 +1481,7 @@
"description": "*beta* tags images with their sha256 digest.",
"x-intellij-html-description": "<em>beta</em> tags images with their sha256 digest."
},
"SkaffoldPipeline": {
"SkaffoldConfig": {
"properties": {
"apiVersion": {
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/initializer/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func DoInit(out io.Writer, c Config) error {
}
}

pipeline, err := generateSkaffoldPipeline(k, pairs)
pipeline, err := generateSkaffoldConfig(k, pairs)
if err != nil {
return err
}
Expand Down Expand Up @@ -237,7 +237,7 @@ func processBuildArtifacts(pairs []dockerfilePair) latest.BuildConfig {
return config
}

func generateSkaffoldPipeline(k Initializer, dockerfilePairs []dockerfilePair) ([]byte, error) {
func generateSkaffoldConfig(k Initializer, dockerfilePairs []dockerfilePair) ([]byte, error) {
// 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")
Expand Down
12 changes: 6 additions & 6 deletions pkg/skaffold/schema/v1alpha1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ import (

const Version string = "skaffold/v1alpha1"

// NewSkaffoldPipeline creates a SkaffoldPipeline
func NewSkaffoldPipeline() util.VersionedConfig {
return new(SkaffoldPipeline)
// NewSkaffoldConfig creates a SkaffoldConfig
func NewSkaffoldConfig() util.VersionedConfig {
return new(SkaffoldConfig)
}

// SkaffoldPipeline is the top level config object
// SkaffoldConfig is the top level config object
// that is parsed from a skaffold.yaml
type SkaffoldPipeline struct {
type SkaffoldConfig struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`

Build BuildConfig `yaml:"build"`
Deploy DeployConfig `yaml:"deploy"`
}

func (config *SkaffoldPipeline) GetVersion() string {
func (config *SkaffoldConfig) GetVersion() string {
return config.APIVersion
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/schema/v1alpha1/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
// 3. Updates
// - TagPolicy is a struct
//
func (config *SkaffoldPipeline) Upgrade() (util.VersionedConfig, error) {
func (config *SkaffoldConfig) Upgrade() (util.VersionedConfig, error) {
var tagPolicy next.TagPolicy
if config.Build.TagPolicy == constants.TagStrategySha256 {
tagPolicy = next.TagPolicy{
Expand Down Expand Up @@ -111,7 +111,7 @@ func (config *SkaffoldPipeline) Upgrade() (util.VersionedConfig, error) {
}
}

return &next.SkaffoldPipeline{
return &next.SkaffoldConfig{
APIVersion: next.Version,
Kind: config.Kind,
Deploy: next.DeployConfig{
Expand Down
10 changes: 5 additions & 5 deletions pkg/skaffold/schema/v1alpha1/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ deploy:
}

func verifyUpgrade(t *testing.T, input, output string) {
pipeline := NewSkaffoldPipeline()
err := yaml.UnmarshalStrict([]byte(input), pipeline)
testutil.CheckErrorAndDeepEqual(t, false, err, Version, pipeline.GetVersion())
config := NewSkaffoldConfig()
err := yaml.UnmarshalStrict([]byte(input), config)
testutil.CheckErrorAndDeepEqual(t, false, err, Version, config.GetVersion())

upgraded, err := pipeline.Upgrade()
upgraded, err := config.Upgrade()
testutil.CheckError(t, false, err)

expected := v1alpha2.NewSkaffoldPipeline()
expected := v1alpha2.NewSkaffoldConfig()
err = yaml.UnmarshalStrict([]byte(output), expected)

testutil.CheckErrorAndDeepEqual(t, false, err, expected, upgraded)
Expand Down
10 changes: 5 additions & 5 deletions pkg/skaffold/schema/v1alpha2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (

const Version string = "skaffold/v1alpha2"

// NewSkaffoldPipeline creates a SkaffoldPipeline
func NewSkaffoldPipeline() util.VersionedConfig {
return new(SkaffoldPipeline)
// NewSkaffoldConfig creates a SkaffoldConfig
func NewSkaffoldConfig() util.VersionedConfig {
return new(SkaffoldConfig)
}

type SkaffoldPipeline struct {
type SkaffoldConfig struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`

Expand All @@ -36,7 +36,7 @@ type SkaffoldPipeline struct {
Profiles []Profile `yaml:"profiles,omitempty"`
}

func (c *SkaffoldPipeline) GetVersion() string {
func (c *SkaffoldConfig) GetVersion() string {
return c.APIVersion
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/schema/v1alpha2/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
// 3. Updates
// - KanikoBuildContext instead of GCSBucket
// - HelmRelease.valuesFilePath -> valuesFiles in yaml
func (config *SkaffoldPipeline) Upgrade() (util.VersionedConfig, error) {
func (config *SkaffoldConfig) Upgrade() (util.VersionedConfig, error) {
// convert Deploy (should be the same)
var newDeploy next.DeployConfig
if err := convert(config.Deploy, &newDeploy); err != nil {
Expand Down Expand Up @@ -87,7 +87,7 @@ func (config *SkaffoldPipeline) Upgrade() (util.VersionedConfig, error) {
}
}

return &next.SkaffoldPipeline{
return &next.SkaffoldConfig{
APIVersion: next.Version,
Kind: config.Kind,
Deploy: newDeploy,
Expand Down
10 changes: 5 additions & 5 deletions pkg/skaffold/schema/v1alpha2/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ deploy:
}

func verifyUpgrade(t *testing.T, input, output string) {
pipeline := NewSkaffoldPipeline()
err := yaml.UnmarshalStrict([]byte(input), pipeline)
testutil.CheckErrorAndDeepEqual(t, false, err, Version, pipeline.GetVersion())
config := NewSkaffoldConfig()
err := yaml.UnmarshalStrict([]byte(input), config)
testutil.CheckErrorAndDeepEqual(t, false, err, Version, config.GetVersion())

upgraded, err := pipeline.Upgrade()
upgraded, err := config.Upgrade()
testutil.CheckError(t, false, err)

expected := v1alpha3.NewSkaffoldPipeline()
expected := v1alpha3.NewSkaffoldConfig()
err = yaml.UnmarshalStrict([]byte(output), expected)

testutil.CheckErrorAndDeepEqual(t, false, err, expected, upgraded)
Expand Down
10 changes: 5 additions & 5 deletions pkg/skaffold/schema/v1alpha3/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (

const Version string = "skaffold/v1alpha3"

// NewSkaffoldPipeline creates a SkaffoldPipeline
func NewSkaffoldPipeline() util.VersionedConfig {
return new(SkaffoldPipeline)
// NewSkaffoldConfig creates a SkaffoldConfig
func NewSkaffoldConfig() util.VersionedConfig {
return new(SkaffoldConfig)
}

type SkaffoldPipeline struct {
type SkaffoldConfig struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`

Expand All @@ -36,7 +36,7 @@ type SkaffoldPipeline struct {
Profiles []Profile `yaml:"profiles,omitempty"`
}

func (c *SkaffoldPipeline) GetVersion() string {
func (c *SkaffoldConfig) GetVersion() string {
return c.APIVersion
}

Expand Down
Loading

0 comments on commit 3d87a2a

Please sign in to comment.