Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: clyi <clyi@alauda.io>
  • Loading branch information
changluyi committed Feb 5, 2025
1 parent 3af1130 commit 692ec96
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 40 deletions.
48 changes: 28 additions & 20 deletions .github/workflows/build-x86-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3145,7 +3145,7 @@ jobs:
path: kube-ovn-connectivity-e2e-${{ matrix.mode }}-ko-log.tar.gz


kube-ovn-metallb-e2e:
kube-ovn-underlay-metallb-e2e:
name: OVN METALLB E2E
needs:
- build-kube-ovn
Expand Down Expand Up @@ -3222,6 +3222,14 @@ jobs:
- name: Load images
run: docker load -i kube-ovn.tar

- name: Set environment variables
run: |
if [ $(($RANDOM%2)) -ne 0 ]; then
# run as root and use valgrind to debug memory leak
echo "VERSION=$(cat VERSION)-debug" >> "$GITHUB_ENV"
echo "DEBUG_WRAPPER=valgrind" >> "$GITHUB_ENV"
fi
- name: Create kind cluster
run: |
pipx install jinjanator
Expand All @@ -3232,53 +3240,53 @@ jobs:
run: make kind-install-metallb-pool-from-underlay

- name: Run Ovn Metallb and Kube-OVN Combine E2E
id: kube-ovn-metallb-e2e
id: kube-ovn-underlay-metallb-e2e
working-directory: ${{ env.E2E_DIR }}
env:
E2E_BRANCH: ${{ github.base_ref || github.ref_name }}
run: make kube-ovn-metallb-e2e
run: make kube-ovn-underlay-metallb-e2e

- name: Collect k8s events
if: failure() && ( steps.ovn-metallb-e2e.conclusion == 'failure')
run: |
kubectl get events -A -o yaml > kube-ovn-metallb-e2e-events.yaml
tar zcf kube-ovn-metallb-e2e-events.tar.gz kube-ovn-metallb-e2e-events.yaml
kubectl get events -A -o yaml > kube-ovn-underlay-metallb-e2e-events.yaml
tar zcf kube-ovn-underlay-metallb-e2e-events.tar.gz kube-ovn-underlay-metallb-e2e-events.yaml
- name: Upload k8s events
uses: actions/upload-artifact@v4
if: failure() && (steps.kube-ovn-metallb-e2e.conclusion == 'failure')
if: failure() && (steps.kube-ovn-underlay-metallb-e2e.conclusion == 'failure')
with:
name: kube-ovn-metallb-e2e-events
path: kube-ovn-metallb-e2e-events.tar.gz
name: kube-ovn-underlay-metallb-e2e-events
path: kube-ovn-underlay-metallb-e2e-events.tar.gz

- name: Collect apiserver audit logs
if: failure() && (steps.kube-ovn-metallb-e2e.conclusion == 'failure')
if: failure() && (steps.kube-ovn-underlay-metallb-e2e.conclusion == 'failure')
run: |
docker cp kube-ovn-control-plane:/var/log/kubernetes/kube-apiserver-audit.log .
tar zcf kube-ovn-metallb-e2e-audit-log.tar.gz kube-apiserver-audit.log
tar zcf kube-ovn-underlay-metallb-e2e-audit-log.tar.gz kube-apiserver-audit.log
- name: Upload apiserver audit logs
uses: actions/upload-artifact@v4
if: failure() && (steps.kube-ovn-metallb-e2e.conclusion == 'failure')
if: failure() && (steps.kube-ovn-underlay-metallb-e2e.conclusion == 'failure')
with:
name: kube-ovn-metallb-e2e-audit-log
path: kube-ovn-metallb-e2e-audit-log.tar.gz
name: kube-ovn-underlay-metallb-e2e-audit-log
path: kube-ovn-underlay-metallb-e2e-audit-log.tar.gz

- name: kubectl ko log
if: failure() && (steps.kube-ovn-metallb-e2e.conclusion == 'failure')
if: failure() && (steps.kube-ovn-underlay-metallb-e2e.conclusion == 'failure')
run: |
make kubectl-ko-log
mv kubectl-ko-log.tar.gz kube-ovn-metallb-e2e-ko-log.tar.gz
mv kubectl-ko-log.tar.gz kube-ovn-underlay-metallb-e2e-ko-log.tar.gz
- name: upload kubectl ko log
uses: actions/upload-artifact@v4
if: failure() && (steps.kube-ovn-metallb-e2e.conclusion == 'failure')
if: failure() && (steps.kube-ovn-underlay-metallb-e2e.conclusion == 'failure')
with:
name: kube-ovn-metallb-e2e-ko-log
path: kube-ovn-metallb-e2e-ko-log.tar.gz
name: kube-ovn-underlay-metallb-e2e-ko-log
path: kube-ovn-underlay-metallb-e2e-ko-log.tar.gz

- name: Check kube ovn pod restarts
if: ${{ success() || (failure() && (steps.install.conclusion == 'failure' || steps.kube-ovn-metallb-e2e.conclusion == 'failure')) }}
if: ${{ success() || (failure() && (steps.install.conclusion == 'failure' || steps.kube-ovn-underlay-metallb-e2e.conclusion == 'failure')) }}
run: make check-kube-ovn-pod-restarts

push:
Expand All @@ -3290,7 +3298,7 @@ jobs:
- kube-ovn-conformance-e2e
- kube-ovn-ic-conformance-e2e
- kube-ovn-ipsec-e2e
- kube-ovn-metallb-e2e
- kube-ovn-underlay-metallb-e2e
- multus-conformance-e2e
- vpc-egress-gateway-e2e
- ovn-vpc-nat-gw-conformance-e2e
Expand Down
8 changes: 1 addition & 7 deletions charts/kube-ovn/templates/ovn-CR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,12 @@ rules:
- nodes
- nodes/status
- pods
- services
verbs:
- get
- list
- patch
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- list
- watch
- apiGroups:
- ""
resources:
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ RUN cd /usr/src/ && git clone -b branch-24.03 --depth=1 https://github.com/ovn-o
# skip node local dns ip conntrack when set acl
curl -s https://github.com/kubeovn/ovn/commit/e7d3ba53cdcbc524bb29c54ddb07b83cc4258ed7.patch | git apply && \
# select local backend first
curl -s https://github.com/kubeovn/ovn/commit/faa762818447a4ac470ec28c69bbcabf80091d3a.patch | git apply
curl -s https://github.com/kubeovn/ovn/commit/1fed88af496939d6e526b38897bc10d56557c5c4.patch | git apply

RUN apt install -y build-essential fakeroot \
autoconf automake bzip2 debhelper-compat dh-exec dh-python dh-sequence-python3 dh-sequence-sphinxdoc \
Expand Down
8 changes: 1 addition & 7 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3670,6 +3670,7 @@ rules:
- nodes
- nodes/status
- pods
- services
verbs:
- get
- list
Expand All @@ -3690,13 +3691,6 @@ rules:
- create
- patch
- update
- apiGroups:
- ""
resources:
- services
verbs:
- list
- watch
- apiGroups:
- ""
resources:
Expand Down
5 changes: 3 additions & 2 deletions e2e.mk
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ e2e-build:
ginkgo build $(E2E_BUILD_FLAGS) ./test/e2e/kubevirt
ginkgo build $(E2E_BUILD_FLAGS) ./test/e2e/webhook
ginkgo build $(E2E_BUILD_FLAGS) ./test/e2e/connectivity
ginkgo build $(E2E_BUILD_FLAGS) ./test/e2e/metallb

.PHONY: k8s-conformance-e2e
k8s-conformance-e2e:
Expand Down Expand Up @@ -252,8 +253,8 @@ kube-ovn-connectivity-e2e:
ginkgo $(GINKGO_OUTPUT_OPT) --procs 2 --randomize-all -v \
--focus=CNI:Kube-OVN ./test/e2e/connectivity -- $(TEST_BIN_ARGS)

.PHONY: kube-ovn-metallb-e2e
kube-ovn-metallb-e2e:
.PHONY: kube-ovn-underlay-metallb-e2e
kube-ovn-underlay-metallb-e2e:
ginkgo build $(E2E_BUILD_FLAGS) ./test/e2e/metallb
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/metallb/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ var _ = framework.Describe("[group:metallb]", func() {
_ = subnetClient.CreateSync(subnet)

ginkgo.By("Create deploy in underlay subnet")
annoations := map[string]string{
annotations := map[string]string{
util.LogicalSwitchAnnotation: subnetName,
}
podLabels := map[string]string{"app": "nginx"}

args := []string{"netexec", "--http-port", strconv.Itoa(curlListenPort)}
deploy := framework.MakeDeployment(deployName, 3, podLabels, annoations, "nginx", framework.AgnhostImage, "")
deploy := framework.MakeDeployment(deployName, 3, podLabels, annotations, "nginx", framework.AgnhostImage, "")
deploy.Spec.Template.Spec.Containers[0].Args = args
_ = deployClient.CreateSync(deploy)

Expand Down Expand Up @@ -408,7 +408,7 @@ func checkReachable(f *framework.Framework, containerID, sourceIP, targetIP, tar
}
}

framework.ExpectNotEqual(vipNode, "", "Failed to find the node with MAC address: %s", vipMac)
framework.ExpectNotEmpty(vipNode, "Failed to find the node with MAC address: %s", vipMac)
framework.Logf("Node with MAC address %s is %s", vipMac, vipNode)

ginkgo.By("Checking the backend pod's host is same as the metallb vip's node")
Expand Down

0 comments on commit 692ec96

Please sign in to comment.