Skip to content

Commit eb2e354

Browse files
authored
Merge pull request #80 from flanksource/fix-ready
fix: generic isReady logic
2 parents 2d8fd48 + b704983 commit eb2e354

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ go 1.16
55
require (
66
github.com/AlekSi/pointer v1.1.0
77
github.com/TomOnTime/utfutil v0.0.0-20210710122150-437f72b26edf
8-
github.com/flanksource/commons v1.5.13
8+
github.com/flanksource/commons v1.5.14
99
github.com/gomarkdown/markdown v0.0.0-20210820032736-385812cbea76
1010
github.com/hairyhenderson/gomplate/v3 v3.6.0
1111
github.com/mitchellh/mapstructure v1.3.3
1212
github.com/mitchellh/reflectwalk v1.0.0
13-
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
13+
github.com/patrickmn/go-cache v2.1.0+incompatible
1414
github.com/pkg/errors v0.9.1
1515
github.com/sergi/go-diff v1.0.0
1616
github.com/sirupsen/logrus v1.7.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
183183
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
184184
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
185185
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
186-
github.com/flanksource/commons v1.5.12 h1:uqzlZQUwOUB0OvfLPU3c+iYdN+i768HkyAItJgGyVW8=
187-
github.com/flanksource/commons v1.5.12/go.mod h1:TEIeK5ak2VNYgmrYHNSFoX4UjHqQuSXOYvH4waLL5os=
186+
github.com/flanksource/commons v1.5.14 h1:XXyLQWmGTJ9re8lBEuETI5txbLItWZWepIEGJn9U/0k=
187+
github.com/flanksource/commons v1.5.14/go.mod h1:TEIeK5ak2VNYgmrYHNSFoX4UjHqQuSXOYvH4waLL5os=
188188
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
189189
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
190190
github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=

wait.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ func (c *Client) IsReady(item *unstructured.Unstructured) (bool, string) {
270270
}
271271
for _, raw := range conditions {
272272
condition := raw.(map[string]interface{})
273-
if condition["type"] != "Ready" && condition["status"] != "True" {
273+
if condition["type"] != "Ready" && condition["status"] != "False" {
274+
return false, fmt.Sprintf("⏳ waiting for %s/%s: %s", condition["type"], condition["status"], condition["message"])
275+
}
276+
if condition["type"] == "Ready" && condition["status"] != "True" {
274277
return false, fmt.Sprintf("⏳ waiting for %s/%s: %s", condition["type"], condition["status"], condition["message"])
275278
}
276279
}

0 commit comments

Comments
 (0)