MCPcopy
hub / github.com/kubernetes/node-problem-detector / populateExternalIP

Method populateExternalIP

test/e2e/lib/gce/instance.go:123–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121}
122
123func (ins *Instance) populateExternalIP() {
124 gceInstance, err := ins.ComputeService.Instances.Get(ins.Project, ins.Zone, ins.Name).Do()
125 if err != nil {
126 return
127 }
128
129 for i := range gceInstance.NetworkInterfaces {
130 ni := gceInstance.NetworkInterfaces[i]
131 for j := range ni.AccessConfigs {
132 ac := ni.AccessConfigs[j]
133 if len(ac.NatIP) > 0 {
134 ins.ExternalIP = ac.NatIP
135 return
136 }
137 }
138 }
139}
140
141// RunCommand runs a command on the GCE instance and returns the command result.
142func (ins *Instance) RunCommand(cmd string) ssh.Result {

Callers 3

RunCommandMethod · 0.95
PushFileMethod · 0.95
CreateInstanceFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected