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

Move resource synthesis for Service controller into resource subpackage. #1443

Merged
merged 3 commits into from
Jul 2, 2018

Conversation

mattmoor
Copy link
Member

@mattmoor mattmoor commented Jul 1, 2018

This moves the assorted methods for constructing the resources owned by the Service controller into pkg/controller/service/resources.

I want a clearer separation of these trivial methods from the more complex controller logic because they should be trivial to unit test to nearly 100% and tracking that is harder when they are grouped with the harder-to-cover controller code.

I did this as a proof-of-concept, but think we should probably follow suit with the other controllers.

/assign @jonjohnsonjr

cc @tcnghia

@google-prow-robot google-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 1, 2018
@mattmoor
Copy link
Member Author

mattmoor commented Jul 1, 2018

FWIW, I also think that this is a significantly better place for the assorted naming methods to move, but that is not part of this change.

Something I didn't call out is that I simplified the names here to shorten them, with the expectation that if folks need to import multiple resources packages from different controllers (e.g. if we relocate naming methods) that they'd import:

import (
  svcresources "github.com/knative/serving/pkg/controller/service/resources"
  cfgresource "github.com/knative/serving/pkg/controller/configuration/resources"
)

... and that the package-qualification would become redundant with some of the qualification previously in the method name.

@knative-metrics-robot
Copy link

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/controller/service/resources/labels.go Do not exist 100.0%
pkg/controller/service/resources/route.go Do not exist 100.0%
pkg/controller/service/resources/configuration.go Do not exist 100.0%

*TestCoverage feature is being tested, do not rely on any info here yet

@jonjohnsonjr
Copy link
Contributor

/lgtm
/approve

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2018
@google-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jonjohnsonjr, mattmoor

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

@google-prow-robot google-prow-robot merged commit 78fcf54 into knative:master Jul 2, 2018
@mattmoor mattmoor deleted the service-resources branch July 2, 2018 16:03
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. 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.

4 participants