Skip to content

Commit

Permalink
*: expose configuration of sonobuoy worker/systemd-logs container ove…
Browse files Browse the repository at this point in the history
…rrides (aws#190)
  • Loading branch information
cmdallas authored and mmerkes committed Dec 21, 2020
1 parent 31f4deb commit 17e5c4f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eks/conformance/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ func (ts *tester) runSonobuoy() (err error) {
"--show-default-podspec=true",
fmt.Sprintf("--timeout=%d", timeoutSeconds), // default "10800", 3-hour
}
if ts.cfg.EKSConfig.AddOnConformance.SonobuoyImage != "" {
args = append(args, "--sonobuoy-image=" + ts.cfg.EKSConfig.AddOnConformance.SonobuoyImage)
}
if ts.cfg.EKSConfig.AddOnConformance.SystemdLogsImage != "" {
args = append(args, "--systemd-logs-image=" + ts.cfg.EKSConfig.AddOnConformance.SystemdLogsImage)
}
cmd := strings.Join(args, " ")

ts.cfg.Logger.Info("running sonobuoy",
Expand Down
6 changes: 6 additions & 0 deletions eksconfig/add-on-conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ type AddOnConformance struct {
// SonobuoyDownloadURL is the download URL to download "sonobuoy" binary from.
// ref. https://github.com/vmware-tanzu/sonobuoy/releases
SonobuoyDownloadURL string `json:"sonobuoy-download-url,omitempty"`
// SonobuoyImage Container override for the sonobuoy worker image
SonobuoyImage string `json:"sonobuoy-image"`
// SystemdLogsImage Container override for systemd-logs plugin image
SystemdLogsImage string `json:"systemd-logs-image"`

SonobuoyDeleteTimeout time.Duration `json:"sonobuoy-delete-timeout"`
SonobuoyDeleteTimeoutString string `json:"sonobuoy-delete-timeout-string" read-only:"true"`
Expand Down Expand Up @@ -81,6 +85,8 @@ func getDefaultAddOnConformance() *AddOnConformance {
Enable: false,
SonobuoyPath: "/tmp/sonobuoy-v0.18.3",
SonobuoyDownloadURL: "https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.18.3/sonobuoy_0.18.3_linux_amd64.tar.gz",
SonobuoyImage: "",
SystemdLogsImage: "",
}
if runtime.GOOS == "darwin" {
addOn.SonobuoyDownloadURL = strings.Replace(addOn.SonobuoyDownloadURL, "linux", "darwin", -1)
Expand Down
10 changes: 10 additions & 0 deletions eksconfig/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,10 @@ func TestEnvAddOnConformance(t *testing.T) {
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_MODE")
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE", "hello.com/v1")
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE")
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_IMAGE", "sonobuoy/sonobuoy:v0.18.3")
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_IMAGE")
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SYSTEMD_LOGS_IMAGE", "sonobuoy/systemd-logs:v0.3")
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SYSTEMD_LOGS_IMAGE")

if err := cfg.UpdateFromEnvs(); err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -1728,6 +1732,12 @@ func TestEnvAddOnConformance(t *testing.T) {
if cfg.AddOnConformance.SonobuoyRunKubeConformanceImage != "hello.com/v1" {
t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyRunKubeConformanceImage %q", cfg.AddOnConformance.SonobuoyRunKubeConformanceImage)
}
if cfg.AddOnConformance.SonobuoyImage != "sonobuoy/sonobuoy:v0.18.3" {
t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyImage %q", cfg.AddOnConformance.SonobuoyImage)
}
if cfg.AddOnConformance.SystemdLogsImage != "sonobuoy/systemd-logs:v0.3" {
t.Fatalf("unexpected cfg.AddOnConformance.SystemdLogsImage %q", cfg.AddOnConformance.SystemdLogsImage)
}
}

// TestEnvAddOnManagedNodeGroupsCNI tests CNI integration test MNG settings.
Expand Down

0 comments on commit 17e5c4f

Please sign in to comment.