1
0
mirror of https://github.com/rancher/types.git synced 2025-09-18 07:52:41 +00:00

Embed crt status

This commit is contained in:
Darren Shepherd
2018-02-01 15:15:48 -07:00
parent 8775720ab6
commit c06cbd77c9
3 changed files with 7 additions and 4 deletions

View File

@@ -102,7 +102,7 @@ func Set(data map[string]interface{}) {
return
}
val, ok = values.GetValue(data, "status", "conditions")
val, conditionsOk := values.GetValue(data, "status", "conditions")
var conditions []condition
if err := convert.ToObj(val, &conditions); err != nil {
// ignore error
@@ -182,7 +182,7 @@ func Set(data map[string]interface{}) {
}
apiVersion, _ := values.GetValueN(data, "apiVersion").(string)
if state == "" && len(conditions) == 0 && strings.Contains(apiVersion, "cattle.io") {
if state == "" && conditionsOk && len(conditions) == 0 && strings.Contains(apiVersion, "cattle.io") {
if val, ok := values.GetValue(data, "metadata", "created"); ok {
if i, err := convert.ToTimestamp(val); err == nil {
if time.Unix(i/1000, 0).Add(5 * time.Second).After(time.Now()) {