Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

Use Genreconciler for KnativeServing #380

Merged
merged 2 commits into from
Apr 9, 2020

Conversation

trshafer
Copy link
Contributor

@trshafer trshafer commented Mar 27, 2020

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

@trshafer: 0 warnings.

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.

if err != nil {
r.Logger.Errorf("invalid resource key: %s", key)
return nil
}
// Get the KnativeServing resource with this namespace/name.
original, err := r.knativeServingLister.KnativeServings(namespace).Get(name)
Copy link
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
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
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
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.

Copy link
Contributor

@Cynocracy Cynocracy left a comment

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
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
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
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?

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
Contributor Author

Choose a reason for hiding this comment

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

@houshengbo
Copy link

houshengbo commented Mar 31, 2020

@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
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
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
Copy link
Contributor Author

trshafer commented Apr 3, 2020

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

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

@houshengbo
Copy link

/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
Contributor

@houshengbo: Closed this PR.

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

/retest

@trshafer
Copy link
Contributor Author

trshafer commented Apr 9, 2020

/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
Copy link
Contributor Author

trshafer commented Apr 9, 2020

/cancel hold

@trshafer
Copy link
Contributor Author

trshafer commented Apr 9, 2020

/hold cancel

@lgtm-com
Copy link

lgtm-com bot commented Apr 9, 2020

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

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

lgtm-com bot commented Apr 9, 2020

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

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
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: houshengbo, trshafer

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:
  • OWNERS [houshengbo,trshafer]

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