Skip to content

Commit

Permalink
chore: centralise metadata in charmcraft.yaml (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
gruyaume authored May 2, 2024
1 parent a2cca86 commit 9d9d233
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: channel

- name: Upload charm to Charmhub
uses: canonical/charming-actions/upload-charm@2.4.0
uses: canonical/charming-actions/upload-charm@2.5.0-rc
with:
built-charm-path: ${{ steps.charm-path.outputs.charm_path }}
credentials: "${{ secrets.CHARMCRAFT_AUTH }}"
Expand Down
6 changes: 0 additions & 6 deletions actions.yaml

This file was deleted.

60 changes: 60 additions & 0 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.

name: self-signed-certificates

summary: An operator to provide self-signed X.509 certificates to your charms.

description: |
An operator to provide self-signed X.509 certificates to your charms.
This charm relies on the `tls-certificates` charm relation interface. When a requirer charm
inserts a Certificate Signing Request in its unit databag, the
`self-signed-certificates-operator` will read it, generate a self-signed X.509 certificates and
inserts this certificate back into the relation data.
This charm is useful when developing charms or when deploying charms in non-production environment.
links:
documentation: https://discourse.charmhub.io/t/self-signed-x-509-certificates-documentation/11591
website:
- https://charmhub.io/self-signed-certificates
source:
- https://github.com/canonical/self-signed-certificates-operator
issues:
- https://github.com/canonical/self-signed-certificates-operator/issues

assumes:
- juju >= 3.1

type: charm
bases:
- build-on:
Expand Down Expand Up @@ -32,3 +57,38 @@ parts:
- libssl-dev
- pkg-config
- rustc

provides:
certificates:
interface: tls-certificates
send-ca-cert:
interface: certificate_transfer
description: |
Send our CA certificate so clients can trust the CA by means of forming a relation.
requires:
tracing:
interface: tracing
limit: 1

config:
options:
ca-common-name:
type: string
default: self-signed-certificates-operator
description: Common name to be used by the Certificate Authority.
root-ca-validity:
type: int
default: 365
description: RootCA certificate validity (in days).
certificate-validity:
type: int
default: 365
description: Certificate validity (in days).

actions:
get-ca-certificate:
description: Outputs the CA cert.

get-issued-certificates:
description: Outputs the certificates issued by the charm.
16 changes: 0 additions & 16 deletions config.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions metadata.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

logger = logging.getLogger(__name__)

METADATA = yaml.safe_load(Path("./metadata.yaml").read_text())
METADATA = yaml.safe_load(Path("./charmcraft.yaml").read_text())
APP_NAME = METADATA["name"]

TLS_REQUIRER_CHARM_NAME = "tls-certificates-requirer"
Expand Down

0 comments on commit 9d9d233

Please sign in to comment.