-
Notifications
You must be signed in to change notification settings - Fork 807
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 EC2MetadataInstanceInfo ENI calculation #2065
Conversation
Skipping CI for Draft Pull Request. |
Code Coverage Diff
|
/retest |
1 similar comment
/retest |
Looking like windows failure isn't flake... Will go debug and add unit test for windows case (and perhaps snow device and metal instance cases?) Worst case we have old version of this PR for release to at least fix regression. |
/retest |
#2063 also failing upon a retest of windows job, so looks like not related to current PR. Will investigate during working hours. A quick google of errors shows a possible certs issue on test cluster? But may be red herring. EKS remote error: tls: internal error when running kubectl logs command | AWS re:Post Manually testing IMDS query on windows 2019 and 2022 shows that regex would work correctly.
|
Looks like #2066 is passing |
/retest |
1 similar comment
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick turnaround on the fix, the regex approach is much more resilient than the current new line tech.
Manually tested changes:
- Windows node with 2 ENIs:
kubectl logs ebs-csi-node-windows-z2xw2 -n kube-system
Defaulted container "ebs-plugin" out of: ebs-plugin, node-driver-registrar, liveness-probe
I0618 18:36:19.041526 3192 main.go:157] "Initializing metadata"
I0618 18:36:19.288941 3192 ec2.go:92] "Number of attached ENIs" attachedENIs=2 Enis=<
0a:03:b0:13:df:8b/
0a:30:70:82:cf:6f/
>
- Linux node with 1 ENI:
kubectl logs ebs-csi-node-bwfv5 -n kube-system
Defaulted container "ebs-plugin" out of: ebs-plugin, node-driver-registrar, liveness-probe
I0618 18:36:14.821441 1 main.go:157] "Initializing metadata"
I0618 18:36:14.824222 1 ec2.go:92] "Number of attached ENIs" attachedENIs=1 Enis="0a:fa:d3:89:fa:b3/"
/retest |
/test pull-aws-ebs-csi-driver-test-e2e-external-eks-windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: torredil The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Is this a bug fix or adding new feature?
bug fix
What is this PR about? / Why do we need it?
Fixes #2064; Fixes a regression in calculating currently attached ENIs in our
EC2MetadataInstanceInfo
function to calculate CSINode allocatable count when not usingreservedVolumeAttachments
.Instead of checking for newlines, we should check for counts of a relevant regex, to avoid inconsistencies when IMDS returns or doesn't return a newline at end of response.
What testing is done?
Can confirm that there is no newline when querying IMDS for number of attached ENIs:
MAC address regex is sufficient across Linux and Windows CSI Driver deploys.
Open Question
Should we be smarter here and regex for a mac address instead of newlines? Seems like other IMDS endpoints DO end with aYes, new commit incoming./n
...