Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
1105 Внедрение механизмов обеспечения безопасности цепочки поставки программных проектов
Legacy
scanned-projects
helm
Commits
3bc2b5b1
Unverified
Commit
3bc2b5b1
authored
5 years ago
by
Matthew Fisher
Committed by
GitHub
5 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #5264 from ds-ms/waitIngress
Wait for ingress host to be ready
parents
94c3192f
91454585
release-2.17
dev-v2
release-2.15
release-2.16
v2.17.0
v2.17.0-rc.1
v2.16.12
v2.16.11
v2.16.10
v2.16.9
v2.16.8
v2.16.7
v2.16.6
v2.16.5
v2.16.4
v2.16.3
v2.16.2
v2.16.1
v2.16.0
v2.16.0-rc.2
v2.16.0-rc.1
v2.15.2
v2.15.1
v2.15.0
v2.15.0-rc.2
v2.15.0-rc.1
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/kube/wait.go
+18
-1
pkg/kube/wait.go
with
18 additions
and
1 deletion
+18
-1
pkg/kube/wait.go
+
18
−
1
View file @
3bc2b5b1
...
...
@@ -52,6 +52,7 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
services
:=
[]
v1
.
Service
{}
pvc
:=
[]
v1
.
PersistentVolumeClaim
{}
deployments
:=
[]
deployment
{}
ingresses
:=
[]
extensions
.
Ingress
{}
for
_
,
v
:=
range
created
{
switch
value
:=
asVersionedOrUnstructured
(
v
)
.
(
type
)
{
case
*
v1
.
ReplicationController
:
...
...
@@ -208,9 +209,15 @@ func (c *Client) waitForResources(timeout time.Duration, created Result) error {
return
false
,
err
}
services
=
append
(
services
,
*
svc
)
case
*
extensions
.
Ingress
:
ingress
,
err
:=
kcs
.
ExtensionsV1beta1
()
.
Ingresses
(
value
.
Namespace
)
.
Get
(
value
.
Name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
return
false
,
err
}
ingresses
=
append
(
ingresses
,
*
ingress
)
}
}
isReady
:=
c
.
podsReady
(
pods
)
&&
c
.
servicesReady
(
services
)
&&
c
.
volumesReady
(
pvc
)
&&
c
.
deploymentsReady
(
deployments
)
isReady
:=
c
.
podsReady
(
pods
)
&&
c
.
servicesReady
(
services
)
&&
c
.
volumesReady
(
pvc
)
&&
c
.
deploymentsReady
(
deployments
)
&&
c
.
ingressesReady
(
ingresses
)
return
isReady
,
nil
})
}
...
...
@@ -285,3 +292,13 @@ func isPodReady(pod *v1.Pod) bool {
}
return
false
}
func
(
c
*
Client
)
ingressesReady
(
ingresses
[]
extensions
.
Ingress
)
bool
{
for
_
,
ingress
:=
range
ingresses
{
if
&
ingress
.
Status
==
nil
||
len
(
ingress
.
Status
.
LoadBalancer
.
Ingress
)
==
0
{
c
.
Log
(
"Ingress is not ready: %s/%s"
,
ingress
.
GetNamespace
(),
ingress
.
GetName
())
return
false
}
}
return
true
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets