Skip to content

Introduce sugar-controller, the reconciler that deals with annotation and label based eventing enablement #3459

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

Merged
merged 19 commits into from
Jul 6, 2020

Conversation

n3wscott
Copy link
Contributor

@n3wscott n3wscott commented Jul 1, 2020

The current eventing namespace and trigger reconcilers act on labels and annotations in those components to create eventing components in the given namespace for a given broker. The trigger controller was not acting as expected, it would auto-label the namespace because of a long history of the complications needed to install a broker (service account, roles, and role bindings, plus broker). Today we just need the broker object to be created.

We can enable the interactions with these labels as an optional installable controller that enables "sugar" onto the other Kubernetes resources.

Proposed Changes

  • Remove Namespace reconciler from core.
  • Remove Trigger reconciler from core.
  • Introduce a new controller to host the new Namespace and Trigger reconcilers for sugar.

Release Note

Installing sugar-controller will provide namespace label and trigger annotation based enablement of Knative Eventing in a namespace.

Docs

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 1, 2020
@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 1, 2020
Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

Comment on lines 3 to 4
The sugar controller is an optional reconciler that watches for labels
and annotations on certain resources to inject eventing components.
Copy link
Member

Choose a reason for hiding this comment

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

Format markdown:

Suggested change
The sugar controller is an optional reconciler that watches for labels
and annotations on certain resources to inject eventing components.
The sugar controller is an optional reconciler that watches for labels and
annotations on certain resources to inject eventing components.

kubectl annotate trigger mytrigger eventing.knative.dev/injection=enabled
```


Copy link
Member

Choose a reason for hiding this comment

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

Format markdown:

Suggested change

Post deployment defaulting to always inject:

```shell script
kubectl -n knative-eventing set env deployment/sugar-controller BROKER_INJECTION_DEFAULT=true
Copy link
Member

Choose a reason for hiding this comment

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

Format markdown:

Suggested change
kubectl -n knative-eventing set env deployment/sugar-controller BROKER_INJECTION_DEFAULT=true
kubectl -n knative-eventing set env deployment/sugar-controller BROKER_INJECTION_DEFAULT=true

Copy link
Member

@mattmoor mattmoor left a 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 -name '*.pb.go' -prune -o -type f -name '*.go' -print)
goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party | grep -v .pb.go | grep -v wire_gen.go)

@lgtm-com
Copy link

lgtm-com bot commented Jul 1, 2020

This pull request introduces 2 alerts when merging dfc3dfd into 17b2978 - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@n3wscott n3wscott marked this pull request as draft July 1, 2020 23:54
@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 1, 2020
@n3wscott n3wscott requested a review from mattmoor July 1, 2020 23:55
@lgtm-com
Copy link

lgtm-com bot commented Jul 1, 2020

This pull request introduces 2 alerts when merging 3ed614f into 17b2978 - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@knative-prow-robot knative-prow-robot added the area/test-and-release Test infrastructure, tests or release label Jul 2, 2020
Copy link
Member

@mattmoor mattmoor left a 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 -name '*.pb.go' -prune -o -type f -name '*.go' -print)
goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party | grep -v .pb.go | grep -v wire_gen.go)

@lgtm-com
Copy link

lgtm-com bot commented Jul 2, 2020

This pull request introduces 2 alerts when merging 988b727 into a70e05c - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@vaikas
Copy link
Contributor

vaikas commented Jul 2, 2020

I assume you're going to create a release artifact also?

@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 2, 2020
@n3wscott n3wscott marked this pull request as ready for review July 2, 2020 20:52
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 2, 2020
@vaikas
Copy link
Contributor

vaikas commented Jul 2, 2020

Addresses: #3138

@vaikas
Copy link
Contributor

vaikas commented Jul 2, 2020

Maybe modify the CRD shape to default the trigger Status to 'no b0rk3r':
#2996

@n3wscott
Copy link
Contributor Author

n3wscott commented Jul 2, 2020

/retest

@vaikas
Copy link
Contributor

vaikas commented Jul 3, 2020

/lgtm
/approve

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 4, 2020
@vaikas
Copy link
Contributor

vaikas commented Jul 6, 2020

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: n3wscott, 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

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 6, 2020
@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-eventing-integration-tests 0/3

Failed non-flaky tests preventing automatic retry of pull-knative-eventing-integration-tests:

test/e2e.TestDefaultBrokerWithManyTriggers
test/e2e.TestDefaultBrokerWithManyTriggers/test_default_broker_with_many_deprecated_triggers
test/e2e.TestDefaultBrokerWithManyTriggers/test_default_broker_with_many_attribute_triggers
test/e2e.TestDefaultBrokerWithManyTriggers/test_default_broker_with_many_attribute_triggers_using_v1beta1_trigger
test/e2e.TestDefaultBrokerWithManyTriggers/test_default_broker_with_many_attribute_and_extension_triggers
test/e2e.TestApiServerSourceV1Alpha2EventTypes
test/e2e.TestPingSourceV1Alpha2EventTypes
test/e2e.TestTriggerDependencyAnnotation

@n3wscott
Copy link
Contributor Author

n3wscott commented Jul 6, 2020

Error from server (NotFound): deployments.apps "sugar-controller" not found

whoops! labeled the wrong namespace deployment.

@vaikas
Copy link
Contributor

vaikas commented Jul 6, 2020

monitoring (elastic search didn't come up), retrying...

Error from server (BadRequest): container "elasticsearch-logging" in pod "elasticsearch-logging-1" is waiting to start: PodInitializing

/test pull-knative-eventing-integration-tests

@vaikas
Copy link
Contributor

vaikas commented Jul 6, 2020

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 6, 2020
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 6, 2020
…espace. sed rename like the other installs.
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/eventing/v1/trigger_validation.go 96.2% 96.3% 0.1
pkg/apis/eventing/v1beta1/trigger_validation.go 96.2% 96.2% -0.1
pkg/reconciler/sugar/filters.go Do not exist 60.0%
pkg/reconciler/sugar/labels.go Do not exist 33.3%
pkg/reconciler/sugar/namespace/controller.go Do not exist 85.7%
pkg/reconciler/sugar/namespace/namespace.go Do not exist 85.7%
pkg/reconciler/sugar/trigger/controller.go Do not exist 57.1%
pkg/reconciler/sugar/trigger/trigger.go Do not exist 84.6%

@knative-prow-robot
Copy link
Contributor

knative-prow-robot commented Jul 6, 2020

@n3wscott: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-knative-eventing-go-coverage 756f233 link /test pull-knative-eventing-go-coverage

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@vaikas
Copy link
Contributor

vaikas commented Jul 6, 2020

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 6, 2020
@knative-prow-robot knative-prow-robot merged commit e777b8e into knative:master Jul 6, 2020
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. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants