(ctx context.Context, command string, args []string, podContainer *selector.SelectedPodContainer, client kubectl.Client)
| 117 | } |
| 118 | |
| 119 | func 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 | } |
no test coverage detected