diff --git a/cmd/helm/installer/install_test.go b/cmd/helm/installer/install_test.go index b769e736e..412b6025e 100644 --- a/cmd/helm/installer/install_test.go +++ b/cmd/helm/installer/install_test.go @@ -20,7 +20,6 @@ import ( "os" "path/filepath" "reflect" - "strings" "testing" "github.com/ghodss/yaml" @@ -59,7 +58,7 @@ func TestDeploymentManifest(t *testing.T) { } // Unreleased versions of helm don't have a release image. See issue 3370 - if tt.name == "default" && !(len(strings.Split(version.Version, ".")) > 2) { + if tt.name == "default" && version.BuildMetadata == "unreleased" { tt.expect = "gcr.io/kubernetes-helm/tiller:canary" } if got := dep.Spec.Template.Spec.Containers[0].Image; got != tt.expect { diff --git a/cmd/helm/installer/options.go b/cmd/helm/installer/options.go index c4e2c11b2..c4e71ec35 100644 --- a/cmd/helm/installer/options.go +++ b/cmd/helm/installer/options.go @@ -18,7 +18,6 @@ package installer // import "k8s.io/helm/cmd/helm/installer" import ( "fmt" - "strings" "k8s.io/api/core/v1" "k8s.io/helm/pkg/strvals" @@ -102,7 +101,7 @@ func (opts *Options) selectImage() string { case opts.UseCanary: return defaultImage + ":canary" case opts.ImageSpec == "": - if !(len(strings.Split(version.Version, ".")) > 2) { + if version.BuildMetadata == "unreleased" { return defaultImage + ":canary" } return fmt.Sprintf("%s:%s", defaultImage, version.Version)