charm-landscape-tagger:landscape-annotations-to-tags

Last commit made on 2021-11-05
Get this branch:
git clone -b landscape-annotations-to-tags https://git.launchpad.net/charm-landscape-tagger
Members of Canonical BootStack Charmers can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
landscape-annotations-to-tags
Repository:
lp:charm-landscape-tagger

Recent commits

b10161c... by Stephan Pampel

added tagging possible via action;
added cron job that triggers the tag update;
added config options

bb33dcf... by Stephan Pampel

Logging, documentation and description improvements

4f19fe7... by Edin S

Unregister hooks/tests of older charm code (fixes code/tests)

This charm was originally written with a different architecture in
mind. The original architecture code will be removed in a separate
branch, but for now, unregister the code to ensure that it doesn't
interact badly with the new annotations->tags code, and that tests
pass.

e400af7... by Edin S

charm: deploy annotation->tags script (and supporting files)

e547a73... by Edin S

Add tests for annotation->tag convert script

daa94c4... by Edin S

Add script for converting Landscape annotations to tags

This charm is to be related to the landscape-server charm. There's an
accompanying piece of code (in landscape-client) that sends
annotations to the Landscape server.

A few notes about the design choices:

1. The script is run via a cronjob

The alternative was to run the convert annotation code as part of a
hook, but no hooks fire consistently/frequently enough. As such, a
cron is used to consistently and frequently run the code.

2. The `landscape-api` binary is used to interact with Landscape

The landscape-api package in Bionic provides a Python2 library for
interacting with the Landscape API. The original implementation of the
convert annotation code was written in Python2. However, given that
this project is written in Python3, testing the Python2 code proved
difficulty without making config/dir workarounds. As such, the
solution was to rewrite the code in Python3 and call the landscape-api
binary.

3. Landscape API config is programmatically extracted from ini file/DB

I originally implemented this solution because there were concerns
about keeping API secrets in juju config. However, there were concerns
that my solution was fragile.

After investigation, I found an alternative solution might not be much
better. The convert code lives outside of the context of the charm
(i.e. it is run via cron) so it doesn't have access (via code) to the
charm config. One workaround for this would be for the charm to write
its secrets to the filesystem (which the convert annotation code could
then consume). This lead me to keeping my original solution.

f992a03... by Xav Paice

Makefule update

d0bb32d... by Xav Paice

add unit tests

1275009... by Xav Paice

Add Makefile

07c3cd7... by Xav Paice

Initial commit