1
0
mirror of https://github.com/rancher/types.git synced 2025-08-02 05:11:59 +00:00

Only do initializing for rancher types

This commit is contained in:
Darren Shepherd 2018-01-30 08:52:55 -07:00
parent 019aa7fc1e
commit 3c6d1ba9b8

View File

@ -181,7 +181,8 @@ func Set(data map[string]interface{}) {
}
}
if state == "" && len(conditions) == 0 {
apiVersion, _ := values.GetValueN(data, "apiVersion").(string)
if state == "" && 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()) {