Skip to content

OSASINFRA-3420: openstack: Decouple OpenStack API calls from Machine generation#8187

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
shiftstack:declouple_trunkcheck
Mar 25, 2024
Merged

OSASINFRA-3420: openstack: Decouple OpenStack API calls from Machine generation#8187
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
shiftstack:declouple_trunkcheck

Conversation

@pierreprinetti
Copy link
Member

To make unit tests possible (and separate responsibilities), remove OSP API calls from the functions that generate Machines and MachineSets.

@pierreprinetti
Copy link
Member Author

/cc mandre 2uasimojo patrickdillon

@pierreprinetti
Copy link
Member Author

cf: openshift/hive#2244

@openshift-ci openshift-ci bot requested review from barbacbd and mdbooth March 20, 2024 10:06
@2uasimojo
Copy link
Member

This is great, and will suit hive's needs nicely, thanks @pierreprinetti!

@2uasimojo
Copy link
Member

2uasimojo commented Mar 20, 2024

cf. HIVE-2476

@patrickdillon
Copy link
Contributor

/approve

Copy link
Member

@mandre mandre left a comment

Choose a reason for hiding this comment

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

/lgtm

To make unit tests possible (and separate responsibilities), remove OSP
API calls from the functions that generate Machines and MachineSets.
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 20, 2024
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

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 Mar 20, 2024
@mandre
Copy link
Member

mandre commented Mar 20, 2024

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 2024

@pierreprinetti: 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-openstack-nfv-intel b99470c link false /test e2e-openstack-nfv-intel
ci/prow/e2e-openstack-proxy b99470c link false /test e2e-openstack-proxy
ci/prow/okd-e2e-aws-ovn-upgrade b99470c link false /test okd-e2e-aws-ovn-upgrade

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.

@2uasimojo
Copy link
Member

2uasimojo commented Mar 22, 2024

Critical fixes has been turned off; how do we make this go?

@pierreprinetti pierreprinetti changed the title openstack: Decouple OpenStack API calls from Machine generation OSASINFRA-3420: openstack: Decouple OpenStack API calls from Machine generation Mar 25, 2024
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 25, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 25, 2024

@pierreprinetti: This pull request references OSASINFRA-3420 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.16.0" version, but no target version was set.

Details

In response to this:

To make unit tests possible (and separate responsibilities), remove OSP API calls from the functions that generate Machines and MachineSets.

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 openshift-eng/jira-lifecycle-plugin repository.

@pierreprinetti
Copy link
Member Author

/jira refresh

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 25, 2024

@pierreprinetti: This pull request references OSASINFRA-3420 which is a valid jira issue.

Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 62bc287 and 2 for PR HEAD b99470c in total

@openshift-merge-bot openshift-merge-bot bot merged commit b873ca2 into openshift:master Mar 25, 2024
@pierreprinetti pierreprinetti deleted the declouple_trunkcheck branch March 25, 2024 13:44
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-installer-altinfra-container-v4.16.0-202403251146.p0.gb873ca2.assembly.stream.el8 for distgit ose-installer-altinfra.
All builds following this will include this PR.

@2uasimojo
Copy link
Member

Ugh, I'm sorry I didn't notice this on review, but we're going to need to do this again :(

TL;DR: we need to be able to pass custom client opts into CheckNetworkExtensionAvailability(), because we have knobs for custom certs and whatnot.

I'll post the PR.

@pierreprinetti
Copy link
Member Author

pierreprinetti commented Mar 26, 2024

@2uasimojo Indeed I removed that because the code in Installer only ever passed nil. While re-enabling external options, please add a comment to the function godoc saying why the function needs to accept connection options, so that we don't remove that again

@2uasimojo
Copy link
Member

@2uasimojo Indeed I removed that because the code in Installer only ever passed nil.

Totally, it just looked like tech debt.

While re-enabling external options, please add a comment to the function godoc saying why the function needs to accept connection options, so that we don't remove that again

Will do. Thanks!

2uasimojo added a commit to 2uasimojo/hive that referenced this pull request Mar 28, 2024
Specifically to pick up openshift/installer#8187
and openshift/installer#8209 so we can fix our
unit tests around MachinePools+OpenStack. But also just because we do
this periodically.

Needed by HIVE-2476
2uasimojo added a commit to 2uasimojo/hive that referenced this pull request Mar 28, 2024
A prior commit revendored installer to pull in
openshift/installer#8187 and
openshift/installer#8209 which decoupled the
OpenStack cloud call for trunk support discovery from the
`MachineSets()` generator.

This commit refactors our invocation of that generator accordingly, and
repairs our long-broken unit test framework around it by attaching a
`trunkSupportDiscoverer` func to the actuator. In the production code
path, this is set to the `CheckNetworkExtensionAvailability` function
publicized by the aforementioned installer PRs, whereas in the unit test
path it is set to a no-op shim. Future tests can make this shim return
any permutation of possible values to exercise different code paths.

Subsequent commits will enhance this unit test suite to reproduce the
issue in the referenced card.

Part of HIVE-2476
2uasimojo added a commit to 2uasimojo/hive that referenced this pull request Mar 28, 2024
A prior commit revendored installer to pull in
openshift/installer#8187 and
openshift/installer#8209 which decoupled the
OpenStack cloud call for trunk support discovery from the
`MachineSets()` generator.

This commit refactors our invocation of that generator accordingly, and
repairs our long-broken unit test framework around it by attaching a
`trunkSupportDiscoverer` func to the actuator. In the production code
path, this is set to the `CheckNetworkExtensionAvailability` function
publicized by the aforementioned installer PRs, whereas in the unit test
path it is set to a no-op shim. Future tests can make this shim return
any permutation of possible values to exercise different code paths.

Subsequent commits will enhance this unit test suite to reproduce the
issue in the referenced card.

Part of HIVE-2476
2uasimojo added a commit to 2uasimojo/hive that referenced this pull request Mar 29, 2024
Specifically to pick up openshift/installer#8187
and openshift/installer#8209 so we can fix our
unit tests around MachinePools+OpenStack. But also just because we do
this periodically.

Needed by HIVE-2476
2uasimojo added a commit to 2uasimojo/hive that referenced this pull request Mar 29, 2024
A prior commit revendored installer to pull in
openshift/installer#8187 and
openshift/installer#8209 which decoupled the
OpenStack cloud call for trunk support discovery from the
`MachineSets()` generator.

This commit refactors our invocation of that generator accordingly, and
repairs our long-broken unit test framework around it by attaching a
`trunkSupportDiscoverer` func to the actuator. In the production code
path, this is set to the `CheckNetworkExtensionAvailability` function
publicized by the aforementioned installer PRs, whereas in the unit test
path it is set to a no-op shim. Future tests can make this shim return
any permutation of possible values to exercise different code paths.

Subsequent commits will enhance this unit test suite to reproduce the
issue in the referenced card.

Part of HIVE-2476
2uasimojo added a commit to 2uasimojo/hive that referenced this pull request Apr 30, 2024
This is *not* a cherry-pick of openshift#2253 / (c6b37ee & f59f327). That
solution revendored installer to pick up the fix from upstream. In older
branches, this would have dragged in too many dependencies, so we
instead fix it "locally" with an explicit nil check.

Note also that the original fix added unit tests. We can't do that here
either because the new tests rely on the OpenStack UT suite being
un-broken [1], which again relied on upstream changes [2][3] we can't pull into
older branches.

[1] openshift#2251
[2] openshift/installer#8187
[3] openshift/installer#8209

HIVE-2476
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/hive that referenced this pull request Aug 8, 2024
This is *not* a cherry-pick of openshift#2253 / (c6b37ee & f59f327). That
solution revendored installer to pick up the fix from upstream. In older
branches, this would have dragged in too many dependencies, so we
instead fix it "locally" with an explicit nil check.

Note also that the original fix added unit tests. We can't do that here
either because the new tests rely on the OpenStack UT suite being
un-broken [1], which again relied on upstream changes [2][3] we can't pull into
older branches.

[1] openshift#2251
[2] openshift/installer#8187
[3] openshift/installer#8209

HIVE-2476
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/hive that referenced this pull request Aug 9, 2024
This is *not* a cherry-pick of openshift#2253 / (c6b37ee & f59f327). That
solution revendored installer to pick up the fix from upstream. In older
branches, this would have dragged in too many dependencies, so we
instead fix it "locally" with an explicit nil check.

Note also that the original fix added unit tests. We can't do that here
either because the new tests rely on the OpenStack UT suite being
un-broken [1], which again relied on upstream changes [2][3] we can't pull into
older branches.

[1] openshift#2251
[2] openshift/installer#8187
[3] openshift/installer#8209

HIVE-2476
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants