@ -24,7 +24,7 @@ import (
"github.com/ghodss/yaml"
"github.com/ghodss/yaml"
appsv1 "k8s.io/api/apps/v1"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/kubernetes/fake"
@ -42,8 +42,8 @@ func TestDeployment(t *testing.T) {
expect string
expect string
imagePullPolicy v1 . PullPolicy
imagePullPolicy v1 . PullPolicy
} {
} {
{ "default" , "" , false , "g cr.io/kubernetes- helm/tiller:" + version . Version , "IfNotPresent" } ,
{ "default" , "" , false , "g h cr.io/helm/tiller:" + version . Version , "IfNotPresent" } ,
{ "canary" , "example.com/tiller" , true , "g cr.io/kubernetes- helm/tiller:canary", "Always" } ,
{ "canary" , "example.com/tiller" , true , "g h cr.io/helm/tiller:canary", "Always" } ,
{ "custom" , "example.com/tiller:latest" , false , "example.com/tiller:latest" , "IfNotPresent" } ,
{ "custom" , "example.com/tiller:latest" , false , "example.com/tiller:latest" , "IfNotPresent" } ,
}
}
@ -55,7 +55,7 @@ func TestDeployment(t *testing.T) {
// Unreleased versions of helm don't have a release image. See issue 3370
// Unreleased versions of helm don't have a release image. See issue 3370
if tt . name == "default" && version . BuildMetadata == "unreleased" {
if tt . name == "default" && version . BuildMetadata == "unreleased" {
tt . expect = "g cr.io/kubernetes- helm/tiller:canary"
tt . expect = "g h cr.io/helm/tiller:canary"
}
}
if got := dep . Spec . Template . Spec . Containers [ 0 ] . Image ; got != tt . expect {
if got := dep . Spec . Template . Spec . Containers [ 0 ] . Image ; got != tt . expect {
t . Errorf ( "%s: expected image %q, got %q" , tt . name , tt . expect , got )
t . Errorf ( "%s: expected image %q, got %q" , tt . name , tt . expect , got )
@ -80,8 +80,8 @@ func TestDeploymentForServiceAccount(t *testing.T) {
imagePullPolicy v1 . PullPolicy
imagePullPolicy v1 . PullPolicy
serviceAccount string
serviceAccount string
} {
} {
{ "withSA" , "" , false , "g cr.io/kubernetes- helm/tiller:latest", "IfNotPresent" , "service-account" } ,
{ "withSA" , "" , false , "g h cr.io/helm/tiller:latest", "IfNotPresent" , "service-account" } ,
{ "withoutSA" , "" , false , "g cr.io/kubernetes- helm/tiller:latest", "IfNotPresent" , "" } ,
{ "withoutSA" , "" , false , "g h cr.io/helm/tiller:latest", "IfNotPresent" , "" } ,
}
}
for _ , tt := range tests {
for _ , tt := range tests {
opts := & Options { Namespace : v1 . NamespaceDefault , ImageSpec : tt . image , UseCanary : tt . canary , ServiceAccount : tt . serviceAccount }
opts := & Options { Namespace : v1 . NamespaceDefault , ImageSpec : tt . image , UseCanary : tt . canary , ServiceAccount : tt . serviceAccount }
@ -187,7 +187,7 @@ func TestSecretManifest(t *testing.T) {
}
}
func TestInstall ( t * testing . T ) {
func TestInstall ( t * testing . T ) {
image := "g cr.io/kubernetes- helm/tiller:v2.0.0"
image := "g h cr.io/helm/tiller:v2.0.0"
fc := & fake . Clientset { }
fc := & fake . Clientset { }
fc . AddReactor ( "create" , "deployments" , func ( action testcore . Action ) ( bool , runtime . Object , error ) {
fc . AddReactor ( "create" , "deployments" , func ( action testcore . Action ) ( bool , runtime . Object , error ) {
@ -234,7 +234,7 @@ func TestInstall(t *testing.T) {
}
}
func TestInstallHA ( t * testing . T ) {
func TestInstallHA ( t * testing . T ) {
image := "g cr.io/kubernetes- helm/tiller:v2.0.0"
image := "g h cr.io/helm/tiller:v2.0.0"
fc := & fake . Clientset { }
fc := & fake . Clientset { }
fc . AddReactor ( "create" , "deployments" , func ( action testcore . Action ) ( bool , runtime . Object , error ) {
fc . AddReactor ( "create" , "deployments" , func ( action testcore . Action ) ( bool , runtime . Object , error ) {
@ -257,7 +257,7 @@ func TestInstallHA(t *testing.T) {
}
}
func TestInstall_WithTLS ( t * testing . T ) {
func TestInstall_WithTLS ( t * testing . T ) {
image := "g cr.io/kubernetes- helm/tiller:v2.0.0"
image := "g h cr.io/helm/tiller:v2.0.0"
name := "tiller-secret"
name := "tiller-secret"
fc := & fake . Clientset { }
fc := & fake . Clientset { }
@ -332,7 +332,7 @@ func TestInstall_canary(t *testing.T) {
fc . AddReactor ( "create" , "deployments" , func ( action testcore . Action ) ( bool , runtime . Object , error ) {
fc . AddReactor ( "create" , "deployments" , func ( action testcore . Action ) ( bool , runtime . Object , error ) {
obj := action . ( testcore . CreateAction ) . GetObject ( ) . ( * appsv1 . Deployment )
obj := action . ( testcore . CreateAction ) . GetObject ( ) . ( * appsv1 . Deployment )
i := obj . Spec . Template . Spec . Containers [ 0 ] . Image
i := obj . Spec . Template . Spec . Containers [ 0 ] . Image
if i != "g cr.io/kubernetes- helm/tiller:canary" {
if i != "g h cr.io/helm/tiller:canary" {
t . Errorf ( "expected canary image, got '%s'" , i )
t . Errorf ( "expected canary image, got '%s'" , i )
}
}
return true , obj , nil
return true , obj , nil
@ -353,7 +353,7 @@ func TestInstall_canary(t *testing.T) {
}
}
func TestUpgrade ( t * testing . T ) {
func TestUpgrade ( t * testing . T ) {
image := "g cr.io/kubernetes- helm/tiller:v2.0.0"
image := "g h cr.io/helm/tiller:v2.0.0"
serviceAccount := "newServiceAccount"
serviceAccount := "newServiceAccount"
existingDeployment , _ := generateDeployment ( & Options {
existingDeployment , _ := generateDeployment ( & Options {
Namespace : v1 . NamespaceDefault ,
Namespace : v1 . NamespaceDefault ,
@ -394,7 +394,7 @@ func TestUpgrade(t *testing.T) {
}
}
func TestUpgrade_serviceNotFound ( t * testing . T ) {
func TestUpgrade_serviceNotFound ( t * testing . T ) {
image := "g cr.io/kubernetes- helm/tiller:v2.0.0"
image := "g h cr.io/helm/tiller:v2.0.0"
existingDeployment , _ := generateDeployment ( & Options {
existingDeployment , _ := generateDeployment ( & Options {
Namespace : v1 . NamespaceDefault ,
Namespace : v1 . NamespaceDefault ,
@ -437,7 +437,7 @@ func TestUpgrade_serviceNotFound(t *testing.T) {
}
}
func TestUgrade_newerVersion ( t * testing . T ) {
func TestUgrade_newerVersion ( t * testing . T ) {
image := "g cr.io/kubernetes- helm/tiller:v2.0.0"
image := "g h cr.io/helm/tiller:v2.0.0"
serviceAccount := "newServiceAccount"
serviceAccount := "newServiceAccount"
existingDeployment , _ := generateDeployment ( & Options {
existingDeployment , _ := generateDeployment ( & Options {
Namespace : v1 . NamespaceDefault ,
Namespace : v1 . NamespaceDefault ,
@ -497,7 +497,7 @@ func TestUgrade_newerVersion(t *testing.T) {
}
}
func TestUpgrade_identical ( t * testing . T ) {
func TestUpgrade_identical ( t * testing . T ) {
image := "g cr.io/kubernetes- helm/tiller:v2.0.0"
image := "g h cr.io/helm/tiller:v2.0.0"
serviceAccount := "newServiceAccount"
serviceAccount := "newServiceAccount"
existingDeployment , _ := generateDeployment ( & Options {
existingDeployment , _ := generateDeployment ( & Options {
Namespace : v1 . NamespaceDefault ,
Namespace : v1 . NamespaceDefault ,
@ -538,7 +538,7 @@ func TestUpgrade_identical(t *testing.T) {
}
}
func TestUpgrade_canaryClient ( t * testing . T ) {
func TestUpgrade_canaryClient ( t * testing . T ) {
image := "g cr.io/kubernetes- helm/tiller:canary"
image := "g h cr.io/helm/tiller:canary"
serviceAccount := "newServiceAccount"
serviceAccount := "newServiceAccount"
existingDeployment , _ := generateDeployment ( & Options {
existingDeployment , _ := generateDeployment ( & Options {
Namespace : v1 . NamespaceDefault ,
Namespace : v1 . NamespaceDefault ,
@ -579,7 +579,7 @@ func TestUpgrade_canaryClient(t *testing.T) {
}
}
func TestUpgrade_canaryServer ( t * testing . T ) {
func TestUpgrade_canaryServer ( t * testing . T ) {
image := "g cr.io/kubernetes- helm/tiller:v2.0.0"
image := "g h cr.io/helm/tiller:v2.0.0"
serviceAccount := "newServiceAccount"
serviceAccount := "newServiceAccount"
existingDeployment , _ := generateDeployment ( & Options {
existingDeployment , _ := generateDeployment ( & Options {
Namespace : v1 . NamespaceDefault ,
Namespace : v1 . NamespaceDefault ,