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
570930be
Commit
570930be
authored
Mar 02, 2017
by
Taylor Thomas
Committed by
GitHub
Mar 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2046 from thomastaylor312/fix/2043-wait-panic
fix(tiller): Fixes `--wait` panic on upgrade
parents
59bb5aa1
9afa04b7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
client.go
pkg/kube/client.go
+5
-0
client_test.go
pkg/kube/client_test.go
+15
-10
No files found.
pkg/kube/client.go
View file @
570930be
...
...
@@ -391,6 +391,11 @@ func updateResource(c *Client, target *resource.Info, currentObj runtime.Object,
}
if
patch
==
nil
{
log
.
Printf
(
"Looks like there are no changes for %s"
,
target
.
Name
)
// This needs to happen to make sure that tiller has the latest info from the API
// Otherwise there will be no labels and other functions that use labels will panic
if
err
:=
target
.
Get
();
err
!=
nil
{
return
fmt
.
Errorf
(
"error trying to refresh resource information: %v"
,
err
)
}
return
nil
}
...
...
pkg/kube/client_test.go
View file @
570930be
...
...
@@ -147,14 +147,14 @@ func TestUpdate(t *testing.T) {
listB
.
Items
[
0
]
.
Spec
.
Containers
[
0
]
.
Ports
=
[]
api
.
ContainerPort
{{
Name
:
"https"
,
ContainerPort
:
443
}}
listC
.
Items
[
0
]
.
Spec
.
Containers
[
0
]
.
Ports
=
[]
api
.
ContainerPort
{{
Name
:
"https"
,
ContainerPort
:
443
}}
actions
:=
make
(
map
[
string
]
string
)
var
actions
[]
string
f
,
tf
,
codec
,
ns
:=
cmdtesting
.
NewAPIFactory
()
tf
.
Client
=
&
fake
.
RESTClient
{
NegotiatedSerializer
:
ns
,
Client
:
fake
.
CreateHTTPClient
(
func
(
req
*
http
.
Request
)
(
*
http
.
Response
,
error
)
{
p
,
m
:=
req
.
URL
.
Path
,
req
.
Method
actions
[
p
]
=
m
actions
=
append
(
actions
,
p
+
":"
+
m
)
t
.
Logf
(
"got request %s %s"
,
p
,
m
)
switch
{
case
p
==
"/namespaces/default/pods/starfish"
&&
m
==
"GET"
:
...
...
@@ -201,16 +201,21 @@ func TestUpdate(t *testing.T) {
// if err := c.Update("test", objBody(codec, &listC), objBody(codec, &listA), false, 2, true); err != nil {
// t.Fatal(err)
// }
expectedActions
:=
map
[
string
]
string
{
"/namespaces/default/pods/dolphin"
:
"GET"
,
"/namespaces/default/pods/otter"
:
"GET"
,
"/namespaces/default/pods/starfish"
:
"PATCH"
,
"/namespaces/default/pods"
:
"POST"
,
expectedActions
:=
[]
string
{
"/namespaces/default/pods/starfish:GET"
,
"/namespaces/default/pods/starfish:PATCH"
,
"/namespaces/default/pods/otter:GET"
,
"/namespaces/default/pods/otter:GET"
,
"/namespaces/default/pods/dolphin:GET"
,
"/namespaces/default/pods:POST"
,
}
if
len
(
expectedActions
)
!=
len
(
actions
)
{
t
.
Errorf
(
"unexpected number of requests, expected %d, got %d"
,
len
(
expectedActions
),
len
(
actions
))
return
}
for
k
,
v
:=
range
expectedActions
{
if
m
,
ok
:=
actions
[
k
];
!
ok
||
m
!=
v
{
t
.
Errorf
(
"expected
a %s request to %s"
,
k
,
v
)
if
actions
[
k
]
!=
v
{
t
.
Errorf
(
"expected
%s request got %s"
,
v
,
actions
[
k
]
)
}
}
...
...
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