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

use Source informer instead of conditions #4296

Merged
merged 2 commits into from
Oct 13, 2020

Conversation

vaikas
Copy link
Contributor

@vaikas vaikas commented Oct 13, 2020

Fixes #4294

Proposed Changes

  • Use source informer instead of conditions. Mismatch in informer / lister being used in the trigger reconciler..

Release Note

- 🐛 Fix bug
Dependency readiness could sometimes be missed because mismatched informer/lister was being used in the trigger reconciler.

Docs

@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 13, 2020
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 13, 2020
@codecov
Copy link

codecov bot commented Oct 13, 2020

Codecov Report

Merging #4296 into master will not change coverage.
The diff coverage is 83.33%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4296   +/-   ##
=======================================
  Coverage   80.26%   80.26%           
=======================================
  Files         287      287           
  Lines        7889     7889           
=======================================
  Hits         6332     6332           
  Misses       1174     1174           
  Partials      383      383           
Impacted Files Coverage Δ
pkg/apis/eventing/v1/trigger_lifecycle.go 45.00% <ø> (ø)
pkg/reconciler/mtbroker/trigger/trigger.go 73.07% <80.00%> (ø)
pkg/reconciler/mtbroker/trigger/controller.go 77.14% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 109f4c2...9d0d741. Read the comment docs.

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

/lgtm

if dependencyAnnotation, ok := t.GetAnnotations()[eventingv1.DependencyAnnotation]; ok {
dependencyObjRef, err := eventingv1.GetObjRefFromDependencyAnnotation(dependencyAnnotation)
if err != nil {
t.Status.MarkDependencyFailed("ReferenceError", "Unable to unmarshal objectReference from dependency annotation of trigger: %v", err)
return fmt.Errorf("getting object ref from dependency annotation %q: %v", dependencyAnnotation, err)
}
trackKResource := r.kresourceTracker.TrackInNamespace(ctx, b)
trackSource := r.sourceTracker.TrackInNamespace(ctx, t)
Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 13, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pierDipi, vaikas

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

@vaikas
Copy link
Contributor Author

vaikas commented Oct 13, 2020

Sinkbinding test failed with the deployment not getting to be ready, so not really surprising that the events were not observed:

          "status": {
            "conditions": [
              {
                "lastTransitionTime": "2020-10-13T09:31:30Z",
                "lastUpdateTime": "2020-10-13T09:31:30Z",
                "message": "Deployment does not have minimum availability.",
                "reason": "MinimumReplicasUnavailable",
                "status": "False",
                "type": "Available"
              },
              {
                "lastTransitionTime": "2020-10-13T09:31:30Z",
                "lastUpdateTime": "2020-10-13T09:31:30Z",
                "message": "ReplicaSet \"e2e-sink-binding-deployment-84d755c8\" is progressing.",
                "reason": "ReplicaSetUpdated",
                "status": "True",
                "type": "Progressing"
              }
            ],
            "observedGeneration": 1,
            "replicas": 1,
            "unavailableReplicas": 1,
            "updatedReplicas": 1

@knative-prow-robot knative-prow-robot merged commit 2078491 into knative:master Oct 13, 2020
@vaikas vaikas deleted the repro-4294 branch October 13, 2020 11:45
vaikas added a commit to vaikas/eventing that referenced this pull request Oct 13, 2020
* use Source informer instead of conditions

* remove now unused broker variable
vaikas added a commit to vaikas/eventing that referenced this pull request Oct 13, 2020
* use Source informer instead of conditions

* remove now unused broker variable
vaikas added a commit to vaikas/eventing that referenced this pull request Oct 13, 2020
* use Source informer instead of conditions

* remove now unused broker variable
knative-prow-robot pushed a commit that referenced this pull request Oct 13, 2020
* use Source informer instead of conditions

* remove now unused broker variable
knative-prow-robot pushed a commit that referenced this pull request Oct 13, 2020
* use Source informer instead of conditions (#4296)

* use Source informer instead of conditions

* remove now unused broker variable

* signature changed so can not just straight cp
@grantr
Copy link
Contributor

grantr commented Oct 13, 2020

@vaikas can you write a more detailed explanation of what the mismatch was? Why did changing from the kresource duck to the source duck fix it? Technically this feature should only need the Ready status of the kresource duck.

@vaikas
Copy link
Contributor Author

vaikas commented Oct 14, 2020

The other bit (in addition to the duck change, was the change to which Informer we use) here:
https://github.com/knative/eventing/pull/4296/files#diff-799e9e97404c7e93e75ee42a60f1ab4c15bd51bf04cd7a923d7f71ea7d478c7dR69

We were using the Conditions informer, but using the KResource lister and hence hilarity ensued. We do not have a KResource informer that I'm aware of which would've also been a way to fix this (namely, use the same informer / lister). But since the feature is explicitly tracking Sources, seemed like a fine way to fix it by changing it to use informer for Source and hence the matching lister.

@grantr
Copy link
Contributor

grantr commented Oct 14, 2020

Thanks for the explanation, I get it now :)

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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestTriggerDependencyAnnotation failing on Mink fairly consistently
4 participants