Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]: delete the NIC regardless of whether the Pod was found or not. #4499

Closed
wants to merge 32 commits into from

Conversation

liyh-yusur
Copy link
Contributor

Pull Request

What type of this PR

Examples of user facing changes:

  • Bug fixes

Describe

当删除pod时,若pod被直接删除cni来不及处理时,通过pod, err := csh.Controller.podsLister.Pods(podRequest.PodNamespace).Get(podRequest.PodName)获取pod进行后续的处理条件,会导致此时无法处理,直接在k8serrors.IsNotFound中返回。

复现

例如 在pod的部署yaml中设置了terminationGracePeriodSeconds: 0,导致 Pod 在删除 Deployment 后被立即终止,而 CNI 插件的 handleDel 函数还没来得及处理删除网卡的操作。
使用 podRequest.ContainerID 来识别 Pod,而不是使用 podRequest.PodName。这样即使 Pod 已经被删除,CNI 插件仍然可以通过容器 ID 来删除网卡。

    spec:
      containers:
      - name: iperf3-server
        image: harbor.yusur.tech/yusur_ovn/iperf3
        args: ['-s','-p','5001']
        resources:
            requests:
              yusur.tech/sriov_dpu: '1'
            limits:
              yusur.tech/sriov_dpu: '1'
        ports:
        - containerPort: 5001
          name: server
      terminationGracePeriodSeconds: 0
      nodeSelector:
        app: node1

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Sep 10, 2024
dependabot bot and others added 28 commits September 10, 2024 18:19
…vn#4458)

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.34.1 to 1.34.2.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](onsi/gomega@v1.34.1...v1.34.2)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: liyh <[email protected]>
Signed-off-by: liyh-yusur <[email protected]>
Signed-off-by: liyh <[email protected]>
…n#4467)

Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](peter-evans/create-pull-request@v6...v7)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: liyh <[email protected]>
kubeovn#4469)

Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.13 to 1.1.14.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/main/CHANGELOG.md)
- [Commits](opencontainers/runc@v1.1.13...v1.1.14)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: liyh <[email protected]>
Signed-off-by: 马洪贞 <[email protected]>
Signed-off-by: liyh <[email protected]>
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.24.0 to 0.25.0.
- [Commits](golang/sys@v0.24.0...v0.25.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: liyh <[email protected]>
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.20.0 to 0.21.0.
- [Commits](golang/mod@v0.20.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: liyh <[email protected]>
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.2 to 1.20.3.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.3/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.20.2...v1.20.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: liyh <[email protected]>
* fix bug: dpdk场景下添加删除ProviderNetwork失败

Signed-off-by: wangs <[email protected]>

* fix err log

Signed-off-by: wangs <[email protected]>

* fix err log

Signed-off-by: wangs <[email protected]>

* fix link set error

Signed-off-by: wangs <[email protected]>

* fix del bridge err

Signed-off-by: wangs <[email protected]>

---------

Signed-off-by: wangs <[email protected]>
Signed-off-by: liyh <[email protected]>
Signed-off-by: zhangzujian <[email protected]>
Signed-off-by: liyh <[email protected]>
Signed-off-by: zhangzujian <[email protected]>
Signed-off-by: liyh <[email protected]>
* add ipam ut

Signed-off-by: bobz965 <[email protected]>

* add ut

Signed-off-by: bobz965 <[email protected]>

* fix log

Signed-off-by: bobz965 <[email protected]>

---------

Signed-off-by: bobz965 <[email protected]>
Signed-off-by: liyh <[email protected]>
* add subnet ipam ut

Signed-off-by: bobz965 <[email protected]>

* add subnet ipam ut

Signed-off-by: bobz965 <[email protected]>

* add subnet ut

Signed-off-by: bobz965 <[email protected]>

---------

Signed-off-by: bobz965 <[email protected]>
Signed-off-by: liyh <[email protected]>
* add unit test for ovn-nb-address_set.go

Signed-off-by: zcq98 <[email protected]>

* add unit test for ovn-nb-acl.go

Signed-off-by: zcq98 <[email protected]>

* add unit test for ovn-nb-bfd.go

Signed-off-by: zcq98 <[email protected]>

---------

Signed-off-by: zcq98 <[email protected]>
Signed-off-by: liyh <[email protected]>
Signed-off-by: bobz965 <[email protected]>
Signed-off-by: liyh <[email protected]>
Signed-off-by: zhangzujian <[email protected]>
Signed-off-by: liyh <[email protected]>
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 27.2.0+incompatible to 27.2.1+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](moby/moby@v27.2.0...v27.2.1)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: liyh <[email protected]>
changluyi and others added 4 commits September 10, 2024 18:19
* add mcast querier ip for multicast

---------

Signed-off-by: clyi <[email protected]>
Signed-off-by: liyh <[email protected]>
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 10, 2024
@liyh-yusur liyh-yusur closed this Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants