Skip to content
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

Validate the availability of traefik container before updating CA cer… #267

Conversation

gatici
Copy link
Contributor

@gatici gatici commented Oct 9, 2023

Validate the availability of traefik container before updating CA certs

Issue

While updating CA certificates when CertificateTransfer relation joined, traefik container many not be running yet. This causes ConnectionError like https://github.com/canonical/vault-k8s-operator/actions/runs/6430745831/job/17462295379?pr=53.

Solution

Availability of traefik container needs to be checked before trying to update CA certs

Context

The issue is appeared when Traefik is related with Vault-k8s using CertificateTransfer interface.

Testing Instructions

Run tox -e integration.

Release Notes

This PR aims to fix the bug: #265.
First #266 needs to be merged as it fixes some existing test problems in main branch. Otherwise, some tests are failing regardless of this PR.

Copy link
Collaborator

@PietroPasotti PietroPasotti left a comment

Choose a reason for hiding this comment

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

Could you verify that we can indeed remove the defer() call and still have the charm work as intended?

src/charm.py Outdated Show resolved Hide resolved
@gatici gatici force-pushed the TELCO-820-Validate-if-container-is-up-before-updating-ca-certs branch from 0103dbe to 8f1bc7e Compare October 9, 2023 14:23
@gatici gatici force-pushed the TELCO-820-Validate-if-container-is-up-before-updating-ca-certs branch from 490bfe9 to a200a53 Compare October 9, 2023 15:30
Copy link
Collaborator

@PietroPasotti PietroPasotti left a comment

Choose a reason for hiding this comment

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

very nice, thanks!

tests/unit/test_charm.py Outdated Show resolved Hide resolved
tests/unit/test_charm.py Outdated Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
@gatici gatici requested a review from sed-i October 10, 2023 21:36
@sed-i
Copy link
Contributor

sed-i commented Oct 11, 2023

Thanks @gatici for this important fix!

@sed-i sed-i merged commit 795dea8 into canonical:main Oct 11, 2023
12 checks passed
Copy link
Contributor

@dstathis dstathis left a comment

Choose a reason for hiding this comment

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

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants