(ctx context.Context, client kubectl.Client, pod *v1.Pod, container string, filepath string)
| 271 | } |
| 272 | |
| 273 | func injectSyncHelper(ctx context.Context, client kubectl.Client, pod *v1.Pod, container string, filepath string) error { |
| 274 | // Stat sync helper |
| 275 | stat, err := os.Stat(filepath) |
| 276 | if err != nil { |
| 277 | return errors.Wrap(err, "stat sync helper") |
| 278 | } |
| 279 | |
| 280 | // Open file |
| 281 | f, err := os.Open(filepath) |
| 282 | if err != nil { |
| 283 | return errors.Wrap(err, "open file") |
| 284 | } |
| 285 | |
| 286 | defer f.Close() |
| 287 | return injectSyncHelperFromBytes(ctx, client, pod, container, stat, f) |
| 288 | } |
| 289 | |
| 290 | func injectSyncHelperFromBytes(ctx context.Context, client kubectl.Client, pod *v1.Pod, container string, fi fs.FileInfo, bytesReader io.Reader) error { |
| 291 | writerComplete := make(chan struct{}) |
no test coverage detected