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

Enable adding and removing watches at runtime. #246

Closed
nkvoll opened this issue Dec 12, 2018 · 6 comments
Closed

Enable adding and removing watches at runtime. #246

nkvoll opened this issue Dec 12, 2018 · 6 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@nkvoll
Copy link

nkvoll commented Dec 12, 2018

It would be great if there was a way to add and remove watches during the controller lifecycle.

Use case: want to be able to get some data from a user-supplied secret, instead of inline:

    credentials:
        secretSource:
            name: name-of-a-secret-containing-some-credentials
        #inline:
        #    username: foo
        #    password: bar
  • If secretSource is specified, we want to add a watch for it so we can reconcile when it changes (likely have to provide a custom handler.EventHandler to reconcile the correct object(s)).
  • If it is no longer specified, we want to remove the watch for it (if we created it) so we no longer spend resources on having an unused watch.
  • This means the resources we would like to have watches for may change over time, so the ability to not only add, but also remove watches becomes important.
@DirectXMan12
Copy link
Contributor

/kind feature
/priority important-longterm

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Jan 4, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 28, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 28, 2019
@DirectXMan12
Copy link
Contributor

I believe we support this now, closing.

DirectXMan12 pushed a commit that referenced this issue Jan 31, 2020
Generate correct CRD primitive types
@jcanseco
Copy link
Contributor

How can one actually do this (i.e. dynamically add and remove watches?)

If I understand correctly, I can dynamically add a watch by calling controller.Watch() from within the reonciler.

How can one remove the watch once it is no longer needed?

@jcanseco
Copy link
Contributor

jcanseco commented May 2, 2022

Gentle ping -- still looking for an answer to my question above.

@DirectXMan12 is this something you could help out with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

No branches or pull requests

5 participants