Skip to content

Commit 50daf0a

Browse files
jokuniewrichardcase
authored andcommitted
fix: add missing KubeConfigPath and clusterctlConfigPath in e2e tests caused by test framework version bump
1 parent fec59a3 commit 50daf0a

File tree

3 files changed

+36
-30
lines changed

3 files changed

+36
-30
lines changed

test/e2e/common.go

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,16 @@ func setupSpecNamespace(ctx context.Context, specName string, clusterProxy frame
6464
}
6565

6666
type cleanupInput struct {
67-
SpecName string
68-
ClusterProxy framework.ClusterProxy
69-
ArtifactFolder string
70-
Namespace *corev1.Namespace
71-
CancelWatches context.CancelFunc
72-
Cluster *clusterv1.Cluster
73-
IntervalsGetter func(spec, key string) []interface{}
74-
SkipCleanup bool
75-
AdditionalCleanup func()
67+
SpecName string
68+
ClusterProxy framework.ClusterProxy
69+
ClusterctlConfigPath string
70+
ArtifactFolder string
71+
Namespace *corev1.Namespace
72+
CancelWatches context.CancelFunc
73+
Cluster *clusterv1.Cluster
74+
IntervalsGetter func(spec, key string) []interface{}
75+
SkipCleanup bool
76+
AdditionalCleanup func()
7677
}
7778

7879
func dumpSpecResourcesAndCleanup(ctx context.Context, input cleanupInput) {
@@ -90,9 +91,11 @@ func dumpSpecResourcesAndCleanup(ctx context.Context, input cleanupInput) {
9091
Byf("Dumping all the Cluster API resources in the %q namespace", input.Namespace.Name)
9192
// Dump all Cluster API related resources to artifacts before deleting them.
9293
framework.DumpAllResources(ctx, framework.DumpAllResourcesInput{
93-
Lister: input.ClusterProxy.GetClient(),
94-
Namespace: input.Namespace.Name,
95-
LogPath: filepath.Join(input.ArtifactFolder, "clusters", input.ClusterProxy.GetName(), "resources"),
94+
Lister: input.ClusterProxy.GetClient(),
95+
KubeConfigPath: input.ClusterProxy.GetKubeconfigPath(),
96+
ClusterctlConfigPath: input.ClusterctlConfigPath,
97+
Namespace: input.Namespace.Name,
98+
LogPath: filepath.Join(input.ArtifactFolder, "clusters", input.ClusterProxy.GetName(), "resources"),
9699
})
97100

98101
if input.SkipCleanup {
@@ -104,8 +107,9 @@ func dumpSpecResourcesAndCleanup(ctx context.Context, input cleanupInput) {
104107
// that cluster variable is not set even if the cluster exists, so we are calling DeleteAllClustersAndWait
105108
// instead of DeleteClusterAndWait
106109
framework.DeleteAllClustersAndWait(ctx, framework.DeleteAllClustersAndWaitInput{
107-
ClusterProxy: input.ClusterProxy,
108-
Namespace: input.Namespace.Name,
110+
ClusterProxy: input.ClusterProxy,
111+
ClusterctlConfigPath: input.ClusterctlConfigPath,
112+
Namespace: input.Namespace.Name,
109113
}, input.IntervalsGetter(input.SpecName, "wait-delete-cluster")...)
110114

111115
Byf("Deleting namespace used for hosting the %q test spec", input.SpecName)

test/e2e/create_test.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ var _ = Describe("Workload cluster creation", func() {
6262

6363
AfterEach(func() {
6464
cleanInput := cleanupInput{
65-
SpecName: specName,
66-
Cluster: result.Cluster,
67-
ClusterProxy: bootstrapClusterProxy,
68-
Namespace: namespace,
69-
CancelWatches: cancelWatches,
70-
IntervalsGetter: e2eConfig.GetIntervals,
71-
SkipCleanup: skipCleanup,
72-
ArtifactFolder: artifactFolder,
65+
SpecName: specName,
66+
Cluster: result.Cluster,
67+
ClusterProxy: bootstrapClusterProxy,
68+
ClusterctlConfigPath: clusterctlConfigPath,
69+
Namespace: namespace,
70+
CancelWatches: cancelWatches,
71+
IntervalsGetter: e2eConfig.GetIntervals,
72+
SkipCleanup: skipCleanup,
73+
ArtifactFolder: artifactFolder,
7374
}
7475

7576
dumpSpecResourcesAndCleanup(ctx, cleanInput)

test/e2e/md_remediation_test.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ var _ = Describe("When testing MachineDeployment remediation", func() {
6363

6464
AfterEach(func() {
6565
cleanInput := cleanupInput{
66-
SpecName: specName,
67-
Cluster: result.Cluster,
68-
ClusterProxy: bootstrapClusterProxy,
69-
Namespace: namespace,
70-
CancelWatches: cancelWatches,
71-
IntervalsGetter: e2eConfig.GetIntervals,
72-
SkipCleanup: skipCleanup,
73-
ArtifactFolder: artifactFolder,
66+
SpecName: specName,
67+
Cluster: result.Cluster,
68+
ClusterProxy: bootstrapClusterProxy,
69+
ClusterctlConfigPath: clusterctlConfigPath,
70+
Namespace: namespace,
71+
CancelWatches: cancelWatches,
72+
IntervalsGetter: e2eConfig.GetIntervals,
73+
SkipCleanup: skipCleanup,
74+
ArtifactFolder: artifactFolder,
7475
}
7576

7677
dumpSpecResourcesAndCleanup(ctx, cleanInput)

0 commit comments

Comments
 (0)