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
bc45e901
Commit
bc45e901
authored
Nov 21, 2017
by
Kai Chen
Committed by
Matt Butcher
Nov 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary parentheses in switch statements (#3175)
parent
3ee50ccf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
wait.go
pkg/kube/wait.go
+9
-9
No files found.
pkg/kube/wait.go
View file @
bc45e901
...
@@ -60,19 +60,19 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
...
@@ -60,19 +60,19 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
return
false
,
err
return
false
,
err
}
}
switch
value
:=
obj
.
(
type
)
{
switch
value
:=
obj
.
(
type
)
{
case
(
*
v1
.
ReplicationController
)
:
case
*
v1
.
ReplicationController
:
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
)
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
pods
=
append
(
pods
,
list
...
)
pods
=
append
(
pods
,
list
...
)
case
(
*
v1
.
Pod
)
:
case
*
v1
.
Pod
:
pod
,
err
:=
kcs
.
Core
()
.
Pods
(
value
.
Namespace
)
.
Get
(
value
.
Name
,
metav1
.
GetOptions
{})
pod
,
err
:=
kcs
.
Core
()
.
Pods
(
value
.
Namespace
)
.
Get
(
value
.
Name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
pods
=
append
(
pods
,
*
pod
)
pods
=
append
(
pods
,
*
pod
)
case
(
*
extensions
.
Deployment
)
:
case
*
extensions
.
Deployment
:
currentDeployment
,
err
:=
kcs
.
Extensions
()
.
Deployments
(
value
.
Namespace
)
.
Get
(
value
.
Name
,
metav1
.
GetOptions
{})
currentDeployment
,
err
:=
kcs
.
Extensions
()
.
Deployments
(
value
.
Namespace
)
.
Get
(
value
.
Name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
...
@@ -87,37 +87,37 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
...
@@ -87,37 +87,37 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
currentDeployment
,
currentDeployment
,
}
}
deployments
=
append
(
deployments
,
newDeployment
)
deployments
=
append
(
deployments
,
newDeployment
)
case
(
*
extensions
.
DaemonSet
)
:
case
*
extensions
.
DaemonSet
:
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
.
MatchLabels
)
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
.
MatchLabels
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
pods
=
append
(
pods
,
list
...
)
pods
=
append
(
pods
,
list
...
)
case
(
*
appsv1beta1
.
StatefulSet
)
:
case
*
appsv1beta1
.
StatefulSet
:
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
.
MatchLabels
)
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
.
MatchLabels
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
pods
=
append
(
pods
,
list
...
)
pods
=
append
(
pods
,
list
...
)
case
(
*
appsv1beta2
.
StatefulSet
)
:
case
*
appsv1beta2
.
StatefulSet
:
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
.
MatchLabels
)
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
.
MatchLabels
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
pods
=
append
(
pods
,
list
...
)
pods
=
append
(
pods
,
list
...
)
case
(
*
extensions
.
ReplicaSet
)
:
case
*
extensions
.
ReplicaSet
:
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
.
MatchLabels
)
list
,
err
:=
getPods
(
kcs
,
value
.
Namespace
,
value
.
Spec
.
Selector
.
MatchLabels
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
pods
=
append
(
pods
,
list
...
)
pods
=
append
(
pods
,
list
...
)
case
(
*
v1
.
PersistentVolumeClaim
)
:
case
*
v1
.
PersistentVolumeClaim
:
claim
,
err
:=
kcs
.
Core
()
.
PersistentVolumeClaims
(
value
.
Namespace
)
.
Get
(
value
.
Name
,
metav1
.
GetOptions
{})
claim
,
err
:=
kcs
.
Core
()
.
PersistentVolumeClaims
(
value
.
Namespace
)
.
Get
(
value
.
Name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
pvc
=
append
(
pvc
,
*
claim
)
pvc
=
append
(
pvc
,
*
claim
)
case
(
*
v1
.
Service
)
:
case
*
v1
.
Service
:
svc
,
err
:=
kcs
.
Core
()
.
Services
(
value
.
Namespace
)
.
Get
(
value
.
Name
,
metav1
.
GetOptions
{})
svc
,
err
:=
kcs
.
Core
()
.
Services
(
value
.
Namespace
)
.
Get
(
value
.
Name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
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