-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into remove-trivyignore
- Loading branch information
Showing
6 changed files
with
305 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Applicable spec: <link> | ||
|
||
### Overview | ||
|
||
<!-- A high level overview of the change --> | ||
|
||
### Rationale | ||
|
||
<!-- The reason the change is needed --> | ||
|
||
### Juju Events Changes | ||
|
||
<!-- Any changes to the juju events being observed (newly added, significantly modified or deleted) --> | ||
|
||
### Module Changes | ||
|
||
<!-- Any high level changes to modules and why (Service, Observer, helper) --> | ||
|
||
### Library Changes | ||
|
||
<!-- Any changes to charm libraries --> | ||
|
||
### Checklist | ||
|
||
- [ ] The [charm style guide](https://juju.is/docs/sdk/styleguide) was applied | ||
- [ ] The [contributing guide](https://github.com/canonical/is-charms-contributing-guide) was applied | ||
- [ ] The changes are compliant with [ISD054 - Managing Charm Complexity](https://discourse.charmhub.io/t/specification-isd014-managing-charm-complexity/11619) | ||
- [ ] The documentation is generated using `src-docs` | ||
- [ ] The documentation for charmhub is updated | ||
- [ ] The PR is tagged with appropriate label (`urgent`, `trivial`, `complex`) | ||
|
||
<!-- Explanation for any unchecked items above --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2023 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
|
||
lazydocs --no-watermark --output-path src-docs src/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
<!-- markdownlint-disable --> | ||
|
||
<a href="../src/charm.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
# <kbd>module</kbd> `charm.py` | ||
|
||
|
||
|
||
|
||
**Global Variables** | ||
--------------- | ||
- **CONTAINER_PORT** | ||
- **METRICS_PORT** | ||
- **DATABASE_NAME** | ||
- **LICENSE_SECRET_KEY_NAME** | ||
- **REQUIRED_S3_SETTINGS** | ||
- **REQUIRED_SETTINGS** | ||
- **REQUIRED_SSO_SETTINGS** | ||
- **SAML_IDP_CRT** | ||
|
||
--- | ||
|
||
<a href="../src/charm.py#L47"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
## <kbd>function</kbd> `check_ranges` | ||
|
||
```python | ||
check_ranges(ranges, name) | ||
``` | ||
|
||
If ranges has one or more invalid elements, return a string describing the problem. | ||
|
||
ranges is a string containing a comma-separated list of CIDRs, a CIDR being the only kind of valid element. | ||
|
||
|
||
--- | ||
|
||
<a href="../src/charm.py#L63"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
## <kbd>function</kbd> `get_container` | ||
|
||
```python | ||
get_container(pod_spec, container_name) | ||
``` | ||
|
||
Find and return the first container in pod_spec whose name is container_name, otherwise return None. | ||
|
||
|
||
--- | ||
|
||
<a href="../src/charm.py#L71"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
## <kbd>function</kbd> `get_env_config` | ||
|
||
```python | ||
get_env_config(pod_spec, container_name) | ||
``` | ||
|
||
Return the envConfig of the container in pod_spec whose name is container_name, otherwise return None. | ||
|
||
If the container exists but has no envConfig, raise KeyError. | ||
|
||
|
||
--- | ||
|
||
## <kbd>class</kbd> `MattermostCharmEvents` | ||
Custom charm events. | ||
|
||
|
||
--- | ||
|
||
#### <kbd>property</kbd> model | ||
|
||
Shortcut for more simple access the model. | ||
|
||
|
||
|
||
|
||
--- | ||
|
||
## <kbd>class</kbd> `MattermostDBMasterAvailableEvent` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
--- | ||
|
||
## <kbd>class</kbd> `MattermostK8sCharm` | ||
|
||
|
||
|
||
|
||
<a href="../src/charm.py#L89"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
### <kbd>function</kbd> `__init__` | ||
|
||
```python | ||
__init__(*args) | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
--- | ||
|
||
#### <kbd>property</kbd> app | ||
|
||
Application that this unit is part of. | ||
|
||
--- | ||
|
||
#### <kbd>property</kbd> charm_dir | ||
|
||
Root directory of the charm as it is running. | ||
|
||
--- | ||
|
||
#### <kbd>property</kbd> config | ||
|
||
A mapping containing the charm's config and current values. | ||
|
||
--- | ||
|
||
#### <kbd>property</kbd> meta | ||
|
||
Metadata of this charm. | ||
|
||
--- | ||
|
||
#### <kbd>property</kbd> model | ||
|
||
Shortcut for more simple access the model. | ||
|
||
--- | ||
|
||
#### <kbd>property</kbd> unit | ||
|
||
Unit that this execution is responsible for. | ||
|
||
|
||
--- | ||
|
||
#### <kbd>handler</kbd> on | ||
|
||
|
||
--- | ||
|
||
<a href="../src/charm.py#L338"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
### <kbd>function</kbd> `configure_pod` | ||
|
||
```python | ||
configure_pod(event) | ||
``` | ||
|
||
Assemble the pod spec and apply it, if possible. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<!-- markdownlint-disable --> | ||
|
||
<a href="../src/environment.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
# <kbd>module</kbd> `environment.py` | ||
Generate container app environment based on charm configuration. | ||
|
||
**Global Variables** | ||
--------------- | ||
- **CONTAINER_PORT** | ||
- **METRICS_PORT** | ||
- **REQUIRED_S3_SETTINGS** | ||
- **REQUIRED_SETTINGS** | ||
- **REQUIRED_SSO_SETTINGS** | ||
- **SAML_IDP_CRT** | ||
- **CANONICAL_DEFAULTS** | ||
|
||
--- | ||
|
||
<a href="../src/environment.py#L180"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
## <kbd>function</kbd> `missing_config_settings` | ||
|
||
```python | ||
missing_config_settings(config: dict) → Iterable[str] | ||
``` | ||
|
||
Return a list of settings required to satisfy configuration dependencies. | ||
|
||
|
||
|
||
**Args:** | ||
|
||
- <b>`config`</b>: dict of the charm's configuration | ||
|
||
|
||
|
||
**Returns:** | ||
a list of settings required to satisfy configuration dependencies. | ||
|
||
|
||
--- | ||
|
||
<a href="../src/environment.py#L208"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
## <kbd>function</kbd> `generate` | ||
|
||
```python | ||
generate(config: dict, app_name: str, site_url: str, db_uri: str) → dict | ||
``` | ||
|
||
Generate container app environment based on charm configuration. | ||
|
||
|
||
|
||
**Args:** | ||
|
||
- <b>`config`</b>: dict of the charm's configuration | ||
- <b>`app_name`</b>: name of the app | ||
- <b>`site_url`</b>: public facing URL of mattermost | ||
- <b>`db_uri`</b>: URI of the psql database | ||
|
||
|
||
|
||
**Returns:** | ||
dict of container app environment. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- markdownlint-disable --> | ||
|
||
<a href="../src/utils.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
# <kbd>module</kbd> `utils.py` | ||
|
||
|
||
|
||
|
||
|
||
--- | ||
|
||
<a href="../src/utils.py#L7"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> | ||
|
||
## <kbd>function</kbd> `extend_list_merging_dicts_matched_by_key` | ||
|
||
```python | ||
extend_list_merging_dicts_matched_by_key(dst, src, key) | ||
``` | ||
|
||
Merge src, a list of zero or more dictionaries, into dst, also such a list. Dictionaries with the same key will be copied from dst and then merged using .update(src). This is not done recursively. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters