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

fixed empty netns bug #1941

Merged
merged 3 commits into from
Mar 31, 2022
Merged

fixed empty netns bug #1941

merged 3 commits into from
Mar 31, 2022

Conversation

cgchinmay
Copy link
Contributor

@cgchinmay cgchinmay commented Mar 29, 2022

What type of PR is this?
bug fix

Which issue does this PR fix:
#1939

What does this PR do / Why do we need it:
Empty NetNS check was causing IP leak in certain edge cases for non-sgp pods. So have to make this fix

Testing done on this change:

Validated cni host-networking tests
Manually deleted sandbox container (edge case scenario). On pod delete, saw the DEL request invoked for CNI with an empty NetNS as seen below and the IPs was freed

{"level":"debug","ts":"2022-03-29T21:33:33.640Z","caller":"routed-eni-cni-plugin/cni.go:295","msg":"Prev Result: &{0.4.0 [{Name:eni84953baf01d Mac: Sandbox:} {Name:eth0 Mac: Sandbox:/proc/23288/ns/net}] [{Version:4 Interface:0xc0001cc260 Address:{IP:192.168.21.198 Mask:ffffffff} Gateway:<nil>}] [] {[]  [] []}}\n"}
{"level":"info","ts":"2022-03-29T21:33:33.640Z","caller":"routed-eni-cni-plugin/cni.go:295","msg":"Received CNI del request: ContainerID(c139669cc9f13aa65d2a0932fbde93bb7138c1cbba57021b97093fe917625008) Netns() IfName(eth0) Args(IgnoreUnknown=1;K8S_POD_NAMESPACE=default;K8S_POD_NAME=samplepod-8488bb6b58-gh5mb;K8S_POD_INFRA_CONTAINER_ID=c139669cc9f13aa65d2a0932fbde93bb7138c1cbba57021b97093fe917625008) Path(/opt/cni/bin) argsStdinData({\"cniVersion\":\"0.4.0\",\"mtu\":\"9001\",\"name\":\"aws-cni\",\"pluginLogFile\":\"/var/log/aws-routed-eni/plugin.log\",\"pluginLogLevel\":\"DEBUG\",\"prevResult\":{\"cniVersion\":\"0.4.0\",\"interfaces\":[{\"name\":\"eni84953baf01d\"},{\"name\":\"eth0\",\"sandbox\":\"/proc/23288/ns/net\"}],\"ips\":[{\"version\":\"4\",\"interface\":1,\"address\":\"192.168.21.198/32\"}],\"dns\":{}},\"type\":\"aws-cni\",\"vethPrefix\":\"eni\"})"}
{"level":"info","ts":"2022-03-29T21:33:33.642Z","caller":"routed-eni-cni-plugin/cni.go:295","msg":"Received del network response from ipamd for pod samplepod-8488bb6b58-gh5mb namespace default sandbox c139669cc9f13aa65d2a0932fbde93bb7138c1cbba57021b97093fe917625008: Success:true  IPv4Addr:\"192.168.21.198\""}
{"level":"debug","ts":"2022-03-29T21:33:33.642Z","caller":"routed-eni-cni-plugin/cni.go:425","msg":"TeardownNS: addr 192.168.21.198/32, deviceNumber 0"}
{"level":"info","ts":"2022-03-29T21:33:33.642Z","caller":"driver/driver.go:532","msg":"Delete toContainer rule for 192.168.21.198/32 "}
{"level":"error","ts":"2022-03-29T21:33:33.642Z","caller":"driver/driver.go:532","msg":"delete NS network: failed to delete host route for 192.168.21.198/32, no such process"}
{"level":"debug","ts":"2022-03-29T21:33:33.642Z","caller":"driver/driver.go:532","msg":"Tear down of NS complete"}

Automation added to e2e:

Not yet

Will this PR introduce any new dependencies?:

No

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
No

Does this change require updates to the CNI daemonset config files to work?:

No

Does this PR introduce any user-facing change?:

No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

minor logging change
@cgchinmay cgchinmay requested a review from a team as a code owner March 29, 2022 21:21
Copy link
Contributor

@M00nF1sh M00nF1sh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@cgchinmay cgchinmay merged commit d761423 into aws:master Mar 31, 2022
@cgchinmay cgchinmay added this to the v1.10.3 milestone Mar 31, 2022
cgchinmay pushed a commit to cgchinmay/amazon-vpc-cni-k8s that referenced this pull request Mar 31, 2022
* Change workflow to use git install (aws#1785)

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Workflow file updates (aws#1787)

* Change workflow to use git install

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Update workflow files to use go 1.16

- Updated workflow files to use go 1.16 for consistency.
- Changed integ test script to use git commit id and deleted unused code

* Specify go version at 1.16 for workflow files

Cherry pick multi-arch changes in release branch

1.10.2 changes (aws#1830)

* VlanID changes

PPSG Test agent changes

CNI metrics helper changes

minor fix

Move logging for CLUSTER_ID and Region inside publisher.go from main.go

revert manifest changes as the image is not released yet

* Cherry pick multi-arch changes in release branch

* cni-metrics-helper changes
vlanID changes
disable network provisioning fix
ipamd error code fix

* Minor change

* remove redundant changes

* Go version changes

* Switch to public ECR for AL2 (aws#1804)

* Switch to public ecr for al2 image

- Removed docker_arch variable which is redundant with this change

* Fix makefile and dockerfile entries

* Merge changes to auto-sync manifests

* minor change: add ContainerID to dummyVlanInterface

* Remove sudo from workflow files (aws#1818)

* remove set -x from bash, add -Ss to curl (aws#1802)

* remove weekly-cron-test.yml as its not needed for this branch

Co-authored-by: Vikas Basavaraj <5373156+vikasmb@users.noreply.github.com>
Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
Co-authored-by: Scott Merrill <skippy@skippy.net>

fixed conflicts with routed-eni-cni-plugin/cni.go

Updated config files for v1.10.2

Changelog updates

fixed empty netns bug (aws#1941)

minor logging change

Updated GO SDK

added c7g instance

PD on bare metal instance

fixed dependabot warning
cgchinmay pushed a commit that referenced this pull request Apr 4, 2022
* Cherry pick of workflow changes from master branch (#1793)

* Change workflow to use git install (#1785)

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Workflow file updates (#1787)

* Change workflow to use git install

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Update workflow files to use go 1.16

- Updated workflow files to use go 1.16 for consistency.
- Changed integ test script to use git commit id and deleted unused code

* Specify go version at 1.16 for workflow files

Cherry pick multi-arch changes in release branch

1.10.2 changes (#1830)

* VlanID changes

PPSG Test agent changes

CNI metrics helper changes

minor fix

Move logging for CLUSTER_ID and Region inside publisher.go from main.go

revert manifest changes as the image is not released yet

* Cherry pick multi-arch changes in release branch

* cni-metrics-helper changes
vlanID changes
disable network provisioning fix
ipamd error code fix

* Minor change

* remove redundant changes

* Go version changes

* Switch to public ECR for AL2 (#1804)

* Switch to public ecr for al2 image

- Removed docker_arch variable which is redundant with this change

* Fix makefile and dockerfile entries

* Merge changes to auto-sync manifests

* minor change: add ContainerID to dummyVlanInterface

* Remove sudo from workflow files (#1818)

* remove set -x from bash, add -Ss to curl (#1802)

* remove weekly-cron-test.yml as its not needed for this branch

Co-authored-by: Vikas Basavaraj <5373156+vikasmb@users.noreply.github.com>
Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
Co-authored-by: Scott Merrill <skippy@skippy.net>

fixed conflicts with routed-eni-cni-plugin/cni.go

* Cherry pick of workflow changes from master branch (#1793)

* Change workflow to use git install (#1785)

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Workflow file updates (#1787)

* Change workflow to use git install

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Update workflow files to use go 1.16

- Updated workflow files to use go 1.16 for consistency.
- Changed integ test script to use git commit id and deleted unused code

* Specify go version at 1.16 for workflow files

Cherry pick multi-arch changes in release branch

1.10.2 changes (#1830)

* VlanID changes

PPSG Test agent changes

CNI metrics helper changes

minor fix

Move logging for CLUSTER_ID and Region inside publisher.go from main.go

revert manifest changes as the image is not released yet

* Cherry pick multi-arch changes in release branch

* cni-metrics-helper changes
vlanID changes
disable network provisioning fix
ipamd error code fix

* Minor change

* remove redundant changes

* Go version changes

* Switch to public ECR for AL2 (#1804)

* Switch to public ecr for al2 image

- Removed docker_arch variable which is redundant with this change

* Fix makefile and dockerfile entries

* Merge changes to auto-sync manifests

* minor change: add ContainerID to dummyVlanInterface

* Remove sudo from workflow files (#1818)

* remove set -x from bash, add -Ss to curl (#1802)

* remove weekly-cron-test.yml as its not needed for this branch

Co-authored-by: Vikas Basavaraj <5373156+vikasmb@users.noreply.github.com>
Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
Co-authored-by: Scott Merrill <skippy@skippy.net>

fixed conflicts with routed-eni-cni-plugin/cni.go

Updated config files for v1.10.2

Changelog updates

fixed empty netns bug (#1941)

minor logging change

Updated GO SDK

added c7g instance

PD on bare metal instance

fixed dependabot warning

* Updated go.mod and go.sum
cgchinmay pushed a commit that referenced this pull request Apr 8, 2022
* Cherry pick of workflow changes from master branch (#1793)

* Change workflow to use git install (#1785)

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Workflow file updates (#1787)

* Change workflow to use git install

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Update workflow files to use go 1.16

- Updated workflow files to use go 1.16 for consistency.
- Changed integ test script to use git commit id and deleted unused code

* Specify go version at 1.16 for workflow files

Cherry pick multi-arch changes in release branch

1.10.2 changes (#1830)

* VlanID changes

PPSG Test agent changes

CNI metrics helper changes

minor fix

Move logging for CLUSTER_ID and Region inside publisher.go from main.go

revert manifest changes as the image is not released yet

* Cherry pick multi-arch changes in release branch

* cni-metrics-helper changes
vlanID changes
disable network provisioning fix
ipamd error code fix

* Minor change

* remove redundant changes

* Go version changes

* Switch to public ECR for AL2 (#1804)

* Switch to public ecr for al2 image

- Removed docker_arch variable which is redundant with this change

* Fix makefile and dockerfile entries

* Merge changes to auto-sync manifests

* minor change: add ContainerID to dummyVlanInterface

* Remove sudo from workflow files (#1818)

* remove set -x from bash, add -Ss to curl (#1802)

* remove weekly-cron-test.yml as its not needed for this branch

Co-authored-by: Vikas Basavaraj <5373156+vikasmb@users.noreply.github.com>
Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
Co-authored-by: Scott Merrill <skippy@skippy.net>

fixed conflicts with routed-eni-cni-plugin/cni.go

* Updated config files for v1.10.2

* Changelog updates

* Cherry pick of workflow changes from master branch (#1793)

* Change workflow to use git install (#1785)

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Workflow file updates (#1787)

* Change workflow to use git install

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Update workflow files to use go 1.16

- Updated workflow files to use go 1.16 for consistency.
- Changed integ test script to use git commit id and deleted unused code

* Specify go version at 1.16 for workflow files

Cherry pick multi-arch changes in release branch

1.10.2 changes (#1830)

* VlanID changes

PPSG Test agent changes

CNI metrics helper changes

minor fix

Move logging for CLUSTER_ID and Region inside publisher.go from main.go

revert manifest changes as the image is not released yet

* Cherry pick multi-arch changes in release branch

* cni-metrics-helper changes
vlanID changes
disable network provisioning fix
ipamd error code fix

* Minor change

* remove redundant changes

* Go version changes

* Switch to public ECR for AL2 (#1804)

* Switch to public ecr for al2 image

- Removed docker_arch variable which is redundant with this change

* Fix makefile and dockerfile entries

* Merge changes to auto-sync manifests

* minor change: add ContainerID to dummyVlanInterface

* Remove sudo from workflow files (#1818)

* remove set -x from bash, add -Ss to curl (#1802)

* remove weekly-cron-test.yml as its not needed for this branch

Co-authored-by: Vikas Basavaraj <5373156+vikasmb@users.noreply.github.com>
Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
Co-authored-by: Scott Merrill <skippy@skippy.net>

fixed conflicts with routed-eni-cni-plugin/cni.go

* Cherry pick of workflow changes from master branch (#1793)

* Change workflow to use git install (#1785)

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Workflow file updates (#1787)

* Change workflow to use git install

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Update workflow files to use go 1.16

- Updated workflow files to use go 1.16 for consistency.
- Changed integ test script to use git commit id and deleted unused code

* Specify go version at 1.16 for workflow files

Cherry pick multi-arch changes in release branch

1.10.2 changes (#1830)

* VlanID changes

PPSG Test agent changes

CNI metrics helper changes

minor fix

Move logging for CLUSTER_ID and Region inside publisher.go from main.go

revert manifest changes as the image is not released yet

* Cherry pick multi-arch changes in release branch

* cni-metrics-helper changes
vlanID changes
disable network provisioning fix
ipamd error code fix

* Minor change

* remove redundant changes

* Go version changes

* Switch to public ECR for AL2 (#1804)

* Switch to public ecr for al2 image

- Removed docker_arch variable which is redundant with this change

* Fix makefile and dockerfile entries

* Merge changes to auto-sync manifests

* minor change: add ContainerID to dummyVlanInterface

* Remove sudo from workflow files (#1818)

* remove set -x from bash, add -Ss to curl (#1802)

* remove weekly-cron-test.yml as its not needed for this branch

Co-authored-by: Vikas Basavaraj <5373156+vikasmb@users.noreply.github.com>
Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
Co-authored-by: Scott Merrill <skippy@skippy.net>

fixed conflicts with routed-eni-cni-plugin/cni.go

Updated config files for v1.10.2

Changelog updates

fixed empty netns bug (#1941)

minor logging change

Updated GO SDK

added c7g instance

PD on bare metal instance

fixed dependabot warning

* Updated go.mod and go.sum

* sync upload-resources-to-github file with master
cgchinmay pushed a commit that referenced this pull request Apr 11, 2022
* Cherry pick of workflow changes from master branch (#1793)

* Change workflow to use git install (#1785)

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Workflow file updates (#1787)

* Change workflow to use git install

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Update workflow files to use go 1.16

- Updated workflow files to use go 1.16 for consistency.
- Changed integ test script to use git commit id and deleted unused code

* Specify go version at 1.16 for workflow files

Cherry pick multi-arch changes in release branch

1.10.2 changes (#1830)

* VlanID changes

PPSG Test agent changes

CNI metrics helper changes

minor fix

Move logging for CLUSTER_ID and Region inside publisher.go from main.go

revert manifest changes as the image is not released yet

* Cherry pick multi-arch changes in release branch

* cni-metrics-helper changes
vlanID changes
disable network provisioning fix
ipamd error code fix

* Minor change

* remove redundant changes

* Go version changes

* Switch to public ECR for AL2 (#1804)

* Switch to public ecr for al2 image

- Removed docker_arch variable which is redundant with this change

* Fix makefile and dockerfile entries

* Merge changes to auto-sync manifests

* minor change: add ContainerID to dummyVlanInterface

* Remove sudo from workflow files (#1818)

* remove set -x from bash, add -Ss to curl (#1802)

* remove weekly-cron-test.yml as its not needed for this branch

Co-authored-by: Vikas Basavaraj <5373156+vikasmb@users.noreply.github.com>
Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
Co-authored-by: Scott Merrill <skippy@skippy.net>

fixed conflicts with routed-eni-cni-plugin/cni.go

* Updated config files for v1.10.2

* Changelog updates

* Cherry pick of workflow changes from master branch (#1793)

* Change workflow to use git install (#1785)

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Workflow file updates (#1787)

* Change workflow to use git install

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Update workflow files to use go 1.16

- Updated workflow files to use go 1.16 for consistency.
- Changed integ test script to use git commit id and deleted unused code

* Specify go version at 1.16 for workflow files

Cherry pick multi-arch changes in release branch

1.10.2 changes (#1830)

* VlanID changes

PPSG Test agent changes

CNI metrics helper changes

minor fix

Move logging for CLUSTER_ID and Region inside publisher.go from main.go

revert manifest changes as the image is not released yet

* Cherry pick multi-arch changes in release branch

* cni-metrics-helper changes
vlanID changes
disable network provisioning fix
ipamd error code fix

* Minor change

* remove redundant changes

* Go version changes

* Switch to public ECR for AL2 (#1804)

* Switch to public ecr for al2 image

- Removed docker_arch variable which is redundant with this change

* Fix makefile and dockerfile entries

* Merge changes to auto-sync manifests

* minor change: add ContainerID to dummyVlanInterface

* Remove sudo from workflow files (#1818)

* remove set -x from bash, add -Ss to curl (#1802)

* remove weekly-cron-test.yml as its not needed for this branch

Co-authored-by: Vikas Basavaraj <5373156+vikasmb@users.noreply.github.com>
Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
Co-authored-by: Scott Merrill <skippy@skippy.net>

fixed conflicts with routed-eni-cni-plugin/cni.go

* Cherry pick of workflow changes from master branch (#1793)

* Change workflow to use git install (#1785)

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Workflow file updates (#1787)

* Change workflow to use git install

- Change workflow to use git install as the go get command was
  altering go.mod file without updating go.sum file

* Update workflow files to use go 1.16

- Updated workflow files to use go 1.16 for consistency.
- Changed integ test script to use git commit id and deleted unused code

* Specify go version at 1.16 for workflow files

Cherry pick multi-arch changes in release branch

1.10.2 changes (#1830)

* VlanID changes

PPSG Test agent changes

CNI metrics helper changes

minor fix

Move logging for CLUSTER_ID and Region inside publisher.go from main.go

revert manifest changes as the image is not released yet

* Cherry pick multi-arch changes in release branch

* cni-metrics-helper changes
vlanID changes
disable network provisioning fix
ipamd error code fix

* Minor change

* remove redundant changes

* Go version changes

* Switch to public ECR for AL2 (#1804)

* Switch to public ecr for al2 image

- Removed docker_arch variable which is redundant with this change

* Fix makefile and dockerfile entries

* Merge changes to auto-sync manifests

* minor change: add ContainerID to dummyVlanInterface

* Remove sudo from workflow files (#1818)

* remove set -x from bash, add -Ss to curl (#1802)

* remove weekly-cron-test.yml as its not needed for this branch

Co-authored-by: Vikas Basavaraj <5373156+vikasmb@users.noreply.github.com>
Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
Co-authored-by: Scott Merrill <skippy@skippy.net>

fixed conflicts with routed-eni-cni-plugin/cni.go

Updated config files for v1.10.2

Changelog updates

fixed empty netns bug (#1941)

minor logging change

Updated GO SDK

added c7g instance

PD on bare metal instance

fixed dependabot warning

* Updated go.mod and go.sum

* Updated Chart and appversion for vpc-cni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants