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
ed529798
Unverified
Commit
ed529798
authored
Dec 06, 2018
by
Taylor Thomas
Committed by
GitHub
Dec 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5015 from tariq1890/rm_k8s_dep
Remove k8s.io/kubernetes deps for simple pod and svc util methods
parents
158d6dbb
dc186e12
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
wait.go
pkg/kube/wait.go
+14
-4
No files found.
pkg/kube/wait.go
View file @
ed529798
...
...
@@ -29,8 +29,6 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
podutil
"k8s.io/kubernetes/pkg/api/v1/pod"
"k8s.io/kubernetes/pkg/apis/core/v1/helper"
deploymentutil
"k8s.io/kubernetes/pkg/controller/deployment/util"
)
...
...
@@ -203,7 +201,7 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
func
(
c
*
Client
)
podsReady
(
pods
[]
v1
.
Pod
)
bool
{
for
_
,
pod
:=
range
pods
{
if
!
podutil
.
I
sPodReady
(
&
pod
)
{
if
!
i
sPodReady
(
&
pod
)
{
c
.
Log
(
"Pod is not ready: %s/%s"
,
pod
.
GetNamespace
(),
pod
.
GetName
())
return
false
}
...
...
@@ -219,7 +217,7 @@ func (c *Client) servicesReady(svc []v1.Service) bool {
}
// Make sure the service is not explicitly set to "None" before checking the IP
if
s
.
Spec
.
ClusterIP
!=
v1
.
ClusterIPNone
&&
!
helper
.
IsServiceIPSet
(
&
s
)
{
if
s
.
Spec
.
ClusterIP
!=
v1
.
ClusterIPNone
&&
s
.
Spec
.
ClusterIP
==
""
{
c
.
Log
(
"Service is not ready: %s/%s"
,
s
.
GetNamespace
(),
s
.
GetName
())
return
false
}
...
...
@@ -259,3 +257,15 @@ func getPods(client kubernetes.Interface, namespace string, selector map[string]
})
return
list
.
Items
,
err
}
func
isPodReady
(
pod
*
v1
.
Pod
)
bool
{
if
&
pod
.
Status
!=
nil
&&
len
(
pod
.
Status
.
Conditions
)
>
0
{
for
_
,
condition
:=
range
pod
.
Status
.
Conditions
{
if
condition
.
Type
==
v1
.
PodReady
&&
condition
.
Status
==
v1
.
ConditionTrue
{
return
true
}
}
}
return
false
}
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