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
cd8bae1d
Commit
cd8bae1d
authored
Sep 27, 2017
by
Maxim Ivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More helpful wait messages in tiller logs
parent
2b32fa44
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
wait.go
pkg/kube/wait.go
+10
-6
No files found.
pkg/kube/wait.go
View file @
cd8bae1d
...
@@ -122,22 +122,22 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
...
@@ -122,22 +122,22 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
services
=
append
(
services
,
*
svc
)
services
=
append
(
services
,
*
svc
)
}
}
}
}
isReady
:=
podsReady
(
pods
)
&&
servicesReady
(
services
)
&&
volumesReady
(
pvc
)
&&
deploymentsReady
(
deployments
)
isReady
:=
c
.
podsReady
(
pods
)
&&
c
.
servicesReady
(
services
)
&&
c
.
volumesReady
(
pvc
)
&&
c
.
deploymentsReady
(
deployments
)
c
.
Log
(
"resources ready: %v"
,
isReady
)
return
isReady
,
nil
return
isReady
,
nil
})
})
}
}
func
podsReady
(
pods
[]
v1
.
Pod
)
bool
{
func
(
c
*
Client
)
podsReady
(
pods
[]
v1
.
Pod
)
bool
{
for
_
,
pod
:=
range
pods
{
for
_
,
pod
:=
range
pods
{
if
!
podutil
.
IsPodReady
(
&
pod
)
{
if
!
podutil
.
IsPodReady
(
&
pod
)
{
c
.
Log
(
"Pod is not ready: %s/%s"
,
pod
.
GetNamespace
(),
pod
.
GetName
())
return
false
return
false
}
}
}
}
return
true
return
true
}
}
func
servicesReady
(
svc
[]
v1
.
Service
)
bool
{
func
(
c
*
Client
)
servicesReady
(
svc
[]
v1
.
Service
)
bool
{
for
_
,
s
:=
range
svc
{
for
_
,
s
:=
range
svc
{
// ExternalName Services are external to cluster so helm shouldn't be checking to see if they're 'ready' (i.e. have an IP Set)
// ExternalName Services are external to cluster so helm shouldn't be checking to see if they're 'ready' (i.e. have an IP Set)
if
s
.
Spec
.
Type
==
v1
.
ServiceTypeExternalName
{
if
s
.
Spec
.
Type
==
v1
.
ServiceTypeExternalName
{
...
@@ -146,28 +146,32 @@ func servicesReady(svc []v1.Service) bool {
...
@@ -146,28 +146,32 @@ func servicesReady(svc []v1.Service) bool {
// Make sure the service is not explicitly set to "None" before checking the IP
// 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
&&
!
helper
.
IsServiceIPSet
(
&
s
)
{
c
.
Log
(
"Service is not ready: %s/%s"
,
s
.
GetNamespace
(),
s
.
GetName
())
return
false
return
false
}
}
// This checks if the service has a LoadBalancer and that balancer has an Ingress defined
// This checks if the service has a LoadBalancer and that balancer has an Ingress defined
if
s
.
Spec
.
Type
==
v1
.
ServiceTypeLoadBalancer
&&
s
.
Status
.
LoadBalancer
.
Ingress
==
nil
{
if
s
.
Spec
.
Type
==
v1
.
ServiceTypeLoadBalancer
&&
s
.
Status
.
LoadBalancer
.
Ingress
==
nil
{
c
.
Log
(
"Service is not ready: %s/%s"
,
s
.
GetNamespace
(),
s
.
GetName
())
return
false
return
false
}
}
}
}
return
true
return
true
}
}
func
volumesReady
(
vols
[]
v1
.
PersistentVolumeClaim
)
bool
{
func
(
c
*
Client
)
volumesReady
(
vols
[]
v1
.
PersistentVolumeClaim
)
bool
{
for
_
,
v
:=
range
vols
{
for
_
,
v
:=
range
vols
{
if
v
.
Status
.
Phase
!=
v1
.
ClaimBound
{
if
v
.
Status
.
Phase
!=
v1
.
ClaimBound
{
c
.
Log
(
"PersistentVolumeClaim is not ready: %s/%s"
,
v
.
GetNamespace
(),
v
.
GetName
())
return
false
return
false
}
}
}
}
return
true
return
true
}
}
func
deploymentsReady
(
deployments
[]
deployment
)
bool
{
func
(
c
*
Client
)
deploymentsReady
(
deployments
[]
deployment
)
bool
{
for
_
,
v
:=
range
deployments
{
for
_
,
v
:=
range
deployments
{
if
!
(
v
.
replicaSets
.
Status
.
ReadyReplicas
>=
*
v
.
deployment
.
Spec
.
Replicas
-
deploymentutil
.
MaxUnavailable
(
*
v
.
deployment
))
{
if
!
(
v
.
replicaSets
.
Status
.
ReadyReplicas
>=
*
v
.
deployment
.
Spec
.
Replicas
-
deploymentutil
.
MaxUnavailable
(
*
v
.
deployment
))
{
c
.
Log
(
"Deployment is not ready: %s/%s"
,
v
.
deployment
.
GetNamespace
(),
v
.
deployment
.
GetName
())
return
false
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