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

Align Eventing conditions with Serving conditions. #62

Merged

Conversation

markusthoemmes
Copy link
Contributor

Proposed Changes

One more step towards reusable functions between Eventing and Serving: This aligns the conditions and helpers for setting those conditions between Eventing and Serving.

For now, the helper code is mostly a copy. Potential collapsing of the repetetiveness might come later. This is more about the calling site than it is about the definition site.

Release Note

NONE

/assign @jcrossley3 @houshengbo

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markusthoemmes

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

@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 5, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label May 5, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 5, 2020
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@markusthoemmes: 0 warnings.

In response to this:

Proposed Changes

One more step towards reusable functions between Eventing and Serving: This aligns the conditions and helpers for setting those conditions between Eventing and Serving.

For now, the helper code is mostly a copy. Potential collapsing of the repetetiveness might come later. This is more about the calling site than it is about the definition site.

Release Note

NONE

/assign @jcrossley3 @houshengbo

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.

Copy link
Contributor

@jcrossley3 jcrossley3 left a comment

Choose a reason for hiding this comment

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

Personally, I'd go further. Let's introduce a CommonStatus and hang the lifecycle functions off of it.

@markusthoemmes
Copy link
Contributor Author

@jcrossley3 not sure if that's really "possible" with the current scheme. We can have Version on there no problem but I'm not so sure about the condition stuff. Let's do that in a followup?

@jcrossley3
Copy link
Contributor

@markusthoemmes as long as you don't name it Status which would conflict with the one from the duckv1 package, I think you're good. It will muddy up the literals, of course, but it should be straightforward, no?

@markusthoemmes
Copy link
Contributor Author

@jcrossley3 I think the "issue" is that the conditionSet is a global singleton and not captured by the type itself. The lifecycle functions capture that global conditionSet and do stuff based on it so we'd have to see how we can generalize that.

@markusthoemmes
Copy link
Contributor Author

I guess we could potentially use the same conditionset for both, but that'd mean that they can't diverge at all which is not necessarily an assumption I'd like to take right now.

@jcrossley3
Copy link
Contributor

I'm absolutely assuming the conditionSet will be identical for both, as well as the other status fields.

@markusthoemmes
Copy link
Contributor Author

I don't. Once we add "Ingress" into Serving, we might want to surface its readiness in a separate condition for example.

@jcrossley3
Copy link
Contributor

DependenciesInstalled and DependenciesAvailable BOOM!

@markusthoemmes
Copy link
Contributor Author

markusthoemmes commented May 5, 2020

I think that's the wrong condition to use. I thought DependenciesInstalled is for external dependencies, i.e.: Handled by an external actor and not by this operator at all. If you use it here, you lose external control over readiness.

@jcrossley3
Copy link
Contributor

No. I think of it as a placeholder or hook. There's nothing preventing this operator from using it, and I expect it will once ingress selection becomes a part of our API. We never want to do anything that would prevent downstream operators from using it, too, of course.

@markusthoemmes
Copy link
Contributor Author

That will though. It needs to remain untouched by this operator to be usable from a downstream operator. Else they will trample each other's state.

@jcrossley3
Copy link
Contributor

They will need to coordinate, that's true.

@markusthoemmes
Copy link
Contributor Author

So, in terms of staging things and merges: I intended to land the interfaces first and not go into too much detail on how best to consolidate code on the definition site.

Once the interfaces are landed, we can separately move definition site consolidation (i.e. making the type definitions more dense) and caller consolidation (reusing business logic) forward.

I think it's valuable for us to move forward, especially looking at business logic reuse. I'm happy to discuss this as part of the definition site consolidation at a later stage. Does that make sense?

@knative-metrics-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/apis/operator/v1alpha1/knativeeventing_lifecycle.go 90.9% 100.0% 9.1
pkg/apis/operator/v1alpha1/knativeserving_lifecycle.go 70.6% 100.0% 29.4

@houshengbo
Copy link
Contributor

/lgtm
It looks good to me by aligning Eventing conditions with serving's.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label May 5, 2020
@knative-prow-robot knative-prow-robot merged commit ea89fbd into knative:master May 5, 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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants