Skip to content

Commit

Permalink
Merge pull request #53 from canonical/IAM-961
Browse files Browse the repository at this point in the history
Migrate to charmcraft.yaml
  • Loading branch information
nsklikas authored Aug 1, 2024
2 parents 6ddf3cd + 0bbc4bb commit f80b6dc
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 83 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ juju add-model dev
juju model-config logging-config="<root>=INFO;unit=DEBUG"

# Deploy the charm
juju deploy ./glauth-k8s_ubuntu-*-amd64.charm --resource oci-image=$(yq eval '.resources.oci-image.upstream-source' metadata.yaml)
juju deploy ./glauth-k8s_ubuntu-*-amd64.charm --resource oci-image=$(yq eval '.resources.oci-image.upstream-source' charmcraft.yaml)
```

## Observability
Expand Down
84 changes: 84 additions & 0 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,98 @@
# This file configures Charmcraft.
# See https://juju.is/docs/sdk/charmcraft-config for guidance.

name: glauth-k8s
type: charm
description: |
Kubernetes Charmed Glauth Operator
summary: |
LDAP authentication provider
links:
documentation: https://discourse.charmhub.io/t/13946
source: https://github.com/canonical/glauth-k8s-operator
issues: https://github.com/canonical/glauth-k8s-operator/issues

containers:
glauth:
resource: oci-image

resources:
oci-image:
type: oci-image
description: GLAuth oci-image
upstream-source: ghcr.io/canonical/glauth:2.3.1

requires:
pg-database:
interface: postgresql_client
optional: false
limit: 1
logging:
interface: loki_push_api
optional: true
certificates:
interface: tls-certificates
limit: 1
optional: true

provides:
metrics-endpoint:
description: |
Provides application metrics to COS Prometheus instance.
interface: prometheus_scrape
grafana-dashboard:
description: |
Forwards the built-in grafana dashboard(s) for monitoring GLAuth.
interface: grafana_dashboard
ldap:
description: |
Provides LDAP configuration data
interface: ldap
glauth-auxiliary:
description: |
Provides auxiliary data for glauth-utils charmed operator.
interface: glauth_auxiliary
send-ca-cert:
description: |
Transfer certificates to client charmed operators.
interface: certificate_transfer

config:
options:
log_level:
description: |
Configures the log level.
Acceptable values are: "info", "debug", "warning", "error" and "critical"
default: "info"
type: string
base_dn:
description: The base DN
default: "dc=glauth,dc=com"
type: string
hostname:
description: |
The hostname of the LDAP server.
The hostname should NOT contain the LDAP scheme (e.g. ldap://) and port.
default: "ldap.glauth.com"
type: string
starttls_enabled:
description: |
Enable the StartTLS support or not. DO NOT TURN IT OFF IN PRODUCTION.
default: true
type: boolean


bases:
- build-on:
- name: ubuntu
channel: "22.04"
run-on:
- name: ubuntu
channel: "22.04"

parts:
charm:
charm-binary-python-packages:
Expand Down
24 changes: 0 additions & 24 deletions config.yaml

This file was deleted.

57 changes: 0 additions & 57 deletions metadata.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from cryptography.hazmat.backends import default_backend
from pytest_operator.plugin import OpsTest

METADATA = yaml.safe_load(Path("./metadata.yaml").read_text())
METADATA = yaml.safe_load(Path("./charmcraft.yaml").read_text())
CERTIFICATE_PROVIDER_APP = "self-signed-certificates"
DB_APP = "postgresql-k8s"
GLAUTH_APP = METADATA["name"]
Expand Down

0 comments on commit f80b6dc

Please sign in to comment.