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

chore: delete unused helm fields and methods from v1 -> v2 migration #8461

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions docs-v2/content/en/schemas/v4beta3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2063,23 +2063,6 @@
"description": "defines the manifests from helm releases.",
"x-intellij-html-description": "defines the manifests from helm releases."
},
"HelmConventionConfig": {
"properties": {
"explicitRegistry": {
"type": "boolean",
"description": "separates `image.registry` to the image config syntax. Useful for some charts e.g. `postgresql`.",
"x-intellij-html-description": "separates <code>image.registry</code> to the image config syntax. Useful for some charts e.g. <code>postgresql</code>.",
"default": "false"
}
},
"preferredOrder": [
"explicitRegistry"
],
"additionalProperties": false,
"type": "object",
"description": "image config in the syntax of image.repository and image.tag.",
"x-intellij-html-description": "image config in the syntax of image.repository and image.tag."
},
"HelmDeployFlags": {
"properties": {
"global": {
Expand Down Expand Up @@ -2120,44 +2103,6 @@
"description": "additional option flags that are passed on the command line to `helm`.",
"x-intellij-html-description": "additional option flags that are passed on the command line to <code>helm</code>."
},
"HelmFQNConfig": {
"properties": {
"property": {
"type": "string",
"description": "defines the image config.",
"x-intellij-html-description": "defines the image config."
}
},
"preferredOrder": [
"property"
],
"additionalProperties": false,
"type": "object",
"description": "image config to use the FullyQualifiedImageName as param to set.",
"x-intellij-html-description": "image config to use the FullyQualifiedImageName as param to set."
},
"HelmImageConfig": {
"properties": {
"fqn": {
"$ref": "#/definitions/HelmFQNConfig",
"description": "image configuration uses the syntax `IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG`.",
"x-intellij-html-description": "image configuration uses the syntax <code>IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG</code>."
},
"helm": {
"$ref": "#/definitions/HelmConventionConfig",
"description": "image configuration uses the syntax `IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG`.",
"x-intellij-html-description": "image configuration uses the syntax <code>IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG</code>."
}
},
"preferredOrder": [
"fqn",
"helm"
],
"additionalProperties": false,
"type": "object",
"description": "describes an image configuration.",
"x-intellij-html-description": "describes an image configuration."
},
"HelmPackaged": {
"properties": {
"appVersion": {
Expand Down
71 changes: 0 additions & 71 deletions pkg/skaffold/deploy/helm/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1148,77 +1148,6 @@ func TestHelmDependencies(t *testing.T) {
}
}

func TestImageSetFromConfig(t *testing.T) {
tests := []struct {
description string
valueName string
tag string
expected string
strategy *latest.HelmConventionConfig
shouldErr bool
}{
{
description: "Helm set values with no convention config",
valueName: "image",
tag: "skaffold-helm:1.0.0",
expected: "image=skaffold-helm:1.0.0",
strategy: nil,
shouldErr: false,
},
{
description: "Helm set values with helm conventions",
valueName: "image",
tag: "skaffold-helm:1.0.0",
expected: "image.repository=skaffold-helm,image.tag=1.0.0",
strategy: &latest.HelmConventionConfig{},
shouldErr: false,
},
{
description: "Helm set values with helm conventions and explicit registry value",
valueName: "image",
tag: "docker.io/skaffold-helm:1.0.0",
expected: "image.registry=docker.io,image.repository=skaffold-helm,image.tag=1.0.0",
strategy: &latest.HelmConventionConfig{
ExplicitRegistry: true,
},
shouldErr: false,
},
{
description: "Invalid tag with helm conventions",
valueName: "image",
tag: "skaffold-helm:1.0.0,0",
expected: "",
strategy: &latest.HelmConventionConfig{},
shouldErr: true,
},
{
description: "Helm set values with helm conventions and explicit registry value, but missing in tag",
valueName: "image",
tag: "skaffold-helm:1.0.0",
expected: "",
strategy: &latest.HelmConventionConfig{
ExplicitRegistry: true,
},
shouldErr: true,
},
{
description: "Helm set values using digest",
valueName: "image",
tag: "skaffold-helm:stable@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2",
expected: "image.repository=skaffold-helm,image.tag=stable@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2",
strategy: &latest.HelmConventionConfig{},
shouldErr: false,
},
}
for _, test := range tests {
testutil.Run(t, test.description, func(t *testutil.T) {
values, err := imageSetFromConfig(test.strategy, test.valueName, test.tag)
t.CheckError(test.shouldErr, err)
t.CheckDeepEqual(test.expected, values)
})
}
}

func TestHelmRender(t *testing.T) {
tests := []struct {
description string
Expand Down
52 changes: 0 additions & 52 deletions pkg/skaffold/deploy/helm/util.go

This file was deleted.

21 changes: 0 additions & 21 deletions pkg/skaffold/schema/latest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -912,27 +912,6 @@ type HelmPackaged struct {
AppVersion string `yaml:"appVersion,omitempty"`
}

// HelmImageConfig describes an image configuration.
type HelmImageConfig struct {
// HelmFQNConfig is the image configuration uses the syntax `IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG`.
HelmFQNConfig *HelmFQNConfig `yaml:"fqn,omitempty" yamltags:"oneOf=helmImageStrategy"`

// HelmConventionConfig is the image configuration uses the syntax `IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG`.
HelmConventionConfig *HelmConventionConfig `yaml:"helm,omitempty" yamltags:"oneOf=helmImageStrategy"`
}

// HelmFQNConfig is the image config to use the FullyQualifiedImageName as param to set.
type HelmFQNConfig struct {
// Property defines the image config.
Property string `yaml:"property,omitempty"`
}

// HelmConventionConfig is the image config in the syntax of image.repository and image.tag.
type HelmConventionConfig struct {
// ExplicitRegistry separates `image.registry` to the image config syntax. Useful for some charts e.g. `postgresql`.
ExplicitRegistry bool `yaml:"explicitRegistry,omitempty"`
}

// LogsConfig configures how container logs are printed as a result of a deployment.
type LogsConfig struct {
// Prefix defines the prefix shown on each log line. Valid values are
Expand Down