Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Feb 23, 2024
1 parent 5348778 commit 9664031
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/performance/framework/service/scale_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func ScaleUp(ctx context.Context, kubeConfig *rest.Config, cs kubernetes.Interfa
// }
// }

testPodIndex := 0
for i, ns := range nss {

klog.InfoS("Scale up Services", "Namespace", ns)
Expand All @@ -125,19 +126,22 @@ func ScaleUp(ctx context.Context, kubeConfig *rest.Config, cs kubernetes.Interfa
svc.Spec.IPFamilies = []corev1.IPFamily{ipFamily}
}
if err := utils.DefaultRetry(func() error {
clusterIP := startSvcCIDR + strconv.Itoa(i+1)

var podList *corev1.PodList
podList, err = cs.CoreV1().Pods(ns).List(ctx, metav1.ListOptions{})
if err != nil {
return fmt.Errorf("list test Pod error: %+v", err)
}
if testPodIndex < len(podList.Items) {
fromPod := podList.Items[testPodIndex]
testPodIndex++

fromPod := podList.Items[0]

clusterIP := startSvcCIDR + strconv.Itoa(i+1)
if err = workload_pod.Update(ctx, cs, fromPod.Namespace, fromPod.Name, []string{fmt.Sprintf("%s:%d", clusterIP, 80)}, workload_pod.ScaleClientPodProbeContainerName); err != nil {
klog.ErrorS(err, "Update test Pod failed")
if err = workload_pod.Update(ctx, cs, fromPod.Namespace, fromPod.Name, []string{fmt.Sprintf("%s:%d", clusterIP, 80)}, workload_pod.ScaleClientPodProbeContainerName); err != nil {
klog.ErrorS(err, "Update test Pod failed")
}
klog.InfoS("Update test Pod to check Service", "ClusterIP", clusterIP)
}
klog.InfoS("Update test Pod to check Service", "ClusterIP", clusterIP)

var newSvc *corev1.Service
var err error
Expand Down

0 comments on commit 9664031

Please sign in to comment.