-
Notifications
You must be signed in to change notification settings - Fork 48
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
Combining Helm and Go to monitor the same CR #206
Comments
Absolutely. That's one of the main goals for the hybrid helm/go implementation.
Yes, this is exactly the idea.
You are right about that! I'm not sure anyone has ever needed to return that error/requeue but it makes total sense. The Pre/Post Hook APIs are probably the least used and most in need of some real world usage and feedback. So thanks for asking about this, and sorry it doesn't work the way you expect! It seems like a good idea. Any suggestions for changing/augmenting the Pre/PostHook interface or usage in the reconciler?
Your hook can use the same client that the reconciler uses (it's up to you to set the hook implementation up with what you need), but that should give you the ability to use the |
That's good news! Thanks for confirming.
I've forgotten some of the details from the time I originally looked into this, and was planning to revisit it at a later date when this issue was resolved. So my recollection of the exact issues I ran into are a bit hazy, however, what I was hoping to accomplish was something like this (in pseudocode):
Therefore, I think there needs to be some way for the hook function to return a request for a re-queue if needed, or Nil otherwise. Sorry, that's not particularly helpful, but I'm new to both Go and operators, so I'm not sure how this would be handled idiomatically.
Looks like that could work nicely, thanks. |
I'm evaluating the use of the hybrid-helm operator (this is my first attempt at writing an operator) and it appears to have enormous potential to cut down on boilerplate while exerting advanced control when necessary.
I'm specifically interested in the following scenario. I'm hoping to use Helm to quickly deploy the basic scaffolding, and then use some Go code for additional operations, such as communicating with an external API (Keycloak) to perform additional reconciliation tasks.
Most of the examples I've seen are centered around using Helm to manage a specific CR (e.g. Memcached) with Go code to manage a secondary CR (MemCachedBackup). What I'm hoping to do is to use Helm to manage a primary CR, but perform additional actions on the same CR using Go.
My questions are:
a. Is this a supported scenario?
b. The Pre and PostHooks could conceivably be used to perform additional tasks, like calling an external API, but how can I indicate a failure and request a requeue if the external call fails? Currently, the hook error appears to be logged and ignored:
helm-operator-plugins/pkg/reconciler/reconciler.go
Line 597 in e688971
c. How can I add additional status fields using hooks?
The text was updated successfully, but these errors were encountered: