Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Jan 15, 2024
1 parent 89dc2ed commit 2698764
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 35 deletions.
3 changes: 3 additions & 0 deletions test/e2e/anti_affinity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ func VerifyAntiAffinity(ctx context.Context, input AntiAffinitySpecInput) {
WaitForClusterIntervals: input.Global.E2EConfig.GetIntervals("", "wait-cluster"),
WaitForControlPlaneIntervals: input.Global.E2EConfig.GetIntervals("", "wait-control-plane"),
WaitForMachineDeployments: input.Global.E2EConfig.GetIntervals("", "wait-worker-nodes"),
PostMachinesProvisioned: func() {
watchVSphereComponentLogs(ctx, artifactFolder, input.Global.BootstrapClusterProxy, namespace.Name, clusterName)
},
}, clusterResources)

vsphereCluster := FetchVSphereClusterObject(ctx, input.Global.BootstrapClusterProxy, client.ObjectKey{
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/dhcp_overrides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ var _ = Describe("DHCPOverrides configuration test", func() {
WaitForClusterIntervals: e2eConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: e2eConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: e2eConfig.GetIntervals(specName, "wait-worker-nodes"),
}, clusterResources)
PostMachinesProvisioned: func() {
watchVSphereComponentLogs(ctx, artifactFolder, bootstrapClusterProxy, namespace.Name, clusterName)
}}, clusterResources)

list := getVSphereVMsForCluster(clusterName, namespace.Name)
for _, vm := range list.Items {
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/gpu_pci_passthrough_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ var _ = Describe("Cluster creation with GPU devices as PCI passthrough [speciali
WaitForClusterIntervals: e2eConfig.GetIntervals("", "wait-cluster"),
WaitForControlPlaneIntervals: e2eConfig.GetIntervals("", "wait-control-plane"),
WaitForMachineDeployments: e2eConfig.GetIntervals("", "wait-worker-nodes"),
PostMachinesProvisioned: func() {
watchVSphereComponentLogs(ctx, artifactFolder, bootstrapClusterProxy, namespace.Name, clusterName)
},
}, &clusterctl.ApplyClusterTemplateAndWaitResult{})

By("Verifying that the PCI device is attached to the worker node")
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/hardware_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func VerifyHardwareUpgrade(ctx context.Context, input HardwareUpgradeSpecInput)
WaitForClusterIntervals: input.Global.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.Global.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.Global.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
PostMachinesProvisioned: func() {
watchVSphereComponentLogs(ctx, artifactFolder, bootstrapClusterProxy, namespace.Name, clusterName)
},
}, clusterResources)

Byf("Fetching the VSphereVM objects for the cluster %s", clusterName)
Expand Down
70 changes: 37 additions & 33 deletions test/e2e/log_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,40 +156,44 @@ func readPrivateKey() ([]byte, error) {
return os.ReadFile(filepath.Clean(privateKeyFilePath))
}

func watchVSphereComponentLogs(ctx context.Context, artifactFolder string, managementClusterProxy framework.ClusterProxy, workloadClusterNamespace, workloadClusterName string) {
workloadClusterProxy := managementClusterProxy.GetWorkloadCluster(ctx, workloadClusterNamespace, workloadClusterName)
// CPI
framework.WatchDaemonSetLogsByLabelSelector(ctx, framework.WatchDaemonSetLogsByLabelSelectorInput{
GetLister: workloadClusterProxy.GetClient(),
Cache: workloadClusterProxy.GetCache(ctx),
ClientSet: workloadClusterProxy.GetClientSet(),
Labels: map[string]string{
"component": "cloud-controller-manager",
},
LogPath: filepath.Join(artifactFolder, "clusters", workloadClusterName, "logs"),
})

// CSI Deployment
framework.WatchDeploymentLogsByLabelSelector(ctx, framework.WatchDeploymentLogsByLabelSelectorInput{
GetLister: workloadClusterProxy.GetClient(),
Cache: workloadClusterProxy.GetCache(ctx),
ClientSet: workloadClusterProxy.GetClientSet(),
Labels: map[string]string{
"component": "vsphere-csi",
},
LogPath: filepath.Join(artifactFolder, "clusters", workloadClusterName, "logs"),
})

// CSI Daemonset
framework.WatchDaemonSetLogsByLabelSelector(ctx, framework.WatchDaemonSetLogsByLabelSelectorInput{
GetLister: workloadClusterProxy.GetClient(),
Cache: workloadClusterProxy.GetCache(ctx),
ClientSet: workloadClusterProxy.GetClientSet(),
Labels: map[string]string{
"component": "vsphere-csi",
},
LogPath: filepath.Join(artifactFolder, "clusters", workloadClusterName, "logs"),
})
}

func watchVSphereComponentLogsFunc(ctx context.Context, artifactFolder string) func(managementClusterProxy framework.ClusterProxy, workloadClusterNamespace, workloadClusterName string) {
return func(managementClusterProxy framework.ClusterProxy, workloadClusterNamespace, workloadClusterName string) {
workloadClusterProxy := managementClusterProxy.GetWorkloadCluster(ctx, workloadClusterNamespace, workloadClusterName)
// CPI
framework.WatchDaemonSetLogsByLabelSelector(ctx, framework.WatchDaemonSetLogsByLabelSelectorInput{
GetLister: workloadClusterProxy.GetClient(),
Cache: workloadClusterProxy.GetCache(ctx),
ClientSet: workloadClusterProxy.GetClientSet(),
Labels: map[string]string{
"component": "cloud-controller-manager",
},
LogPath: filepath.Join(artifactFolder, "clusters", workloadClusterName, "logs"),
})

// CSI Deployment
framework.WatchDeploymentLogsByLabelSelector(ctx, framework.WatchDeploymentLogsByLabelSelectorInput{
GetLister: workloadClusterProxy.GetClient(),
Cache: workloadClusterProxy.GetCache(ctx),
ClientSet: workloadClusterProxy.GetClientSet(),
Labels: map[string]string{
"component": "vsphere-csi",
},
LogPath: filepath.Join(artifactFolder, "clusters", workloadClusterName, "logs"),
})

// CSI Daemonset
framework.WatchDaemonSetLogsByLabelSelector(ctx, framework.WatchDaemonSetLogsByLabelSelectorInput{
GetLister: workloadClusterProxy.GetClient(),
Cache: workloadClusterProxy.GetCache(ctx),
ClientSet: workloadClusterProxy.GetClientSet(),
Labels: map[string]string{
"component": "vsphere-csi",
},
LogPath: filepath.Join(artifactFolder, "clusters", workloadClusterName, "logs"),
})
watchVSphereComponentLogs(ctx, artifactFolder, managementClusterProxy, workloadClusterNamespace, workloadClusterName)
}
}
3 changes: 3 additions & 0 deletions test/e2e/node_labeling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ func VerifyNodeLabeling(ctx context.Context, input NodeLabelingSpecInput) {
WaitForClusterIntervals: input.Global.E2EConfig.GetIntervals("", "wait-cluster"),
WaitForControlPlaneIntervals: input.Global.E2EConfig.GetIntervals("", "wait-control-plane"),
WaitForMachineDeployments: input.Global.E2EConfig.GetIntervals("", "wait-worker-nodes"),
PostMachinesProvisioned: func() {
watchVSphereComponentLogs(ctx, artifactFolder, input.Global.BootstrapClusterProxy, namespace.Name, clusterName)
},
}, clusterResources)
workloadProxy := input.Global.BootstrapClusterProxy.GetWorkloadCluster(ctx, namespace.Name, clusterResources.Cluster.Name)

Expand Down
2 changes: 2 additions & 0 deletions test/e2e/ownerreference_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ var _ = Describe("OwnerReference checks with FailureDomains and ClusterIdentity"
VSphereKubernetesReferenceAssertions,
VSphereReferenceAssertions,
)

watchVSphereComponentLogs(ctx, artifactFolder, bootstrapClusterProxy, namespace, clusterName)
},
}
})
Expand Down
5 changes: 4 additions & 1 deletion test/e2e/storage_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func VerifyStoragePolicy(ctx context.Context, input StoragePolicySpecInput) {

By("creating a workload cluster")
configCluster := defaultConfigCluster(clusterName, namespace.Name, specName, 1, 0, GlobalInput{
BootstrapClusterProxy: bootstrapClusterProxy,
BootstrapClusterProxy: input.Global.BootstrapClusterProxy,
ClusterctlConfigPath: clusterctlConfigPath,
E2EConfig: e2eConfig,
ArtifactFolder: artifactFolder,
Expand All @@ -97,6 +97,9 @@ func VerifyStoragePolicy(ctx context.Context, input StoragePolicySpecInput) {
WaitForClusterIntervals: input.Global.E2EConfig.GetIntervals("", "wait-cluster"),
WaitForControlPlaneIntervals: input.Global.E2EConfig.GetIntervals("", "wait-control-plane"),
WaitForMachineDeployments: input.Global.E2EConfig.GetIntervals("", "wait-worker-nodes"),
PostMachinesProvisioned: func() {
watchVSphereComponentLogs(ctx, artifactFolder, input.Global.BootstrapClusterProxy, namespace.Name, clusterName)
},
}, clusterResources)

pbmClient, err := pbm.NewClient(ctx, input.Client.Client)
Expand Down

0 comments on commit 2698764

Please sign in to comment.