Skip to content

Commit

Permalink
chore: centralise metadata in charmcraft.yaml (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
gruyaume committed May 3, 2024
1 parent f80c643 commit 0d782e5
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 71 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
74 changes: 74 additions & 0 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

name: httprequest-lego-k8s

description: |
LEGO operator implementing the provider side of the `tls-certificates`
interface to get signed certificates from the `Let's Encrypt` ACME server
using the HTTP Request plugin of the LEGO client and the DNS-01 challenge.
summary: |
LEGO operator implementing the provider side of the `tls-certificates`
interface to get signed certificates from the `Let's Encrypt` ACME server
using the HTTP Request plugin of the LEGO client and the DNS-01 challenge.
links:
website:
- https://charmhub.io/httprequest-lego-k8s
source:
- https://github.com/canonical/httprequest-lego-k8s-operator
issues:
- https://github.com/canonical/httprequest-lego-k8s-operator/issues
documentation: https://discourse.charmhub.io/t/http-request-acme-operator-docs-index/12513

requires:
logging:
interface: loki_push_api

provides:
certificates:
interface: tls-certificates

containers:
lego:
resource: lego-image

resources:
lego-image:
type: oci-image
description: Distroless OCI image for lego built with rockcraft.
upstream-source: ghcr.io/canonical/lego:4.16.1

type: "charm"
bases:
- build-on:
Expand All @@ -15,3 +55,37 @@ parts:
- rustc
- cargo
- pkg-config

config:
options:
email:
type: string
description: Account email address, this email will receive notifications from Let's Encrypt
server:
type: string
description: Certificate authority server
default: "https://acme-v02.api.letsencrypt.org/directory"
httpreq_endpoint:
type: string
description: URL of the custom API that can be used to fulfill the DNS-01 challenge
httpreq_http_timeout:
type: int
description: API request timeout (seconds)
default: 180
httpreq_mode:
type: string
description: "'RAW' or None"
httpreq_password:
type: string
description: Basic authentication password
httpreq_polling_interval:
type: int
description: Time between DNS propagation check (seconds)
default: 2
httpreq_propagation_timeout:
type: int
description: Maximum waiting time for DNS propagation (seconds)
default: 60
httpreq_username:
type: string
description: Basic authentication username
32 changes: 0 additions & 32 deletions config.yaml

This file was deleted.

37 changes: 0 additions & 37 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 @@ -12,7 +12,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 0d782e5

Please sign in to comment.