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
0d3f14f0
Unverified
Commit
0d3f14f0
authored
May 12, 2017
by
vdice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(cmd/helm/installer): add support for upgrading service account
parent
5ed1c424
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
install.go
cmd/helm/installer/install.go
+1
-0
install_test.go
cmd/helm/installer/install_test.go
+10
-5
No files found.
cmd/helm/installer/install.go
View file @
0d3f14f0
...
...
@@ -58,6 +58,7 @@ func Upgrade(client internalclientset.Interface, opts *Options) error {
}
obj
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
Image
=
opts
.
selectImage
()
obj
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
ImagePullPolicy
=
opts
.
pullPolicy
()
obj
.
Spec
.
Template
.
Spec
.
ServiceAccountName
=
opts
.
ServiceAccount
if
_
,
err
:=
client
.
Extensions
()
.
Deployments
(
opts
.
Namespace
)
.
Update
(
obj
);
err
!=
nil
{
return
err
}
...
...
cmd/helm/installer/install_test.go
View file @
0d3f14f0
...
...
@@ -329,11 +329,12 @@ func TestInstall_canary(t *testing.T) {
func
TestUpgrade
(
t
*
testing
.
T
)
{
image
:=
"gcr.io/kubernetes-helm/tiller:v2.0.0"
serviceAccount
:=
"newServiceAccount"
existingDeployment
:=
deployment
(
&
Options
{
Namespace
:
api
.
NamespaceDefault
,
ImageSpec
:
"imageToReplace"
,
UseCanary
:
false
,
Namespace
:
api
.
NamespaceDefault
,
ImageSpec
:
"imageToReplace"
,
ServiceAccount
:
"serviceAccountToReplace"
,
UseCanary
:
false
,
})
existingService
:=
service
(
api
.
NamespaceDefault
)
...
...
@@ -347,13 +348,17 @@ func TestUpgrade(t *testing.T) {
if
i
!=
image
{
t
.
Errorf
(
"expected image = '%s', got '%s'"
,
image
,
i
)
}
sa
:=
obj
.
Spec
.
Template
.
Spec
.
ServiceAccountName
if
sa
!=
serviceAccount
{
t
.
Errorf
(
"expected serviceAccountName = '%s', got '%s'"
,
serviceAccount
,
sa
)
}
return
true
,
obj
,
nil
})
fc
.
AddReactor
(
"get"
,
"services"
,
func
(
action
testcore
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
return
true
,
existingService
,
nil
})
opts
:=
&
Options
{
Namespace
:
api
.
NamespaceDefault
,
ImageSpec
:
image
}
opts
:=
&
Options
{
Namespace
:
api
.
NamespaceDefault
,
ImageSpec
:
image
,
ServiceAccount
:
serviceAccount
}
if
err
:=
Upgrade
(
fc
,
opts
);
err
!=
nil
{
t
.
Errorf
(
"unexpected error: %#+v"
,
err
)
}
...
...
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