Skip to content

Comments

Machine API: Refactor provider status to use metav1.Condition#1135

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
RadekManak:refactor_status
Mar 25, 2022
Merged

Machine API: Refactor provider status to use metav1.Condition#1135
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
RadekManak:refactor_status

Conversation

@RadekManak
Copy link
Contributor

@RadekManak RadekManak commented Mar 8, 2022

This PR refactors out provider-specific conditions in favour of metav1.Condition type from upstream Kubernetes.

Something that was picked up while the Machine API types were being moved into openshift/api is that we have a bunch of Condition structs that are all identical, we want to consolidate these and just use metav1.Condition instead. From an end-user perspective, there should be no change to the API as a result of this, but it makes our API a bit cleaner

metav1.Condition does not have LastProbeTime field but we believe this change to be safe because the only operators who have write access to these objects are the Machine API providers which are under our control and users/cluster admins don't have access to update these fields, hence there shouldn't be anyone setting the LastProbeTime field.

I have commits ready for all providers that require change.
RadekManak/machine-api-operator@62605c4
RadekManak/machine-api-provider-aws@83efffd
RadekManak/machine-api-provider-gcp@445538d
RadekManak/machine-api-provider-azure@d917f71

Jira: OCPCLOUD-1371
Previously discussed here: #1045

@JoelSpeed
Copy link
Contributor

The only project that is affected by this api change is machine-api-operator for which I have commit ready.

I suspect each of the providers will also need an update as well (MAPA, MAPZ, MAPG)

Do the object serialize in the same way, are the fields within metav1.Condition matching the existing condition types that we have?

@RadekManak
Copy link
Contributor Author

You are right. I tested against cluster-api-provider-* repos instead of machine-api-provider-*.

@RadekManak
Copy link
Contributor Author

RadekManak commented Mar 8, 2022

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 12, 2022
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 23, 2022
Copy link
Contributor

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 24, 2022
@JoelSpeed
Copy link
Contributor

As these are API compatible from an end user perspective and the LastProbeTime field that is dropped was never actually set by the controllers using these conditions, I think this is ok (while it's technically breaking, users shouldn't have been relying on it as it was never set. This change should be transparent to and API consumer)

@lobziik
Copy link
Contributor

lobziik commented Mar 24, 2022

/lgtm

@deads2k
Copy link
Contributor

deads2k commented Mar 24, 2022

we believe this change to be safe because the only operators who have write access to these objects are the Machine API providers which are under our control and users/cluster admins don't have access to update these fields,

This tightens validation, but status writers are limited to those under our direct control (as distinct from spec). This means we know that the values we wrote are valid under the new schema. I'm willing to approve this, but if you detect any failure due to validation, you must revert this PR, fix the code in 4.11, and try again in 4.12.

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 24, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexander-demichev, deads2k, lobziik, RadekManak

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 24, 2022
@JoelSpeed
Copy link
Contributor

This project is not a part of the no-ff process

/label px-approved
/label qe-approved
/label docs-approved

@openshift-ci openshift-ci bot added px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Mar 25, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 25, 2022

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

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. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants