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

check if ipv4Addr or ipv6Addr is empty before calling AnnotatePod() #2702

Merged
merged 1 commit into from
Dec 14, 2023
Merged

check if ipv4Addr or ipv6Addr is empty before calling AnnotatePod() #2702

merged 1 commit into from
Dec 14, 2023

Conversation

zachdorame
Copy link
Contributor

@zachdorame zachdorame commented Dec 5, 2023

What type of PR is this?
bug

Which issue does this PR fix:
#2687

What does this PR do / Why do we need it:
This PR adds logic to call AnnotatePod() only if exactly one of ipv4Addr or ipv6Addr is non-null.

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:
N/A

Testing done on this change:

I observe the following log from ipamd.log

{"level":"error","ts":"2023-12-04T17:30:00.883Z","caller":"datastore/data_store.go:607","msg":"DataStore has no available IP/Prefix addresses"}
{"level":"info","ts":"2023-12-04T17:30:00.883Z","caller":"rpc/rpc.pb.go:713","msg":"Send AddNetworkReply: IPv4Addr , IPv6Addr: , DeviceNumber: -1, err: assignPodIPv4AddressUnsafe: no available IP/Prefix addresses"}

which indicates that err is no longer being overwritten.
Also, after running sudo cat plugin.log | grep "Failed SetupPodNetwork" I did not observe a netlink error

Ran make docker-unit-tests, passes unit tests

Will this PR introduce any new dependencies?:

No

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

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.

@zachdorame zachdorame requested a review from a team as a code owner December 5, 2023 00:41
pkg/ipamd/rpc_handler.go Show resolved Hide resolved
Copy link
Contributor

@jayanthvn jayanthvn left a comment

Choose a reason for hiding this comment

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

lgtm

@jdn5126
Copy link
Contributor

jdn5126 commented Dec 14, 2023

@zachdorame since the approach changed, can you update the PR title and description?

@zachdorame zachdorame changed the title Renamed error variable to avoid overwriting check if ipv4Addr or ipv6Addr is empty before calling AnnotatePod() Dec 14, 2023
@zachdorame
Copy link
Contributor Author

zachdorame commented Dec 14, 2023

@zachdorame since the approach changed, can you update the PR title and description?

Updated to reflect new approach

@jdn5126 jdn5126 merged commit 3c97b82 into aws:master Dec 14, 2023
6 checks passed
jchen6585 pushed a commit to jchen6585/amazon-vpc-cni-k8s that referenced this pull request Dec 21, 2023
jdn5126 pushed a commit to jdn5126/amazon-vpc-cni-k8s that referenced this pull request Dec 21, 2023
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.

3 participants