Skip to content

Conversation

@andfasano
Copy link
Contributor

This patch adds the generation of secrets to store the network configuration defined per host in the baremetal platform.

Currently based on PR #5207

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 27, 2021
@andfasano
Copy link
Contributor Author

andfasano commented Sep 29, 2021

/label platform/baremetal

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 29, 2021

@andfasano: The label(s) /label plartform/baremetal cannot be applied. These labels are supported: platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, px-approved, docs-approved, qe-approved, downstream-change-needed, backport-risk-assessed, cherry-pick-approved

Details

In response to this:

/label plartform/baremetal

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.

@andfasano andfasano force-pushed the baremetal-networkconfig-secret branch 4 times, most recently from 4200559 to a136531 Compare October 4, 2021 11:18
@andfasano andfasano changed the title [WIP] Generate network config secrets for baremetal platform Generate network config secrets for baremetal platform Oct 4, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 4, 2021
@andfasano
Copy link
Contributor Author

/label platform/baremetal

@openshift-ci openshift-ci bot added the platform/baremetal IPI bare metal hosts platform label Oct 4, 2021
@andfasano
Copy link
Contributor Author

andfasano commented Oct 4, 2021

/hold

Requires #5207 to land first, and also metal3-io/baremetal-operator#936

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 4, 2021
@ardaguclu
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 8, 2021
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 17, 2021
@andfasano andfasano force-pushed the baremetal-networkconfig-secret branch from a136531 to ef35557 Compare October 18, 2021 07:24
@openshift-ci openshift-ci bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 18, 2021
@andfasano
Copy link
Contributor Author

/retest

@zaneb
Copy link
Member

zaneb commented Dec 1, 2021

I think all the prerequisites for this have landed. @andfasano could you rebase?

/hold cancel

@openshift-ci openshift-ci bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Dec 1, 2021
@andfasano andfasano force-pushed the baremetal-networkconfig-secret branch from ef35557 to fc00bdf Compare December 2, 2021 07:47
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2021
@andfasano
Copy link
Contributor Author

andfasano commented Dec 2, 2021

/hold
Requires #5441

@zaneb
Copy link
Member

zaneb commented Dec 2, 2021

@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.

@andfasano
Copy link
Contributor Author

andfasano commented Dec 3, 2021

/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

@zaneb
Copy link
Member

zaneb commented Dec 3, 2021

/lgtm
/cc @kirankt
/retest

@openshift-ci openshift-ci bot requested a review from kirankt December 3, 2021 15:19
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2021
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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".

Copy link
Contributor

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.

Suggested change
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
@andfasano andfasano force-pushed the baremetal-networkconfig-secret branch from 48b5d77 to f8ec682 Compare December 6, 2021 09:29
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2021
@andfasano andfasano force-pushed the baremetal-networkconfig-secret branch from f8ec682 to 6ca765b Compare December 6, 2021 14:19
@ardaguclu
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2021
Copy link
Contributor

@staebler staebler left a 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.

@andfasano andfasano force-pushed the baremetal-networkconfig-secret branch from 6ca765b to b42680f Compare December 6, 2021 16:19
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2021
@andfasano
Copy link
Contributor Author

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 6, 2021

@andfasano: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-metal-ipi-ovn-dualstack f8ec6828490dc3d659cceabc43ea07bc671a4ba0 link false /test e2e-metal-ipi-ovn-dualstack
ci/prow/okd-e2e-aws b42680f link false /test okd-e2e-aws
ci/prow/e2e-libvirt b42680f link false /test e2e-libvirt
ci/prow/e2e-ovirt b42680f link false /test e2e-ovirt
ci/prow/e2e-aws-fips b42680f link false /test e2e-aws-fips
ci/prow/e2e-metal-ipi-virtualmedia b42680f link false /test e2e-metal-ipi-virtualmedia
ci/prow/e2e-aws-workers-rhel7 b42680f link false /test e2e-aws-workers-rhel7
ci/prow/e2e-aws-single-node b42680f link false /test e2e-aws-single-node
ci/prow/e2e-crc b42680f link false /test e2e-crc

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Copy link
Contributor

@staebler staebler left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 6, 2021

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 6, 2021
@openshift-merge-robot openshift-merge-robot merged commit cd69a4b into openshift:master Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. platform/baremetal IPI bare metal hosts platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants