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

Move the watcher cli application to be a go routine #12

Merged
merged 8 commits into from
May 14, 2024

Conversation

iblancasa
Copy link

@iblancasa iblancasa commented May 8, 2024

This PR moves the watcher CLI application to be a goroutine.

We were discussing this change to avoid the need to create another image as a product.

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
main.go Outdated
return err
}

disableReconciliation := os.Getenv("DISABLE_RECONCILIATION")
Copy link
Author

Choose a reason for hiding this comment

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

Maybe this can be a CLI option. I think this can be interesting to do for testing reasons.

Copy link
Owner

Choose a reason for hiding this comment

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

Did you run into a use-case where you needed this feature? If we keep it I would change it to DISABLE_WATCHER_CONTROLLER. I'm fine with moving it to CLI option if we want to keep it

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Copy link
Owner

@JoaoBraveCoding JoaoBraveCoding left a comment

Choose a reason for hiding this comment

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

minor nits

main.go Outdated
return err
}

disableReconciliation := os.Getenv("DISABLE_RECONCILIATION")
Copy link
Owner

Choose a reason for hiding this comment

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

Did you run into a use-case where you needed this feature? If we keep it I would change it to DISABLE_WATCHER_CONTROLLER. I'm fine with moving it to CLI option if we want to keep it

main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
internal/controllers/watcher/controller.go Outdated Show resolved Hide resolved
internal/controllers/watcher/controller.go Outdated Show resolved Hide resolved
@iblancasa
Copy link
Author

Did you run into a use-case where you needed this feature? If we keep it I would change it to DISABLE_WATCHER_CONTROLLER. I'm fine with moving it to CLI option if we want to keep it****

For testing, for instance.

iblancasa and others added 5 commits May 14, 2024 12:17
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
@iblancasa
Copy link
Author

@JoaoBraveCoding added your changes. I think we are ready to merge.

@JoaoBraveCoding JoaoBraveCoding merged commit e0b350b into JoaoBraveCoding:watcher May 14, 2024
3 checks passed
JoaoBraveCoding added a commit that referenced this pull request Jun 6, 2024
* feat: addd controller to watch configuration resources

* feat: adds controller to annotate ManifestWork

* fix: add missing schemas

* feat: adds new event handler for cluster wide resources

* chore: improves triggers on clusterwideresources

* chore: improve enqueueForClusterWideResource function

* Add OpenTelemetryCollector resource to the reconciliation

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

* Revert "Add OpenTelemetryCollector resource to the reconciliation"

This reverts commit 0e9894e.

* Move the watcher cli application to be a go routine (#12)

* Move the watcher cli application to be a go routine

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

* Fix lint

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

* Fix lint

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

* Update internal/controllers/watcher/controller.go

Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>

* Update internal/controllers/watcher/controller.go

Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>

* Update main.go

Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>

* Update main.go

Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>

* Add suggestion

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

---------

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Co-authored-by: Joao Marcal <joao.marcal12@gmail.com>

* Move to use addon-framework Trigger function (#13)

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

* revert unrelated changes

* * Remove ConfigMaps from reconciliation.
* If a secret is updated, check if there is any reference to it in any
  of the ManifestWorks
* Change some comments

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

* Add changes requested in code review

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

* Change comment

* address small review comments

---------

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Co-authored-by: Israel Blancas <iblancasa@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants