Skip to content

Switch KRShaped interface to retrieve entire condition set#1307

Merged
knative-prow-robot merged 3 commits into
knative:masterfrom
whaught:redo-cond
May 6, 2020
Merged

Switch KRShaped interface to retrieve entire condition set#1307
knative-prow-robot merged 3 commits into
knative:masterfrom
whaught:redo-cond

Conversation

@whaught
Copy link
Copy Markdown
Contributor

@whaught whaught commented May 6, 2020

Issue #1226

  • Switch interface to retrieve the entire conditions set

As I looked at integrating this downstream I've realized this will be more flexible so that we can have generic awareness of all the conditions that exist for a resource. This will also allow us to ensure they are initialized.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label May 6, 2020
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 6, 2020
@whaught
Copy link
Copy Markdown
Contributor Author

whaught commented May 6, 2020

/assign @n3wscott


GetStatus() *Status

GetTopLevelConditionType() apis.ConditionType
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here is a hitch in this plan: for things like alternate broker implementations, the reconciler for the broker gets to redefine what the ConditionSet for the resource is, and it ignores the type's conditions set, it also avoids all the Mark* methods. So it might not be true that this condition set is the one in play for the resource under reconciliation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cc: @grantr

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We we could either say alternate brokers are not KRShaped and need to manage things on their own or if they share the same top-level condition, define a set with only that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the alternate broker in https://github.com/google/knative-gcp we have a separate API type that defines its own ConditionSet specific to the alternate implementation. There's a separate generated reconciler for that type that the alternate broker controller uses to reconcile. I'm not sure if this is the right pattern long-term.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@n3wscott do you have an example of a single type that works with multiple ConditionSets? I don't know of any.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Assuming "Top Level" means Ready/Succeeded, then generally conformance dictates that this should not vary. I think that the rest can vary at all levels of severity, assuming our semantics are adhered to.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK, just note we have an issue if we ever use any other method on the ConditionSet other than the toplevel method.

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-pkg-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
apis/duck/v1/kresource_type.go Do not exist 87.5%

@n3wscott
Copy link
Copy Markdown
Contributor

n3wscott commented May 6, 2020

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2020
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: n3wscott, whaught

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2020
@knative-prow-robot knative-prow-robot merged commit 3769cd2 into knative:master May 6, 2020
@whaught whaught deleted the redo-cond branch May 6, 2020 21:57
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants