-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Generate network config secrets for baremetal platform #5247
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
Generate network config secrets for baremetal platform #5247
Conversation
|
/label platform/baremetal |
|
@andfasano: The label(s) DetailsIn response to this:
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. |
4200559 to
a136531
Compare
|
/label platform/baremetal |
|
/hold Requires #5207 to land first, and also metal3-io/baremetal-operator#936 |
|
/lgtm |
a136531 to
ef35557
Compare
|
/retest |
|
I think all the prerequisites for this have landed. @andfasano could you rebase? /hold cancel |
ef35557 to
fc00bdf
Compare
|
/hold |
|
@andfasano @ardaguclu given that both this and #5441 require tests to pass for All of The Things, I think we should submit them both in the same PR. That should result in this merging a lot faster. |
|
/hold cancel I've imported BMO bump changes and added the missing part related to linking BMH with the newly create network secret. @zaneb @ardaguclu it's now ready for another review |
|
/lgtm |
pkg/asset/machines/master.go
Outdated
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.
Do not use reflection as a means to avoid code duplication. Either create a []interface{} to pass into the function or have the function operator on each element individually. I realize that there will still be quite a bit of boilerplate code with either approach, but that is go.
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.
Unfortunately it's not possible to use []interface{} as function parameter as disallowed by the language. I've thus kept the conversion code within the generateAsset boundaries to minimize the noise outside, but that small portion cannot be simplified further, so I guess this could be a reasonable compromise between not using reflection and removing code duplication (while operating on each element individually appeared to make the code more complicated). I guess that in future Type Parameters could help for that.
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.
That is exactly what I was trying to suggest with "create a []interface{} to pass into the function".
pkg/asset/machines/master.go
Outdated
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.
Do not overload the term asset, which has a specific meaning in the context of the installer.
| func generateAsset(objects interface{}, fileName string) (assets []*asset.File, err error) { | |
| func generateAssetFile(objects interface{}, fileName string) (assets []*asset.File, err error) { |
Latest BMO version exposes a new type that is required by the current patch
48b5d77 to
f8ec682
Compare
f8ec682 to
6ca765b
Compare
|
/lgtm |
staebler
left a 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.
Looks good. Just a few nits.
6ca765b to
b42680f
Compare
|
/retest-required |
|
@andfasano: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
staebler
left a 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.
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: staebler The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This patch adds the generation of secrets to store the network configuration defined per host in the baremetal platform.
Currently based on PR #5207