Skip to content

Unstructured OpenstackProviderSpec#2201

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mce-2.4from
2uasimojo:HIVE-2308/unstructured-mce-2.4
Feb 7, 2024
Merged

Unstructured OpenstackProviderSpec#2201
openshift-merge-bot[bot] merged 1 commit intoopenshift:mce-2.4from
2uasimojo:HIVE-2308/unstructured-mce-2.4

Conversation

@2uasimojo
Copy link
Copy Markdown
Member

@2uasimojo 2uasimojo commented Feb 6, 2024

Another attempt to address the move of OpenstackProviderSpec from cluster-api-provider-openstack to openstack/api/machine. See #2117 for background. In that PR, we simply replaced our imports. The result is that we could only decode the new thing. The problem is that we may still get the old thing if we're talking to an old cluster.

We only need the decoding to steal the osImage from the master machines so we can use that value for new workers. Rather than importing both schemata, trying to figure out which version we're talking to, and decoding against the correct one, this commit unmarshals the providerSpec as raw JSON into an Unstructured object and explicitly paths into it map-wise.

On the creation side, we're told that the spoke cluster itself will understand the new thing even if it's an old version (MAPI also unmarshals the JSON raw). So it should be fine to continue using recent vendored installer code to generate MachineSets (which will contain new-apiVersion OpenstackProviderSpec).

HIVE-2308

(cherry picked from commit 28dac77) (cherry picked from commit 567cdd3)

Another attempt to address the move of OpenstackProviderSpec from
cluster-api-provider-openstack to openstack/api/machine. See openshift#2117 for
background. In that PR, we simply replaced our imports. The result is
that we could only decode the _new_ thing. The problem is that we may
still get the _old_ thing if we're talking to an old cluster.

We only need the decoding to steal the osImage from the master machines
so we can use that value for new workers. Rather than importing both
schemata, trying to figure out which version we're talking to, and
decoding against the correct one, this commit unmarshals the
providerSpec as raw JSON into an Unstructured object and explicitly
paths into it map-wise.

On the creation side, we're told that the spoke cluster itself will
understand the new thing even if it's an old version (MAPI also
unmarshals the JSON raw). So it should be fine to continue using recent
vendored installer code to generate MachineSets (which will contain
new-apiVersion OpenstackProviderSpec).

HIVE-2308

(cherry picked from commit 28dac77)
(cherry picked from commit 567cdd3)
@2uasimojo
Copy link
Copy Markdown
Member Author

/assign @lleshchi

@openshift-ci openshift-ci Bot requested review from abutcher and dlom February 6, 2024 22:22
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 6, 2024
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Feb 7, 2024

@2uasimojo: all tests passed!

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 7, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (eb033fe) 57.50% compared to head (da7422d) 57.59%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           mce-2.4    #2201      +/-   ##
===========================================
+ Coverage    57.50%   57.59%   +0.08%     
===========================================
  Files          187      187              
  Lines        25739    25738       -1     
===========================================
+ Hits         14802    14823      +21     
+ Misses        9700     9677      -23     
- Partials      1237     1238       +1     
Files Coverage Δ
...g/controller/machinepool/machinepool_controller.go 52.65% <0.00%> (ø)
pkg/controller/machinepool/openstackactuator.go 19.09% <81.81%> (+19.09%) ⬆️

@lleshchi
Copy link
Copy Markdown
Contributor

lleshchi commented Feb 7, 2024

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Feb 7, 2024
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Feb 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 2uasimojo, lleshchi

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-merge-bot openshift-merge-bot Bot merged commit 3c7facb into openshift:mce-2.4 Feb 7, 2024
@2uasimojo 2uasimojo deleted the HIVE-2308/unstructured-mce-2.4 branch February 7, 2024 16:02
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants