MCPcopy Index your code
hub / github.com/devspace-sh/devspace / recordHookExecuted

Function recordHookExecuted

pkg/devspace/hook/remote_command.go:119–137  ·  view source on GitHub ↗
(ctx context.Context, command string, args []string, podContainer *selector.SelectedPodContainer, client kubectl.Client)

Source from the content-addressed store, hash-verified

117}
118
119func recordHookExecuted(ctx context.Context, command string, args []string, podContainer *selector.SelectedPodContainer, client kubectl.Client) error {
120 cmdHash := commandHash(command, args)
121 cmd := []string{"touch", fmt.Sprintf(`/tmp/hook-%s`, cmdHash)}
122 stdout := new(bytes.Buffer)
123 stderr := new(bytes.Buffer)
124
125 err := client.ExecStream(ctx, &kubectl.ExecStreamOptions{
126 Pod: podContainer.Pod,
127 Container: podContainer.Container.Name,
128 Command: cmd,
129 Stdout: stdout,
130 Stderr: stderr,
131 })
132 if err != nil {
133 return err
134 }
135
136 return nil
137}

Callers 1

ExecuteRemotelyMethod · 0.85

Calls 2

commandHashFunction · 0.85
ExecStreamMethod · 0.65

Tested by

no test coverage detected