mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-08-20 14:16:24 +00:00
Replace one-off usages of busybox and debian images in integration tests
Those images that are pulled from Dockerhub will cause pull failures on some test clusters due to Dockerhub rate limiting. Because we already have some images that we use for testing, and because those images are already pre-loaded onto our CI clusters to make the tests faster, use one of those images and always specify PullIfNotPresent to avoid pulling the image again during the integration test.
This commit is contained in:
@@ -948,9 +948,10 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl
|
||||
corev1.PodSpec{
|
||||
Containers: []corev1.Container{
|
||||
{
|
||||
Name: "ignored-but-required",
|
||||
Image: "busybox",
|
||||
Command: []string{"sh", "-c", "sleep 3600"},
|
||||
Name: "sleeper",
|
||||
Image: env.ShellContainerImage,
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
Command: []string{"sh", "-c", "sleep 3600"},
|
||||
},
|
||||
},
|
||||
ServiceAccountName: saName,
|
||||
@@ -1064,7 +1065,7 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl
|
||||
// existing Concierge pod because we need more tools than we can get from a scratch/distroless base image.
|
||||
runningTestPod := testlib.CreatePod(ctx, t, "impersonation-proxy", env.ConciergeNamespace, corev1.PodSpec{Containers: []corev1.Container{{
|
||||
Name: "impersonation-proxy-test",
|
||||
Image: "debian:10.10-slim",
|
||||
Image: env.ShellContainerImage,
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
Command: []string{"bash", "-c", `while true; do read VAR; echo "VAR: $VAR"; done`},
|
||||
Stdin: true,
|
||||
|
||||
@@ -117,9 +117,10 @@ func TestLegacyPodCleaner(t *testing.T) {
|
||||
},
|
||||
Spec: corev1.PodSpec{
|
||||
Containers: []corev1.Container{{
|
||||
Name: "sleeper",
|
||||
Image: "debian:10.9-slim",
|
||||
Command: []string{"/bin/sleep", "infinity"},
|
||||
Name: "sleeper",
|
||||
Image: env.ShellContainerImage,
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
Command: []string{"/bin/sleep", "infinity"},
|
||||
}},
|
||||
},
|
||||
}, metav1.CreateOptions{})
|
||||
|
||||
@@ -134,7 +134,7 @@ func TestWhoAmI_ServiceAccount_Legacy(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWhoAmI_ServiceAccount_TokenRequest(t *testing.T) {
|
||||
_ = testlib.IntegrationEnv(t)
|
||||
env := testlib.IntegrationEnv(t)
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
|
||||
defer cancel()
|
||||
@@ -168,9 +168,10 @@ func TestWhoAmI_ServiceAccount_TokenRequest(t *testing.T) {
|
||||
corev1.PodSpec{
|
||||
Containers: []corev1.Container{
|
||||
{
|
||||
Name: "ignored-but-required",
|
||||
Image: "busybox",
|
||||
Command: []string{"sh", "-c", "sleep 3600"},
|
||||
Name: "sleeper",
|
||||
Image: env.ShellContainerImage,
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
Command: []string{"sh", "-c", "sleep 3600"},
|
||||
},
|
||||
},
|
||||
ServiceAccountName: sa.Name,
|
||||
|
||||
@@ -54,6 +54,7 @@ type TestEnv struct {
|
||||
SupervisorHTTPSIngressCABundle string `json:"supervisorHttpsIngressCABundle"`
|
||||
Proxy string `json:"proxy"`
|
||||
APIGroupSuffix string `json:"apiGroupSuffix"`
|
||||
ShellContainerImage string `json:"shellContainer"`
|
||||
|
||||
TestUser struct {
|
||||
Token string `json:"token"`
|
||||
@@ -224,6 +225,7 @@ func loadEnvVars(t *testing.T, result *TestEnv) {
|
||||
|
||||
result.Proxy = os.Getenv("PINNIPED_TEST_PROXY")
|
||||
result.APIGroupSuffix = wantEnv("PINNIPED_TEST_API_GROUP_SUFFIX", "pinniped.dev")
|
||||
result.ShellContainerImage = needEnv(t, "PINNIPED_TEST_SHELL_CONTAINER_IMAGE")
|
||||
|
||||
result.CLIUpstreamOIDC = TestOIDCUpstream{
|
||||
Issuer: needEnv(t, "PINNIPED_TEST_CLI_OIDC_ISSUER"),
|
||||
|
||||
Reference in New Issue
Block a user