Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Certificate controller to only watch secrets with a label - #225

Merged
knative-prow[bot] merged 4 commits into
knative-extensions:mainfrom
nader-ziada:filter
Nov 2, 2022
Merged

knative-prow[bot] merged 4 commits into
knative-extensions:mainfrom
nader-ziada:filter

Conversation

@nader-ziada

Copy link
Copy Markdown
Contributor

Changes

  • add a filtered informer to certificate controller
  • this will limit the scope of watching secrets across a cluster with many secrets in all namespaces

/kind enhancement

Release Note

Certificate controller to only watch secrets with a label

@knative-prow knative-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/enhancement size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 29, 2022
@knative-prow knative-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 1, 2022
@nader-ziada

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@nader-ziada

Copy link
Copy Markdown
Contributor Author

/retest

@codecov

codecov Bot commented Nov 1, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #225 (b0cb9e3) into main (b3d2d77) will decrease coverage by 9.76%.
The diff coverage is 35.39%.

❗ Current head b0cb9e3 differs from pull request most recent head 86ed6d3. Consider uploading reports for the commit 86ed6d3 to get more accurate results

@@            Coverage Diff             @@
##             main     #225      +/-   ##
==========================================
- Coverage   82.66%   72.89%   -9.77%     
==========================================
  Files          21       23       +2     
  Lines        1090     1380     +290     
==========================================
+ Hits          901     1006     +105     
- Misses        148      317     +169     
- Partials       41       57      +16     
Impacted Files Coverage Δ
pkg/certificates/reconciler/reconciler.go 27.96% <27.96%> (ø)
pkg/certificates/reconciler/controller_impl.go 62.50% <62.50%> (ø)
pkg/certificates/reconciler/controller.go 92.85% <100.00%> (+0.54%) ⬆️
pkg/certificates/reconciler/certificates.go 69.52% <0.00%> (+0.89%) ⬆️
pkg/network/base_connection.go 89.28% <0.00%> (+2.67%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@nader-ziada
nader-ziada marked this pull request as ready for review November 1, 2022 14:22
@knative-prow knative-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 1, 2022
@nader-ziada

Copy link
Copy Markdown
Contributor Author

/cc @nak3 @dprotaso

@knative-prow
knative-prow Bot requested review from dprotaso and nak3 November 1, 2022 14:23
@skonto

skonto commented Nov 1, 2022 •

Copy link
Copy Markdown

Cool we hit a problem with this downstream and were planning to fix it. :)

// the queue through an implementation of controller.Reconciler, delegating to
// the provided Interface and optional Finalizer methods. OptionsFn is used to return
// controller.ControllerOptions to be used by the internal reconciler.
func NewFilteredImpl(ctx context.Context, r Interface, secretInformer informersv1.SecretInformer, options ...controller.Options) *controller.Impl {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The old secret controller impl is not usable any more?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the existing generated secret controller in the pkg repo doesn't let pass in a filtered informer and that already has the import to pull in the regular informer, so makes this not work

@dprotaso

dprotaso commented Nov 1, 2022 via email

Copy link
Copy Markdown
Contributor

@nader-ziada

Copy link
Copy Markdown
Contributor Author

Imports modify a global var - and I think it will cause the non filter informer to run. You can confirm but that’s why I think we need to not use that reconciler

As far as I can tell from running the tests, even if the regular secret informer is running, its not the one used by the controller. The filtered informer is the one used by the controller which is the main reason I had to do the specific controller impl so I can pass in the informer I create. If I can't use the reconciler package from the pkg repo at all, then it would be a much bigger change which is fine I guess, but I didn't want to make this work completely different than everything else.

I will try to make a different reconciler and see how that goes

@nader-ziada

Copy link
Copy Markdown
Contributor Author

@dprotaso added reconciler as well

@dprotaso

dprotaso commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

even if the regular secret informer is running

Just having the regular informer running will cause a leak since it will fill it's cache with secrets

@dprotaso

dprotaso commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 2, 2022
@knative-prow

knative-prow Bot commented Nov 2, 2022

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, nader-ziada

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 knative-prow Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 2, 2022
@nader-ziada

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@nader-ziada

Copy link
Copy Markdown
Contributor Author

/retest

@knative-prow knative-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 2, 2022
@dprotaso

dprotaso commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

/lgtm

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 2, 2022
@knative-prow
knative-prow Bot merged commit ed5e550 into knative-extensions:main Nov 2, 2022
@rachitchauhan43

Copy link
Copy Markdown

/cherry-pick release-1.7

@knative-prow-robot

Copy link
Copy Markdown

@rachitchauhan43: only knative-sandbox org members may request cherry picks. You can still do the cherry-pick manually.

Details

In response to this:

/cherry-pick release-1.7

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.

@evankanderson

Copy link
Copy Markdown
Contributor

/cherry-pick release-1.8
/cherry-pick release-1.7

@knative-prow-robot

Copy link
Copy Markdown

@evankanderson: new pull request created: #253

Details

In response to this:

/cherry-pick release-1.8
/cherry-pick release-1.7

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.

@evankanderson

Copy link
Copy Markdown
Contributor

@evankanderson

Copy link
Copy Markdown
Contributor

/cherry-pick release-1.7

@knative-prow-robot

Copy link
Copy Markdown

@evankanderson: new pull request created: #254

Details

In response to this:

/cherry-pick release-1.7

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants