diff --git a/testutil/test_helper.go b/testutil/test_helper.go index a6613415c..a6aacec44 100644 --- a/testutil/test_helper.go +++ b/testutil/test_helper.go @@ -61,6 +61,39 @@ var LinkerdDeployReplicas = map[string]deploySpec{ "linkerd-proxy-injector": {1, []string{"proxy-injector"}}, } +// NewGenericTestHelper returns a new *TestHelper from the options provided as function parameters. +// This helper was created to be able to reuse this package without hard restrictions +// as seen in `NewTestHelper()` which is primarily used with integration tests +// See - https://github.com/linkerd/linkerd2/issues/4530 +func NewGenericTestHelper( + linkerd, + namespace, + upgradeFromVersion, + clusterDomain, + helmPath, + helmChart, + helmStableChart, + helmReleaseName string, + externalIssuer, + uninstall bool, +) *TestHelper { + return &TestHelper{ + linkerd: linkerd, + namespace: namespace, + upgradeFromVersion: upgradeFromVersion, + helm: helm{ + path: helmPath, + chart: helmChart, + stableChart: helmStableChart, + releaseName: helmReleaseName, + upgradeFromVersion: upgradeFromVersion, + }, + clusterDomain: clusterDomain, + externalIssuer: externalIssuer, + uninstall: uninstall, + } +} + // NewTestHelper creates a new instance of TestHelper for the current test run. // The new TestHelper can be configured via command line flags. func NewTestHelper() *TestHelper {