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

Method PushFile

test/e2e/lib/gce/instance.go:158–169  ·  view source on GitHub ↗

PushFile pushes a local file to a GCE instance.

(srcPath, destPath string)

Source from the content-addressed store, hash-verified

156
157// PushFile pushes a local file to a GCE instance.
158func (ins *Instance) PushFile(srcPath, destPath string) error {
159 if ins.ExternalIP == "" {
160 ins.populateExternalIP()
161 }
162 output, err := exec.Command("scp", "-o", "StrictHostKeyChecking no",
163 "-i", ins.SshKey,
164 srcPath, fmt.Sprintf("%s@%s:%s", ins.SshUser, ins.ExternalIP, destPath)).CombinedOutput()
165 if err != nil {
166 return fmt.Errorf("Error running scp: %v.\nHere is the output for the command: %v", err, string(output))
167 }
168 return nil
169}
170
171// DeleteInstance deletes a GCE instance.
172func (ins *Instance) DeleteInstance() error {

Callers 1

SetupNPDFunction · 0.80

Calls 1

populateExternalIPMethod · 0.95

Tested by

no test coverage detected