mirror of https://github.com/kubernetes/kops.git
Discover metadata on GCE instance
We simply weren't mapping it before, which was causing spurious changes.
This commit is contained in:
parent
b083e4f6bf
commit
0976ee1a73
|
@ -118,6 +118,17 @@ func (e *Instance) Find(c *fi.Context) (*Instance, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.Metadata != nil {
|
||||||
|
actual.Metadata = make(map[string]fi.Resource)
|
||||||
|
for _, i := range r.Metadata.Items {
|
||||||
|
if i.Value == nil {
|
||||||
|
glog.Warningf("ignoring GCE instance metadata entry with nil-value: %q", i.Key)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
actual.Metadata[i.Key] = fi.NewStringResource(*i.Value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return actual, nil
|
return actual, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue