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 latest knative/pkg's configmap informer #1615

Merged
merged 5 commits into from
Mar 16, 2022

Conversation

tcnghia
Copy link
Contributor

@tcnghia tcnghia commented Mar 16, 2022

Summary

Use the latest version of knative/pkg to pull in the dynamic configmap informer (knative/pkg#2466)

Release Note

NONE

@tcnghia tcnghia force-pushed the use-dynamic-cm-informers branch from bb02814 to 544cc6b Compare March 16, 2022 01:57
@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2022

Codecov Report

Merging #1615 (bc96bd0) into main (276198e) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1615      +/-   ##
==========================================
- Coverage   27.99%   27.94%   -0.06%     
==========================================
  Files         137      137              
  Lines        7826     7820       -6     
==========================================
- Hits         2191     2185       -6     
  Misses       5405     5405              
  Partials      230      230              
Impacted Files Coverage Δ
pkg/reconciler/clusterimagepolicy/controller.go 90.90% <100.00%> (+4.90%) ⬆️
pkg/cosign/tuf/client.go 62.34% <0.00%> (-0.95%) ⬇️

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 276198e...bc96bd0. Read the comment docs.


// Start the informers we got from the SharedInformerFactory above because
// injection doesn't do that for us since we're injecting the Factory and
// not the informers.
if err := controller.StartInformers(ctx.Done(), nsSecretInformer.Informer(), nsConfigMapInformer.Informer()); err != nil {
if err := controller.StartInformers(ctx.Done(), secretInformer.Informer(), configMapInformer.Informer()); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is just a draft, but jotting this down.
Now that both of these are coming from the informers, instead of the factory, I think we do not need to manually start them.
https://github.com/knative/pkg/blob/main/injection/clients/namespacedkube/informers/core/v1/configmap/configmap.go#L36

For example, above, registers cm informer, so it should be started automagically by the sharedwithmain.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we should drop this. Good catch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@tcnghia tcnghia marked this pull request as ready for review March 16, 2022 16:38
@tcnghia tcnghia force-pushed the use-dynamic-cm-informers branch from 860b938 to aff929d Compare March 16, 2022 17:50
@tcnghia tcnghia force-pushed the use-dynamic-cm-informers branch 3 times, most recently from de13aea to 539dd57 Compare March 16, 2022 21:18
@tcnghia tcnghia force-pushed the use-dynamic-cm-informers branch 3 times, most recently from 17a08b5 to 1174380 Compare March 16, 2022 21:34
@dlorenc dlorenc enabled auto-merge (squash) March 16, 2022 21:55
@mattmoor
Copy link
Member

going to close and reopen to try and kick DCO...

@mattmoor mattmoor closed this Mar 16, 2022
auto-merge was automatically disabled March 16, 2022 22:24

Pull request was closed

@mattmoor mattmoor reopened this Mar 16, 2022
@tcnghia tcnghia force-pushed the use-dynamic-cm-informers branch from 1174380 to bc96bd0 Compare March 16, 2022 22:39
@mattmoor mattmoor merged commit 1832b4c into sigstore:main Mar 16, 2022
@github-actions github-actions bot added this to the v1.7.0 milestone Mar 16, 2022
mlieberman85 pushed a commit to mlieberman85/cosign that referenced this pull request May 6, 2022
* Use latest knative/pkg and dynamic informers

Signed-off-by: Nghia Tran <[email protected]>

* No need to start the informers

Signed-off-by: Nghia Tran <[email protected]>

* Address PR feedback

Signed-off-by: Nghia Tran <[email protected]>

* Run update-codegen.sh

Signed-off-by: Nghia Tran <[email protected]>

* Run update-codegen.sh after merge fix

Signed-off-by: Nghia Tran <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants