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

pkg/controller/status/status: Set reasons for conditions #114

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

wking
Copy link
Member

@wking wking commented May 21, 2020

We've been light on reasons for expected conditions like Progressing=False since 80ab923. But if we feel like we have a message we want to set to help humans understand the condition, we should be setting a reason string for machines too. AsExpected follows the library-go precedent.

The Degraded reason I'm adding here isn't a great fit for a progressing reason, but does match the current logic used to set Progressing=True. The insights operator doesn't actually supply any in-cluster APIs beyond ClusterOperator as far as I can tell, so it's not clear to me what sort of progressing it would do except its internal intialization (which I give a new Initializing reason). But adding an odd reason seemed easy enough, and we can always circle back later and remove this Progressing=True case if we decide we don't need it.

We've been light on reasons for expected conditions like
Progressing=False since 80ab923 (Initial support operator commit,
2019-04-02).  But if we feel like we have a message we want to set to
help humans understand the condition, we should be setting a reason
string for machines too. AsExpected follows the library-go precedent
[1].

The "Degraded" reason I'm adding here isn't a great fit for a
progressing reason, but does match the current logic used to set
Progressing=True.  The insights operator doesn't actually supply any
in-cluster APIs beyond ClusterOperator as far as I can tell, so it's
not clear to me what sort of progressing it would do except its
internal intialization (which I give a new "Initializing" reason).
But adding an odd reason seemed easy enough, and we can always circle
back later and remove this Progressing=True case if we decide we
don't need it.

[1]: https://github.com/openshift/library-go/blob/94c59dec54be25c8527e51e8c0a885712aeb01b5/pkg/operator/status/condition.go#L67
@iNecas
Copy link
Contributor

iNecas commented May 21, 2020

/retest

@martinkunc
Copy link
Contributor

@wking, could you please add BZ Bug prefix, which would allow us to merge it historically. Is it ok to merge all the way to 4.2 ?

@wking
Copy link
Member Author

wking commented May 28, 2020

...could you please add BZ Bug prefix...

Is this serious enough to backport? 4.2 at least is maintenance mode, and I'm pretty sure this does not meet that bar. I was expecting it to land next week once 4.5 forks off master and never be backported at all.

@martinkunc
Copy link
Contributor

Ok, I agree this is a minor change. The reasoning behind this was to allow future collaborators effortless automatic merge as much as possible.

@martinkunc
Copy link
Contributor

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: martinkunc, wking

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-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 29, 2020
@martinkunc
Copy link
Contributor

@wking Actually, I could backport this for you if you dont mind. I am sure being proactive will save future mergers some, even minimal effort. There are many people committing to repo nowadays.

@openshift-bot
Copy link
Contributor

/retest

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

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

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

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 adbcca3 into openshift:master Jun 3, 2020
@wking wking deleted the condition-reason branch June 3, 2020 03:00
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.

6 participants