Refactor the Configuration following #2447#2493
Refactor the Configuration following #2447#2493knative-prow-robot merged 1 commit intoknative:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mattmoor The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
knative-prow-robot
left a comment
There was a problem hiding this comment.
@mattmoor: 25 warnings.
Details
In response to this:
This starts to factor out functional options for setting up our table tests, which reduces the verbosity a fair amount.
I've broken off Configuration from a broader set of changes in #2447 to make things a bit more manageable to review.
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.
| "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" | ||
| ) | ||
|
|
||
| type BuildOption func(*unstructured.Unstructured) |
There was a problem hiding this comment.
Golint comments: exported type BuildOption should have comment or be unexported. More info.
| } | ||
| } | ||
|
|
||
| func MarkLatestCreatedFailed(msg string) ConfigOption { |
There was a problem hiding this comment.
Golint comments: exported function MarkLatestCreatedFailed should have comment or be unexported. More info.
| cfg.Status.SetLatestCreatedRevisionName(confignames.Revision(cfg)) | ||
| } | ||
|
|
||
| func WithLatestReady(cfg *v1alpha1.Configuration) { |
There was a problem hiding this comment.
Golint comments: exported function WithLatestReady should have comment or be unexported. More info.
| } | ||
| } | ||
|
|
||
| func WithConfigConcurrencyModel(ss v1alpha1.RevisionRequestConcurrencyModelType) ConfigOption { |
There was a problem hiding this comment.
Golint comments: exported function WithConfigConcurrencyModel should have comment or be unexported. More info.
| } | ||
| } | ||
|
|
||
| func WithGeneration(gen int64) ConfigOption { |
There was a problem hiding this comment.
Golint comments: exported function WithGeneration should have comment or be unexported. More info.
| } | ||
| } | ||
|
|
||
| func MarkActive(r *v1alpha1.Revision) { |
There was a problem hiding this comment.
Golint comments: exported function MarkActive should have comment or be unexported. More info.
| r.Status.MarkActive() | ||
| } | ||
|
|
||
| func MarkContainerMissing(rev *v1alpha1.Revision) { |
There was a problem hiding this comment.
Golint comments: exported function MarkContainerMissing should have comment or be unexported. More info.
|
|
||
| type K8sServiceOption func(*corev1.Service) | ||
|
|
||
| type EndpointsOption func(*corev1.Endpoints) |
There was a problem hiding this comment.
Golint comments: exported type EndpointsOption should have comment or be unexported. More info.
| } | ||
| } | ||
|
|
||
| func WithRevConcurrencyModel(ss v1alpha1.RevisionRequestConcurrencyModelType) RevisionOption { |
There was a problem hiding this comment.
Golint comments: exported function WithRevConcurrencyModel should have comment or be unexported. More info.
|
|
||
| type RouteOption func(*v1alpha1.Route) | ||
|
|
||
| type ConfigOption func(*v1alpha1.Configuration) |
There was a problem hiding this comment.
Golint comments: exported type ConfigOption should have comment or be unexported. More info.
| }), "Bogus"), | ||
| Object: cfg("validation-failure", "foo", 1234, WithConfigConcurrencyModel("Bogus"), | ||
| // Expect Revision creation to fail with the following error. | ||
| MarkRevisionCreationFailed(`invalid value "Bogus": spec.concurrencyModel`)), |
There was a problem hiding this comment.
This looks to be using cfg.Status.MarkRevisionCreationFailed(msg). I am not sure if this method is tested elsewhere, but the previous logic had some coverage of the method validating that the message is transformed and all fields are set.
There was a problem hiding this comment.
My thinking is that this is a gap in configuration_types_test.go and not a gap here.
Opened: #2499
| Object: cfg("need-rev-and-build", "foo", 99998, WithBuild, | ||
| // The following properties are set when we first reconcile a Configuration | ||
| // that stamps out a Revision with an existing Build. | ||
| WithLatestCreated, WithObservedGen), |
There was a problem hiding this comment.
Same as the above comment on WithLatestCreated.
There was a problem hiding this comment.
669a6de to
36c7083
Compare
|
/lint |
knative-prow-robot
left a comment
There was a problem hiding this comment.
@mattmoor: 1 unresolved warnings and 1 new warnings.
Details
In response to this:
/lint
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.
| } | ||
| } | ||
|
|
||
| // WithObservedGeneration sets the observed generation of the Configuration. |
There was a problem hiding this comment.
Golint comments: comment on exported function WithObservedGen should be of the form "WithObservedGen ...". More info.
9e75bcc to
5930e46
Compare
| } | ||
| } | ||
|
|
||
| // TODO(mattmoor): Ideally this could be a more generic Option and use meta.Accessor, |
There was a problem hiding this comment.
I don't think this TODO is happy with the linter still...
|
/lint |
knative-prow-robot
left a comment
There was a problem hiding this comment.
@dgerd: 1 unresolved warning and 0 new warning.
Details
In response to this:
/lint
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.
This starts to factor out functional options for setting up our table tests, which reduces the verbosity a fair amount. I've broken off Configuration from a broader set of changes in knative#2447 to make things a bit more manageable to review.
5930e46 to
0e33e0b
Compare
|
/lgtm |
|
/test pull-knative-serving-integration-tests |
This starts to factor out functional options for setting up our table tests, which reduces the verbosity a fair amount.
I've broken off Configuration from a broader set of changes in #2447 to make things a bit more manageable to review.