~exsdev/landscape-client-charm/juju-app-annotator

Viewing all changes in revision 73.

  • Committer: Edin Sarajlic
  • Date: 2021-09-22 04:33:18 UTC
  • Revision ID: edin.sarajlic@canonical.com-20210922043318-oafr4sv9bt227vjc
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.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: