Skip to content
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

BaremetalHost: Use new errorType field in Host CR #3964

Merged
merged 1 commit into from Jan 21, 2020

Conversation

zaneb
Copy link
Member

@zaneb zaneb commented Jan 14, 2020

When the operational status is in error, the BaremetalHost operator now (since metal3-io/baremetal-operator#369) reports the type of error from a fixed list. This is more reliable than determining the type of error from the provisioning status (e.g. a registration error may occur while the host is provisioning).

The possible error types are registration, inspection, provisioning, and power management errors. There is no longer a validation error, and such errors have not been produced for some time.

Currently, there are actually separate provisioning states for each error type, so the Host would never have been in a Registering or Provisioning state after an error anyway, and this code would always have reported the host status as just 'error'. These separate states are being removed (in metal3-io/baremetal-operator#388) in favour of the separate errorType field. Since the existing code was not reachable, there is no need to keep it for backward compatibility with older versions of the operator.

@zaneb zaneb requested a review from jtomasek January 14, 2020 20:53
@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 14, 2020
@openshift-ci-robot
Copy link
Contributor

Hi @zaneb. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@openshift-ci-robot openshift-ci-robot added the component/metal3 Related to metal3-plugin label Jan 14, 2020
@jtomasek
Copy link

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 16, 2020
@jtomasek
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 17, 2020
@jtomasek
Copy link

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

4 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@jtomasek
Copy link

/retest

1 similar comment
@jtomasek
Copy link

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

9 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@jtomasek
Copy link

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 20, 2020
@spadgett
Copy link
Member

spadgett commented Jan 20, 2020

I'm assuming this was held because the queue was broken.

/hold cancel
/retest

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 20, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

When the operational status is in error, the BaremetalHost operator now
reports the type of error from a fixed list. This is more reliable than
determining the type of error from the provisioning status (e.g. a
registration error may occur while the host is provisioning).

The possible error types are registration, inspection, provisioning, and
power management errors. There is no longer a validation error, and has
not been for some time.

Currently, there are actually separate provisioning states for each
error type, so the Host would never have been in a Registering or
Provisioning state after an error anyway, and this code would always
have reported the host status as just 'error'. These separate states are
being removed in favour of the separate errorType field. Since the
existing code was not reachable, there is no need to keep it for
backward compatibility with older versions of the operator.

Signed-off-by: Zane Bitter <zbitter@redhat.com>
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2020
@zaneb
Copy link
Member Author

zaneb commented Jan 21, 2020

I rebased the patch to hopefully fix CI.

@jtomasek
Copy link

/retest

@@ -18,6 +18,8 @@ import {

export const getHostOperationalStatus = (host: BareMetalHostKind): string =>
_.get(host, 'status.operationalStatus');
export const getHostErrorType = (host: BareMetalHostKind): string =>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you can use TS 3.7 optional chaining

@rawagner
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jtomasek, rawagner, zaneb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 3ff1afd into openshift:master Jan 21, 2020
@spadgett spadgett added this to the v4.4 milestone Jan 27, 2020
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. component/metal3 Related to metal3-plugin lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants