Skip to content

Commit

Permalink
add back volume mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazkh committed Dec 11, 2024
1 parent 7cc6103 commit eb4e3d7
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions test/e2e/azure_apiserver_ilb.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ func AzureAPIServerILBSpec(ctx context.Context, inputGetter func() AzureAPIServe
"-c",
"tail -f /dev/null",
},
VolumeMounts: []corev1.VolumeMount{
{
Name: "etc-hosts",
MountPath: "/host/etc",
ReadOnly: true,
},
},
ReadinessProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
Exec: &corev1.ExecAction{
Expand All @@ -194,6 +201,17 @@ func AzureAPIServerILBSpec(ctx context.Context, inputGetter func() AzureAPIServe
},
},
},
Volumes: []corev1.Volume{
{
Name: "etc-hosts",
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/etc/hosts",
Type: ptr.To(corev1.HostPathFile),
},
},
},
},
},
},
},
Expand Down Expand Up @@ -256,7 +274,7 @@ func AzureAPIServerILBSpec(ctx context.Context, inputGetter func() AzureAPIServe
return false, fmt.Errorf("failed to build workload cluster kubeconfig from flags: %v", err)
}

fmt.Fprintf(GinkgoWriter, "\n\nNumber of node debug pods deployed on worker nodes: %v\n", len(workerDSPods))
fmt.Fprintf(GinkgoWriter, "Number of node debug pods deployed on worker nodes: %v\n", len(workerDSPods))
for _, nodeDebugPod := range workerDSPods {

Check failure on line 278 in test/e2e/azure_apiserver_ilb.go

View workflow job for this annotation

GitHub Actions / lint

unnecessary leading newline (whitespace)

Check failure on line 278 in test/e2e/azure_apiserver_ilb.go

View workflow job for this annotation

GitHub Actions / lint (test)

unnecessary leading newline (whitespace)

fmt.Fprintf(GinkgoWriter, "Worker DS Pod Name: %v\n", nodeDebugPod.Name)
Expand All @@ -274,7 +292,7 @@ func AzureAPIServerILBSpec(ctx context.Context, inputGetter func() AzureAPIServe
return false, fmt.Errorf("node-debug pod %s is in an unexpected phase: %v", nodeDebugPod.Name, nodeDebugPod.Status.Phase)
}

catEtcHostsCommand := []string{"sh", "-c", "cat,", "/host/etc/hosts"} // /etc/host is mounted as /host/etc/hosts in the node-debug pod
catEtcHostsCommand := []string{"sh", "-c", "cat", "/host/etc/hosts"} // /etc/host is mounted as /host/etc/hosts in the node-debug pod
fmt.Fprintf(GinkgoWriter, "Trying to exec into the pod %s at namespace %s and running the command %s\n", nodeDebugPod.Name, nodeDebugPod.Namespace, catEtcHostsCommand)
req := workloadClusterClientSet.CoreV1().RESTClient().Post().Resource("pods").Name(nodeDebugPod.Name).
Namespace(nodeDebugPod.Namespace).
Expand Down

0 comments on commit eb4e3d7

Please sign in to comment.