diff --git a/e2e/internal/kubeclient/deploy.go b/e2e/internal/kubeclient/deploy.go index 238a380492..356152d7b8 100644 --- a/e2e/internal/kubeclient/deploy.go +++ b/e2e/internal/kubeclient/deploy.go @@ -333,9 +333,9 @@ func (c *Kubeclient) Delete(ctx context.Context, objects ...*unstructured.Unstru return nil } -// RestartDeployment restarts a deployment by deleting all of its pods. -func (c *Kubeclient) RestartDeployment(ctx context.Context, namespace, name string) error { - pods, err := c.PodsFromDeployment(ctx, namespace, name) +// Restart a resource by deleting all of its dependent pods. +func (c *Kubeclient) Restart(ctx context.Context, resource ResourceWaiter, namespace, name string) error { + pods, err := resource.getPods(ctx, c, namespace, name) if err != nil { return err } diff --git a/e2e/openssl/openssl_test.go b/e2e/openssl/openssl_test.go index cb3a7d3af0..f4acbe0fea 100644 --- a/e2e/openssl/openssl_test.go +++ b/e2e/openssl/openssl_test.go @@ -148,7 +148,7 @@ func TestOpenSSL(t *testing.T) { ct.Set(t) // Restart one deployment so it has the new certificates. - require.NoError(c.RestartDeployment(ctx, ct.Namespace, deploymentToRestart)) + require.NoError(c.Restart(ctx, kubeclient.Deployment{}, ct.Namespace, deploymentToRestart)) require.NoError(c.WaitFor(ctx, kubeclient.Deployment{}, ct.Namespace, deploymentToRestart)) // This should not succeed because the certificates have changed. @@ -168,7 +168,7 @@ func TestOpenSSL(t *testing.T) { if deploymentToRestart == opensslBackend { d = opensslFrontend } - require.NoError(c.RestartDeployment(ctx, ct.Namespace, d)) + require.NoError(c.Restart(ctx, kubeclient.Deployment{}, ct.Namespace, d)) require.NoError(c.WaitFor(ctx, kubeclient.Deployment{}, ct.Namespace, d)) // This should succeed since both workloads now have updated certificates.