-
Notifications
You must be signed in to change notification settings - Fork 101
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
✨ Enable mac address retrieved from annotations #1262
✨ Enable mac address retrieved from annotations #1262
Conversation
Hi @fhaftmann. Thanks for your PR. I'm waiting for a metal3-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold |
/ok-to-test |
Hi @fhaftmann, thanks for the PR! I don't get the failures with Please try cleaning the repo ( |
baa3eb4
to
35801fe
Compare
That did not help, but the feedback from the CI was enough to address the reported issues. The failing unit test in https://prow.apps.test.metal3.io/view/s3/prow-logs/pr-logs/pull/metal3-io_cluster-api-provider-metal3/1262/unit/1711731905075875840 presumably is the failing round-trip conversion test mentioned in the PR where I am at a loss how to address it. |
/cc @mboukhalfa @lentzi90 |
Please ignore this for now. We have not been running this in the CI for a long time. At some point we may want to, but until then you can safely ignore it. Regarding |
35801fe
to
7e4334b
Compare
Thanks, that was the missing hint. |
/hold cancel |
Tried it, still same behaviour. Same behaviour without my changes. I am unsure whether this should be pursued further. |
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.
Really great work on this! I especially appreciate the unit tests and docs!
Just two notes below
@@ -8,5 +8,5 @@ spec: | |||
spec: | |||
containers: | |||
# Change the value of image field below to your controller image URL | |||
- image: quay.io/metal3-io/cluster-api-provider-metal3:main | |||
- image: quay.io/metal3-io/cluster-api-provider-metal3-amd64:v1beta1 |
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.
Remember to remove before merge!
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.
Oops, I have often seen that side-effect of building but did not recognize it after issuing code generation. Corrected.
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.
But maybe this was not the purpose of your comment.
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.
Yeah it is unfortunate that the current way of deploying and testing relies on making changes to these manifests 😬
I just wanted to make sure we remember to remove any changes to this line. Looks like you now accidentally removed the :main
at the end.
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.
Corrected now, sorry for the noice (again).
baremetal/metal3data_manager.go
Outdated
} | ||
} | ||
|
||
func getValueFromAnnotationStrict(object string, annotation string, |
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.
I think we should just conclude that this is how we should handle annotations and get rid of getValueFromAnnotation
(used when rendering metadata). Different behaviors for metadata and network data will just be confusing.
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.
/cc @kashifest
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.
During developing I found out that getValueFromAnnotation
yields empty strings for non-existing annotations. (It is not clear to me whether Kubernetes itself distinguishes between empty or non-existing annotations.)
An empty MAC address is surely an error condition, and hence I decided to make that strict. (You could even argue to check the annotation further e.g. via a regular expression to allow early detection of errors.)
But for meta data it is perfectly valid to have empty values – we do just not know how the data is applied.
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 explanation, that makes sense!
Could you add doc strings to these functions with some description that makes it clear what the difference is?
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.
This discussion made me think about that matter again and I have now added an explicit regexp check for the resulting MAC address – regardless of its source. That appears far more conclusive then the rather erratic and not self-explanatory distinction between potentially empty and non-empty annotations.
That means a subtle change of the overall behaviour: non-well-formed MAC addresses will not raise issues later after provisioning, but already before.
b574c1e
to
7e090ed
Compare
I am still confused by the golangci-lint / lint CI – in https://github.com/metal3-io/cluster-api-provider-metal3/actions/runs/6533034950/job/17737383459?pr=1262#step:5:12777 it plainly states
Unfortunately without any file / line indication. |
5d3a85f
to
c7c7791
Compare
Thanks, that gave me the necessary information. |
c7c7791
to
fd60117
Compare
This addresses issue metal3-io#1208. Signed-off-by: Florian Haftmann <flha@uhurutec.com>
fd60117
to
6f0c29e
Compare
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.
I'm happy with this
/approve
Would love to see some reviews by others though
/cc @Rozzii @Sunnatillo |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lentzi90, Rozzii 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 |
/test-centos-e2e-integration-main |
What this PR does / why we need it:
This PR in principle enables users to assign mac addresses via networkData based on annotations to objects representing machines, in a fashion similiar what is already possible for metaData.
Questions I was unable to resolve on my own:
These issues should be resolved before merging:
FromAnnotation
onv1beta1.NetworkLinkEthernetMac
going lost; I have found no clue how to instruct it that this is a genuinely new field with no representation in v1alpha5, although other schema extensions surely handled this in a similar way.The follwing issues are also present on branch main (commit 3068f09), it is unclear what to do about these:
make lint
fails withmake verify
complains about a bunch of wrong boilerplate headers and aborts.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1208