-
Notifications
You must be signed in to change notification settings - Fork 501
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
fix: add charm-rev to ApplicationStatus #17919
base: 3.5
Are you sure you want to change the base?
Conversation
9 similar comments
c203412
to
21f9e39
Compare
@amandahla Thanks for opening the PR, we're not expecting to do another 3.1 release (other than security fixes), so it's best to target 3.5 or above. In terms of the code, can you not use charm-version? That version is the one supplied by the charm itself. |
21f9e39
to
452897d
Compare
Hi, thanks, I changed it now. I tried using the version but it was empty. I tested with k8s and machine charms. |
/build |
@@ -147,6 +147,7 @@ type ApplicationStatus struct { | |||
CharmVersion string `json:"charm-version"` | |||
CharmProfile string `json:"charm-profile"` | |||
CharmChannel string `json:"charm-channel,omitempty"` | |||
CharmRev int `json:"charm-rev,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to wire CharmRev
up for this to actually work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply the following diff, I'd expect to see some test fallout once we do this...
diff --git a/apiserver/facades/client/client/status.go b/apiserver/facades/client/client/status.go
index 0c51848213..331b97b480 100644
--- a/apiserver/facades/client/client/status.go
+++ b/apiserver/facades/client/client/status.go
@@ -1392,6 +1392,7 @@ func (context *statusContext) processApplication(application *state.Application)
Charm: applicationCharm.URL(),
CharmVersion: applicationCharm.Version(),
CharmProfile: charmProfileName,
+ CharmRev: applicationCharm.Revision(),
CharmChannel: channel,
Base: params.Base{
Name: base.OS,
With this change will be possible get the revision from an Application.
Note: I'm targeting 3.1 since per CONTRIBUTING it should be targeted at the lowest version affected. Please let me know if a different one should be targeted instead.
Checklist
QA steps
While creating a third-party client, is possible to get charm revision like this:
Documentation changes
No changes.
Links
To be used in https://github.com/neoaggelos/juju_exporter
Launchpad bug: https://bugs.launchpad.net/juju/+bug/
Jira card: JUJU-