Skip to content

Commit

Permalink
Update script
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Jan 15, 2024
1 parent 9f9d4e1 commit cc75d96
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
23 changes: 15 additions & 8 deletions ci/jenkins/test-scale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,15 @@ function generate_ssh_config {
}

function prepare_scale_simulator {
## Try best to clean up old config.
kubectl delete -f "${WORKSPACE}/build/yamls/antrea-agent-simulator.yml" || true
kubectl delete secret kubeconfig || true

# Create simulators.
kubectl taint -l 'antrea/instance=simulator' node mocknode=true:NoExecute
kubectl create secret generic kubeconfig --type=Opaque --namespace=kube-system --from-file=${WORKDIR}/.kube
kubectl create secret generic kubeconfig --type=Opaque --namespace=kube-system --from-file=admin.conf=${WORKDIR}/.kube

kubectl apply -f "${WORKSPACE}/build/yamls/antrea-agent-simulator.yml"
}

function run_scale_test {
Expand Down Expand Up @@ -314,13 +321,13 @@ function clean_tmp() {

export KUBECONFIG=${KUBECONFIG_PATH}

source $WORKSPACE/ci/jenkins/utils.sh
check_and_upgrade_golang
clean_tmp

trap clean_antrea EXIT
deliver_antrea_scale
prepare_scale_simulator
#source $WORKSPACE/ci/jenkins/utils.sh
#check_and_upgrade_golang
#clean_tmp
#
#trap clean_antrea EXIT
#deliver_antrea_scale
#prepare_scale_simulator
run_scale_test

if [[ ${TEST_FAILURE} == true ]]; then
Expand Down
3 changes: 2 additions & 1 deletion test/performance/framework/networkpolicy/scale_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ type NetworkPolicyInfo struct {
Name string
Namespace string
Spec netv1.NetworkPolicySpec
fromPod string

Check failure on line 91 in test/performance/framework/networkpolicy/scale_up.go

View workflow job for this annotation

GitHub Actions / Golangci-lint (ubuntu-latest)

field `fromPod` is unused (unused)

Check failure on line 91 in test/performance/framework/networkpolicy/scale_up.go

View workflow job for this annotation

GitHub Actions / Golangci-lint (macos-latest)

field `fromPod` is unused (unused)
toIP string

Check failure on line 92 in test/performance/framework/networkpolicy/scale_up.go

View workflow job for this annotation

GitHub Actions / Golangci-lint (ubuntu-latest)

field `toIP` is unused (unused)

Check failure on line 92 in test/performance/framework/networkpolicy/scale_up.go

View workflow job for this annotation

GitHub Actions / Golangci-lint (macos-latest)

field `toIP` is unused (unused)
}

func ScaleUp(ctx context.Context, cs kubernetes.Interface, nss []string, numPerNs int, ipv6 bool) (nps []NetworkPolicyInfo, err error) {
Expand Down Expand Up @@ -125,7 +127,6 @@ func SelectConnectPod(ctx context.Context, cs kubernetes.Interface, ns string, n
if _, ok := np.Spec.PodSelector.MatchLabels[utils.PodOnRealNodeLabelKey]; !ok {
np.Spec.PodSelector.MatchLabels[utils.PodOnRealNodeLabelKey] = ""
}
klog.InfoS("Podselect", "PodSelector", np.Spec.PodSelector)
podList, err := cs.CoreV1().Pods(ns).List(ctx, metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&np.Spec.PodSelector)})
if err != nil {
return nil, "", fmt.Errorf("error when selecting networkpolicy applied to pods: %w", err)
Expand Down

0 comments on commit cc75d96

Please sign in to comment.