Merge lp:~exsdev/landscape-client-charm/juju-app-annotator into lp:landscape-client-charm
Status: | Rejected |
---|---|
Rejected by: | Jeremy Lounder |
Proposed branch: | lp:~exsdev/landscape-client-charm/juju-app-annotator |
Merge into: | lp:landscape-client-charm |
Diff against target: |
339 lines (+268/-1) 6 files modified
files/landscape-annotator.cron (+1/-0) files/landscape-annotator.sudoers (+1/-0) files/landscape_annotator.py (+105/-0) hooks/hooks.py (+2/-1) hooks/install.py (+28/-0) tests/20-landscape-annotator.py (+131/-0) |
To merge this branch: | bzr merge lp:~exsdev/landscape-client-charm/juju-app-annotator |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
🤖 Landscape Builder | test results | Needs Fixing | |
Landscape | Pending | ||
Review via email: mp+408794@code.launchpad.net |
Description of the change
Add script and supporting files for registering juju apps as Landscape annotations. There's an accompanying piece of code (in landscape-tagger) that converts these annotations into tags.
A few notes about the design choices:
1. The script is run via a cronjob
The alternative (which was attempted previously) was to run register annotation code whenever charms were deployed/removed. The issue with this design is that removing other subordinate charms (e.g. filebeat) did not trigger any code in this charm (e.g. config-changed, or update-status) to ensure frequent updates of annotations.
2. Annotation deployment status (e.g. deployed/removed) are tracked via annotation values: deployed=
This is required to keep track of which applications have been removed. While annotations are registered by creating a file in annotations.d, removing the same file does not remove the annotation. As such annotations are always kept around, but their values/contents are changed (e.g. deployed=true -> deployed=false). The accompanying landscape-tagger code then adds/removes the annotations as tags on landscape-server.
Unmerged revisions
- 75. By Edin S
-
Add hooks for deploying Landscape annotator scripts (and supporting files)
- 74. By Edin S
-
Add Landscape annotator tests
- 73. By Edin S
-
Add script and supporting files for registering juju apps as Landscape annotations
A few notes about the design choices:
1. The script is run via a cronjob
The alternative (which was attempted previously) was to run register
annotation code whenever charms were deployed/removed. The issue with
this design is that removing other subordinate charms (e.g. filebeat)
did not trigger any code in this charm (e.g. config-changed, or
update-status) to ensure frequent updates of annotations.2. Annotation deployment status (e.g. deployed/removed) are tracked
via annotation values: deployed={true,false} .
This is required to keep track of which applications have been
removed. While annotations are registered by creating a file in
annotations.d, removing the same file does not remove the
annotation. As such annotations are always kept around, but their
values/contents are changed (e.g. deployed=true ->
deployed=false). The accompanying landscape-tagger code then
adds/removes the annotations as tags on landscape-server.
Hi, added some inline comments...