(plugins []string, pluginEnvs PluginEnvVars, k8sVersion string, client image.Client)
| 492 | } |
| 493 | |
| 494 | func collectPluginsImages(plugins []string, pluginEnvs PluginEnvVars, k8sVersion string, client image.Client) ([]string, error) { |
| 495 | images := []string{ |
| 496 | config.DefaultImage, |
| 497 | } |
| 498 | for _, plugin := range plugins { |
| 499 | switch plugin { |
| 500 | case systemdLogsPlugin: |
| 501 | images = append(images, config.DefaultSystemdLogsImage) |
| 502 | case e2ePlugin: |
| 503 | conformanceImage := fmt.Sprintf("%v:%v", config.UpstreamKubeConformanceImageURL, k8sVersion) |
| 504 | images = append(images, conformanceImage) |
| 505 | logrus.Info("e2e image to be used: ", conformanceImage) |
| 506 | |
| 507 | // pull before running to ensure stderr is empty, because... |
| 508 | client.PullImages([]string{conformanceImage}, numDockerRetries) |
| 509 | |
| 510 | // we only need stdout, but this combines stdout and stderr |
| 511 | e2eImages, err := client.RunImage(conformanceImage, "e2e.test", pluginEnvs[e2ePlugin], "--list-images") |
| 512 | if err != nil { |
| 513 | return images, errors.Wrap(err, "failed to gather test images from e2e image") |
| 514 | } |
| 515 | |
| 516 | // in case there are empty newlines getting parsed as a slice element |
| 517 | validE2eImages := []string{} |
| 518 | for _, e2eImage := range e2eImages { |
| 519 | if e2eImage != "" { |
| 520 | validE2eImages = append(validE2eImages, e2eImage) |
| 521 | } |
| 522 | } |
| 523 | images = append(images, validE2eImages...) |
| 524 | default: |
| 525 | return images, errors.Errorf("Unsupported plugin: %v", plugin) |
| 526 | } |
| 527 | } |
| 528 | return images, nil |
| 529 | } |
no test coverage detected