Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Fix config and credential changes not being sent to Kubernetes charms #40

Merged
merged 1 commit into from Nov 21, 2022

Conversation

Cynerva
Copy link
Contributor

@Cynerva Cynerva commented Nov 16, 2022

Partial fix for https://bugs.launchpad.net/bugs/1915557

Depends on juju-solutions/interface-azure-integration#8

When cloud configuration or credentials change, resend cloud data to units whose requests have already been processed.

There's a bit of nasty stuff in here to handle the variety of cases in which cloud credentials can change. From a high level, here's what you need to know:

  1. If the charm config changes in any way (user runs juju config azure-integrator <foo>), then the charm's config-changed hook will run, with the config.changed flag set, and that will cause handle_requests to run and refresh requests.
  2. If the charm is not configured with credentials directly, then it pulls credentials from Juju instead. When the user updates those credentials with a command like juju update-credential, Juju will not inform the charm that those credentials have changed. So we monitor for changes on the update-status hook instead, which ensures that the credentials will at least be updated eventually (typically within 5 minutes).
  3. Given that the update-status hook only runs every 5 minutes, we provide an optional refresh-credentials action to force an immediate refresh of the credentials.

Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing here. This flows so beautifully.

@kwmonroe kwmonroe merged commit f92588c into master Nov 21, 2022
@kwmonroe kwmonroe deleted the gkk/fix-config-change branch November 21, 2022 05:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants