Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
264ad327
Commit
264ad327
authored
Apr 11, 2017
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(init): use ImagePullPolicy Always for canary installs
fixes: #2155
parent
1cf37fd6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
install.go
cmd/helm/installer/install.go
+2
-2
install_test.go
cmd/helm/installer/install_test.go
+12
-7
options.go
cmd/helm/installer/options.go
+9
-0
No files found.
cmd/helm/installer/install.go
View file @
264ad327
...
...
@@ -20,7 +20,6 @@ import (
"io/ioutil"
"github.com/ghodss/yaml"
"k8s.io/kubernetes/pkg/api"
kerrors
"k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/apis/extensions"
...
...
@@ -57,6 +56,7 @@ func Upgrade(client internalclientset.Interface, opts *Options) error {
return
err
}
obj
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
Image
=
opts
.
selectImage
()
obj
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
ImagePullPolicy
=
opts
.
pullPolicy
()
if
_
,
err
:=
client
.
Extensions
()
.
Deployments
(
opts
.
Namespace
)
.
Update
(
obj
);
err
!=
nil
{
return
err
}
...
...
@@ -138,7 +138,7 @@ func generateDeployment(opts *Options) *extensions.Deployment {
{
Name
:
"tiller"
,
Image
:
opts
.
selectImage
(),
ImagePullPolicy
:
"IfNotPresent"
,
ImagePullPolicy
:
opts
.
pullPolicy
()
,
Ports
:
[]
api
.
ContainerPort
{
{
ContainerPort
:
44134
,
Name
:
"tiller"
},
},
...
...
cmd/helm/installer/install_test.go
View file @
264ad327
...
...
@@ -34,14 +34,15 @@ import (
func
TestDeploymentManifest
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
name
string
image
string
canary
bool
expect
string
name
string
image
string
canary
bool
expect
string
imagePullPolicy
api
.
PullPolicy
}{
{
"default"
,
""
,
false
,
"gcr.io/kubernetes-helm/tiller:"
+
version
.
Version
},
{
"canary"
,
"example.com/tiller"
,
true
,
"gcr.io/kubernetes-helm/tiller:canary"
},
{
"custom"
,
"example.com/tiller:latest"
,
false
,
"example.com/tiller:latest"
},
{
"default"
,
""
,
false
,
"gcr.io/kubernetes-helm/tiller:"
+
version
.
Version
,
"IfNotPresent"
},
{
"canary"
,
"example.com/tiller"
,
true
,
"gcr.io/kubernetes-helm/tiller:canary"
,
"Always"
},
{
"custom"
,
"example.com/tiller:latest"
,
false
,
"example.com/tiller:latest"
,
"IfNotPresent"
},
}
for
_
,
tt
:=
range
tests
{
...
...
@@ -58,6 +59,10 @@ func TestDeploymentManifest(t *testing.T) {
t
.
Errorf
(
"%s: expected image %q, got %q"
,
tt
.
name
,
tt
.
expect
,
got
)
}
if
got
:=
dep
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
ImagePullPolicy
;
got
!=
tt
.
imagePullPolicy
{
t
.
Errorf
(
"%s: expected imagePullPolicy %q, got %q"
,
tt
.
name
,
tt
.
imagePullPolicy
,
got
)
}
if
got
:=
dep
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
Env
[
0
]
.
Value
;
got
!=
api
.
NamespaceDefault
{
t
.
Errorf
(
"%s: expected namespace %q, got %q"
,
tt
.
name
,
api
.
NamespaceDefault
,
got
)
}
...
...
cmd/helm/installer/options.go
View file @
264ad327
...
...
@@ -18,7 +18,9 @@ package installer // import "k8s.io/helm/cmd/helm/installer"
import
(
"fmt"
"k8s.io/helm/pkg/version"
"k8s.io/kubernetes/pkg/api"
)
const
defaultImage
=
"gcr.io/kubernetes-helm/tiller"
...
...
@@ -76,4 +78,11 @@ func (opts *Options) selectImage() string {
}
}
func
(
opts
*
Options
)
pullPolicy
()
api
.
PullPolicy
{
if
opts
.
UseCanary
{
return
api
.
PullAlways
}
return
api
.
PullIfNotPresent
}
func
(
opts
*
Options
)
tls
()
bool
{
return
opts
.
EnableTLS
||
opts
.
VerifyTLS
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment