Skip to content

Commit

Permalink
add support for helm image convention vs fqn setting
Browse files Browse the repository at this point in the history
  • Loading branch information
bivas committed Jul 17, 2018
1 parent e6f37af commit acc1927
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/skaffold/deploy/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,14 @@ func (h *HelmDeployer) deployRelease(out io.Writer, r v1alpha2.HelmRelease, buil
var setOpts []string
for k, v := range params {
setOpts = append(setOpts, "--set")
setOpts = append(setOpts, fmt.Sprintf("%s=%s", k, v.Tag))
if r.ImageStrategy.HelmImageConfig.HelmFQNConfig != nil {
setOpts = append(setOpts, fmt.Sprintf("%s=%s", k, v.Tag))
} else {
tagSplit := strings.Split(v.Tag, ":")
imageRepository := fmt.Sprintf("%s.repository=%s", k, tagSplit[0])
imageTag := fmt.Sprintf("%s.tag=%s", k, tagSplit[1])
setOpts = append(setOpts, imageRepository, imageTag)
}
}

// First build dependencies.
Expand Down
19 changes: 19 additions & 0 deletions pkg/skaffold/schema/v1alpha2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ type HelmRelease struct {
Wait bool `yaml:"wait"`
Overrides map[string]interface{} `yaml:"overrides"`
Packaged *HelmPackaged `yaml:"packaged"`
ImageStrategy HelmImageStrategy `yaml:"imageStrategy"`
}

// HelmPackaged represents parameters for packaging helm chart.
Expand All @@ -161,6 +162,24 @@ type HelmPackaged struct {
AppVersion string `yaml:"appVersion"`
}

type HelmImageStrategy struct {
HelmImageConfig `yaml:",inline"`
}

type HelmImageConfig struct {
HelmFQNConfig *HelmFQNConfig `yaml:"fqn"`
HelmConventionConfig *HelmConventionConfig `yaml:"helm"`
}

// HelmFQNConfig represents image config to use the FullyQualifiedImageName as param to set
type HelmFQNConfig struct {
Property string `yaml:"property"`
}

// HelmConventionConfig represents image config in the syntax of image.repository and image.tag
type HelmConventionConfig struct {
}

// Artifact represents items that need to be built, along with the context in which
// they should be built.
type Artifact struct {
Expand Down

0 comments on commit acc1927

Please sign in to comment.