-
Notifications
You must be signed in to change notification settings - Fork 592
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
ApiServerSource serve v1alpha2 #2872
ApiServerSource serve v1alpha2 #2872
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: n3wscott 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
@@ -132,8 +126,6 @@ type ApiServerResource struct { | |||
|
|||
// LabelSelector restricts this source to objects with the selected labels | |||
// More info: http://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors | |||
// Deprecated: Per-resource label selectors will no longer be supported in | |||
// v1alpha2, please use Spec.LabelSelector. | |||
LabelSelector metav1.LabelSelector `json:"labelSelector"` | |||
|
|||
// ControllerSelector restricts this source to objects with a controlling owner reference of the specified kind. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with removing ControllerSelector
(redundant). Not so sure about deprecating Controller
as it has a real use case. k8s sample controller does it sightly differently (see https://github.com/kubernetes/sample-controller/blob/041853156b367ba768df5cda747e653dd98a7127/controller.go#L370) by getting the controlling owner and filtering by GVK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am filtering by gvk, but the owner gvk comes from spec. If you need both resources that are owned and unowned, it would be two resources.
I think next pass is to mt the source in a namespace for the same service account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
/hold no selector on the Owner... fixing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
selector is gone from owner GVK and panics are removed. /unhold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
@@ -18,74 +18,52 @@ package resources | |||
|
|||
import ( | |||
"fmt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
"fmt" | |
"fmt" | |
"testing" | |
@@ -18,74 +18,52 @@ package resources | |||
|
|||
import ( | |||
"fmt" | |||
"knative.dev/pkg/kmeta" | |||
"testing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
"testing" |
The following is the coverage report on the affected files.
|
@@ -79,5 +79,5 @@ spec: | |||
served: true | |||
storage: true | |||
- name: v1alpha2 | |||
served: false | |||
served: true | |||
storage: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused between this and the comments. Shouldn't this be flipped to storage = true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is stored as v1alpha1 still.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is lossy so I think we have to do that manual upgrade touch thing. So I am leaving it as v1alpha1 stored until we fix this issue as a whole
/lgtm The missing controller filter can always be added later if needed. |
There is a very big API change between APIServerSource v1alpha1 and v1alpha2. Because of this we are removing the implementation of v1alpha1 and only use v1alpha2. Conversion between v1alpha1 and v1alpha2 is lossy so we are going to still store at v1alpha1, but the deprecated fields in v1alpha1 are ignored.
Proposed Changes
Release Note
Docs