Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update function signature of testutil.NewGenericTestHelper #4591

Merged
merged 4 commits into from
Jun 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions testutil/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var LinkerdDeployReplicas = map[string]deploySpec{
// See - https://github.com/linkerd/linkerd2/issues/4530
func NewGenericTestHelper(
linkerd,
version,
namespace,
upgradeFromVersion,
clusterDomain,
Expand All @@ -76,9 +77,12 @@ func NewGenericTestHelper(
helmReleaseName string,
externalIssuer,
uninstall bool,
httpClient http.Client,
kubernetesHelper KubernetesHelper,
) *TestHelper {
return &TestHelper{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is also KubernetesHelper variable in TestHelper. Maybe we can use that somewhere in the code using the returned value from NewKubernetesHelper()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nice catch - was only considering setting the private fields through this method, but it certainly makes sense to initialize the KubernetesHelper field as well. That would mean that NewGenericTestHelper would now also have to accept k8sContext as a parameter and also return the error returned from NewKubernetesHelper.

I have pushed the changes incorporating the above. PTAL! 😄

linkerd: linkerd,
version: version,
namespace: namespace,
upgradeFromVersion: upgradeFromVersion,
helm: helm{
Expand All @@ -88,9 +92,11 @@ func NewGenericTestHelper(
releaseName: helmReleaseName,
upgradeFromVersion: upgradeFromVersion,
},
clusterDomain: clusterDomain,
externalIssuer: externalIssuer,
uninstall: uninstall,
clusterDomain: clusterDomain,
externalIssuer: externalIssuer,
uninstall: uninstall,
httpClient: httpClient,
KubernetesHelper: kubernetesHelper,
}
}

Expand Down