Reconcile using pkg/controller#1057
Conversation
|
/cc @mattmoor |
|
/cc @vaikas-google |
vaikas
left a comment
There was a problem hiding this comment.
I feel like we should document the change from ref to uid in the release notes section for sure? I assume there's a way to find the subscription given the URI alone? I'll go look at those next, just jotting it down though.
| eventingInformerFactory := informers.NewSharedInformerFactory(opt.EventingClientSet, opt.ResyncPeriod) | ||
|
|
||
| subscriptionInformer := eventingInformerFactory.Eventing().V1alpha1().Subscriptions() | ||
| //deploymentInformer := kubeInformerFactory.Apps().V1().Deployments() |
There was a problem hiding this comment.
I want to keep them until I am finished with the the other rec loops.
| logger.Fatalw("Error building kubeconfig", zap.Error(err)) | ||
| } | ||
|
|
||
| const numControllers = 1 |
There was a problem hiding this comment.
why not define this with the other constants around L72?
There was a problem hiding this comment.
I am copying patterns from serving, I think because this code knows how many reconcilers it is adding right here.
There was a problem hiding this comment.
Why can't we determine the qps values based on the size of the controller array?
There was a problem hiding this comment.
I was going to suggest that as well, but these seem to be necessary before the controller array is defined. Then I was going to suggest that we should document below in the controller array creation, but then I noticed that the code will panic if you add a controller and forget to modify controller const here. So I'm fine with this.
There was a problem hiding this comment.
This is a copy from serving. We can improve on it later. I would suggest not changing it until we do more integrations.
| } | ||
|
|
||
| // Watch the logging config map and dynamically update logging levels. | ||
| opt.ConfigMapWatcher.Watch(logging.ConfigMapName(), logging.UpdateLevelFromConfigMap(logger, atomicLevel, component)) |
There was a problem hiding this comment.
this uses logging.ConfigMapName() but L177 uses logconfig.ConfigMapName() is that intentional? If so, perhaps add comments about that. Just seems goofy.
There was a problem hiding this comment.
The two impls are split between the CR way and pkg way. The other path will be deleted when it is removed
| type ChannelSubscriberSpec struct { | ||
| // +optional | ||
| Ref *corev1.ObjectReference `json:"ref,omitempty"` | ||
| UID types.UID `json:"uid,omitempty"` |
There was a problem hiding this comment.
So, these are Subscription UIDs? Just trying to think what ramifications this change has.
There was a problem hiding this comment.
This is ONLY for patchMerge to work correctly.
There was a problem hiding this comment.
Is there an upgrade plan that allows existing channels to continue to work? What about partners who are already relying on the ref field?
There was a problem hiding this comment.
Just trying to think what ramifications this change has.
Doesn't this eliminate the ability for Channel provisioners to retrieve a list of their Subscription objects? Is there a way to retrieve an object by UID only in the Kubernetes api?
There was a problem hiding this comment.
No upgrade plan needed, it just works.
Channel provisioners to retrieve a list of their Subscription objects
this is not done as far as I know and not part of the subscribable spec.
There was a problem hiding this comment.
Yeah, this was what I was curious about also, does anybody else need to retrieve the subscription object. @n3wscott told me no, the ref here was only used for merging purposes.
There was a problem hiding this comment.
I added back Ref as DeprecatedRef
|
/hold |
|
/test pull-knative-eventing-integration-tests |
| logger.Fatalw("Error building kubeconfig", zap.Error(err)) | ||
| } | ||
|
|
||
| const numControllers = 1 |
There was a problem hiding this comment.
I was going to suggest that as well, but these seem to be necessary before the controller array is defined. Then I was going to suggest that we should document below in the controller array creation, but then I noticed that the code will panic if you add a controller and forget to modify controller const here. So I'm fine with this.
| type ChannelSubscriberSpec struct { | ||
| // +optional | ||
| Ref *corev1.ObjectReference `json:"ref,omitempty"` | ||
| UID types.UID `json:"uid,omitempty"` |
There was a problem hiding this comment.
Yeah, this was what I was curious about also, does anybody else need to retrieve the subscription object. @n3wscott told me no, the ref here was only used for merging purposes.
|
The following is the coverage report on pkg/.
|
|
/approve Thanks so much for doing this, really stoked about this. Just putting the /hold since @grantr had some outstanding comments so don't want to merge without him getting a chance to veto :) |
| Authority: fmt.Sprintf("%s.%s.channels.%s", channelName, testNS, utils.GetClusterDomainName()), | ||
| }, | ||
| Route: []istiov1alpha3.DestinationWeight{{ | ||
| Route: []istiov1alpha3.HTTPRouteDestination{{ |
There was a problem hiding this comment.
Why did this change? Is this an integration from one of the istio PRs?
There was a problem hiding this comment.
This is a pkg change.
| Authority: fmt.Sprintf("%s.%s.channels.%s", channelName, testNS, utils.GetClusterDomainName()), | ||
| }, | ||
| Route: []istiov1alpha3.DestinationWeight{{ | ||
| Route: []istiov1alpha3.HTTPRouteDestination{{ |
There was a problem hiding this comment.
Same as above - why did this change?
| } | ||
| s.logger.Sugar().Infof("NATSS message received from subject: %v; sequence: %v; timestamp: %v, headers: '%s'", msg.Subject, msg.Sequence, msg.Timestamp, message.Headers) | ||
| if err := s.dispatcher.DispatchMessage(&message, subscription.SubscriberURI, subscription.ReplyURI, provisioners.DispatchDefaults{Namespace: subscription.Namespace}); err != nil { | ||
| if err := s.dispatcher.DispatchMessage(&message, subscription.SubscriberURI, subscription.ReplyURI, provisioners.DispatchDefaults{Namespace: channel.Namespace}); err != nil { |
There was a problem hiding this comment.
Was this a bug? I guess they're always the same namespace in practice, so hard to see.
| Authority: channelHostName(channel.Name, channel.Namespace), | ||
| }, | ||
| Route: []istiov1alpha3.DestinationWeight{{ | ||
| Route: []istiov1alpha3.HTTPRouteDestination{{ |
There was a problem hiding this comment.
pkg updated the names to the real names
| Authority: fmt.Sprintf("%s.%s.channels.%s", channelName, testNS, utils.GetClusterDomainName()), | ||
| }, | ||
| Route: []istiov1alpha3.DestinationWeight{{ | ||
| Route: []istiov1alpha3.HTTPRouteDestination{{ |
| if equality.Semantic.DeepEqual(sub.Spec.Channel, s.Spec.Channel) { | ||
| subs = append(subs, s) | ||
| } | ||
| sl, err := r.subscriptionLister.Subscriptions(sub.Namespace).List(labels.Everything()) // TODO: we can use labels to help here |
There was a problem hiding this comment.
For future reference, the continue token handling can be removed based on #1044 (comment).
| Name: "key not found", | ||
| // Make sure Reconcile handles good keys that don't exist. | ||
| Key: "foo/not-found", | ||
| //}, { // TODO: there is a bug in the controller, it will query for "" |
There was a problem hiding this comment.
Is this a new test you wrote @n3wscott? Good catch!
There was a problem hiding this comment.
no, it is an existing test that was blind to what the reconciler was really doing.
| import ( | ||
| "encoding/json" | ||
| "fmt" | ||
| testing2 "github.com/knative/eventing/pkg/reconciler/testing" |
There was a problem hiding this comment.
Can we call this import something more descriptive than testing2? I suggest rectesting
| }, { | ||
| Name: "subscription, but subscriber does not exist", | ||
| Objects: []runtime.Object{ | ||
| testing2.NewSubscription(subscriptionName, testNS, |
There was a problem hiding this comment.
Can you explain why you replaced the previous builder syntax with the functional options syntax?
There was a problem hiding this comment.
serving uses mutation functions and go tends to not use builders. The functions are more flexible.
| @@ -14,30 +14,26 @@ See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| */ | |||
|
|
|||
| package v1alpha1 | |||
There was a problem hiding this comment.
I think it is git being funny, it is a new file
There was a problem hiding this comment.
yeah it's accidentally a rename because git can only detect renames by looking at file similarity.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: grantr, n3wscott, vaikas-google 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 |
|
/hold cancel |
|
🎉 |
Co-authored-by: Stavros Kontopoulos <skontopo@redhat.com>
…5 updates (knative#1057) * [release-v1.17][gomod]: Bump the patch group across 1 directory with 5 updates Bumps the patch group with 2 updates in the / directory: [k8s.io/api](https://github.com/kubernetes/api) and [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver). Updates `k8s.io/api` from 0.31.4 to 0.31.5 - [Commits](kubernetes/api@v0.31.4...v0.31.5) Updates `k8s.io/apiextensions-apiserver` from 0.31.4 to 0.31.5 - [Release notes](https://github.com/kubernetes/apiextensions-apiserver/releases) - [Commits](kubernetes/apiextensions-apiserver@v0.31.4...v0.31.5) Updates `k8s.io/apimachinery` from 0.31.4 to 0.31.5 - [Commits](kubernetes/apimachinery@v0.31.4...v0.31.5) Updates `k8s.io/apiserver` from 0.31.4 to 0.31.5 - [Commits](kubernetes/apiserver@v0.31.4...v0.31.5) Updates `k8s.io/client-go` from 0.31.4 to 0.31.5 - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](kubernetes/client-go@v0.31.4...v0.31.5) --- updated-dependencies: - dependency-name: k8s.io/api dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: k8s.io/apiextensions-apiserver dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: k8s.io/apimachinery dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: k8s.io/apiserver dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch ... Signed-off-by: dependabot[bot] <support@github.com> * Run generate release --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Relates to #734
Proposed Changes
Release Note