-
Notifications
You must be signed in to change notification settings - Fork 119
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
Expose goal-state #434
Comments
If we had a way to get the number of pending units, and you just had to wait for that to be zero to get the names, would that be enough? |
Hey @stub42! We had yet another conversation about this topic. We will not be providing access to Juju's We're discussing in #165 if having "pending units" is enough or not (and in which cases it is not, and how to deal with that). So, if this issue is enough covered there, we may close it and concentrate the discussion. Thanks! |
For the postgresql-k8s charm use case, a 'pending units' count would be enough. But certainly more awkward and less developer friendly, since I now need to implement and test a loop spanning multiple hooks to get the same information that The other use case I have is exposed by It seems a lot of effort for no gain. Juju drifting away from providing information that was explicitly exposed because charms needed it and charm authors requested it makes Juju less useful. 'goal-state' provides a view at what might be, and is useful despite the fact that a goal is not a guarantee or because charms are not notified when the goal posts move. |
Mostly fixed in #597 with caveats, please see that PR for details! |
The output of the
goal-state
Juju hook environment tool is not exposed by the Operator Framework, requiring charms to wrap it themselves and mock it in tests. The Operator Framework should provide access to it.Known use cases are #206, and my charm which needs to know the unit names of its expected peers. But rather than trying to be prescient and second-guessing all the possible use cases, we could just expose the data that Juju exposes. The test harness could just return empty data by default, and provide a method to populate it (so goal-state in tests by default would look like the environment is being destroyed, which is as good a default as any and the easiest to implement).
The text was updated successfully, but these errors were encountered: