Use Genreconciler for KnativeServing by trshafer · Pull Request #380 · knative/serving-operator · GitHub
Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

Use Genreconciler for KnativeServing#380

Merged
knative-prow-robot merged 2 commits into
knative:masterfrom
trshafer:genreconciler
Apr 9, 2020
Merged

Use Genreconciler for KnativeServing#380
knative-prow-robot merged 2 commits into
knative:masterfrom
trshafer:genreconciler

Conversation

@trshafer

@trshafer trshafer commented Mar 27, 2020

Copy link
Copy Markdown
Contributor

Fixes #335

Proposed Changes

  • Change the reconciler to the generated reconciler

Release Note

NONE

@googlebot googlebot added the cla: yes Author(s) signed a CLA. label Mar 27, 2020

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

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.

@trshafer: 0 warnings.

Details

In response to this:

Addresses #335

Proposed Changes

  • Change the reconciler to the generated reconciler

Release Note

NONE

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see build failures because of this line, are the tests stale?

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.

pkg/reconciler/knativeserving/knativeserving_controller.go:256:21: r.knativeServingLister undefined (type *Reconciler has no field or method knativeServingLister) specifically, which maybe is somewhere else I'm missing in the file :)

@trshafer trshafer changed the title Genreconciler [WIP] Genreconciler Mar 27, 2020
@trshafer trshafer force-pushed the genreconciler branch 2 times, most recently from a73a2cf to 2dc4a44 Compare March 30, 2020 21:13
@trshafer trshafer changed the title [WIP] Genreconciler Genreconciler Mar 30, 2020
@trshafer trshafer changed the title Genreconciler Use Genreconciler for KnativeServing Mar 30, 2020
limitations under the License.
*/

// Code generated by injection-gen. DO NOT EDIT.

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.

Any particular reason this isn't in a zz_generated.go file? Is that not standard practice?

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.

I'm not sure. It's the same for knative/serving. Maybe the comment is sufficient? I still find it confusing to understand what line of code actually produced this file. https://github.com/knative/serving/blob/fdfc49f209d6114295968d9d4c7ad8392542a9c0/pkg/client/injection/reconciler/serving/v1/service/reconciler.go.

@Cynocracy Cynocracy left a comment

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.

A couple of questions about places where I'm confused :)

The tests are passing though, so depending on what I learn this looks reasonable.

v1alpha1knativeserving "knative.dev/serving-operator/pkg/client/injection/reconciler/serving/v1alpha1/knativeserving"
)

// TODO: PLEASE COPY AND MODIFY THIS FILE AS A STARTING POINT

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.

Delete

Also, is the code generated comment still relevant? If so, we might want to remove this from the generated code :)

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.


knativeservingInformer := knativeserving.Get(ctx)

// TODO: setup additional informers here.

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.

Do we need more informers on the underlying deployments, for instance?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I am not sure if this line is generated, since this file is under pkg/client/injection?

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.

@houshengbo

houshengbo commented Mar 31, 2020

Copy link
Copy Markdown

@trshafer @Cynocracy I have submitted this PR to move over all the serving-operator code: knative/operator#1
I am thinking of whether we FREEZE the operators' repo, to make sure all the code land in there.
After two operators embrace each other in one repo, with correct functionalities, we can move forward with the new repo.
Thoughts?

@trshafer

Copy link
Copy Markdown
Contributor Author

@houshengbo genreconciler should make it easier to transition from one operator to another as more of the boilerplate code is autogenerated. I think we should finish #335. Thoughts?

@Cynocracy

Copy link
Copy Markdown
Contributor

My opinion is that we should land this and a similar change in eventing to minimize the boilerplate / wiring needed to combine the operators. We have this working for serving, maybe we could prepare a similar change for eventing before we merge this?

@trshafer

trshafer commented Apr 3, 2020

Copy link
Copy Markdown
Contributor Author

@houshengbo thoughts on merging this change? The next change will be to remove rbase:

Base: rbase.NewBase(ctx, controllerAgentName, cmw),

@houshengbo

Copy link
Copy Markdown

/close
We stopped contributing to this repo, as our new repo for knative operator has set up: knative-sandbox/operator.

@knative-prow-robot

Copy link
Copy Markdown
Contributor

@houshengbo: Closed this PR.

Details

In response to this:

/close
We stopped contributing to this repo, as our new repo for knative operator has set up: knative-sandbox/operator.

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.

@houshengbo houshengbo reopened this Apr 9, 2020
@houshengbo

Copy link
Copy Markdown

/retest

@trshafer

trshafer commented Apr 9, 2020

Copy link
Copy Markdown
Contributor Author

/hold

Will update with removing rbase.

@trshafer trshafer force-pushed the genreconciler branch 2 times, most recently from 3a3f836 to b8f656b Compare April 9, 2020 18:38
@trshafer

trshafer commented Apr 9, 2020

Copy link
Copy Markdown
Contributor Author

/cancel hold

@trshafer

trshafer commented Apr 9, 2020

Copy link
Copy Markdown
Contributor Author

/hold cancel

@lgtm-com

lgtm-com Bot commented Apr 9, 2020

Copy link
Copy Markdown

This pull request introduces 1 alert and fixes 1 when merging b8f656b into 940a4ca - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

fixed alerts:

  • 1 for Useless assignment to local variable

@knative-metrics-robot

Copy link
Copy Markdown

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

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/knativeserving_lifecycle.go 57.9% 52.9% -5.0

@lgtm-com

lgtm-com Bot commented Apr 9, 2020

Copy link
Copy Markdown

This pull request fixes 1 alert when merging 28b217e into 940a4ca - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable

@houshengbo

Copy link
Copy Markdown

This PR is equivalent to the corresponding changes we had in knative-sandbox/operator, in terms of refactoring the reconciler.
/lgtm
/approve

@knative-prow-robot

Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot merged commit 7624ab5 into knative:master Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KnativeServing reconciler should use +genreconciler

6 participants