Skip to content

Commit

Permalink
Add 1.13 and 1.14 Cilium manifests (#12)
Browse files Browse the repository at this point in the history
* Add 1.13, 1.14, and 1.15 Cilium manifests

* Add new line to end of manifests

* Remove 1.15 manifests for now

* Updating CI checks

* Use current metallb charm and current pytest-operator for int tests (#13)

---------

Co-authored-by: Adam Dyess <adam.dyess@canonical.com>
  • Loading branch information
berkayoz and addyess committed Jun 6, 2024
1 parent 2d60000 commit 2798a02
Show file tree
Hide file tree
Showing 18 changed files with 3,130 additions and 311 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
call-inclusive-naming-check:
name: Inclusive Naming
uses: canonical-web-and-design/Inclusive-naming/.github/workflows/woke.yaml@main
uses: canonical/inclusive-naming/.github/workflows/woke.yaml@main
with:
fail-on-error: "true"

Expand Down
46 changes: 27 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,32 @@ log_cli_level = "INFO"
line-length = 99
target-version = ["py38"]

[tool.isort]
line_length = 99
profile = "black"

# Linting tools configuration
[tool.flake8]
max-line-length = 99
max-doc-length = 99
[tool.ruff]
line-length = 99
extend-exclude = ["__pycache__", "*.egg_info"]
lint.select = ["E", "W", "F", "C", "N", "D", "I001"]
lint.extend-ignore = [
"D203",
"D204",
"D213",
"D215",
"D400",
"D404",
"D406",
"D407",
"D408",
"D409",
"D413",
]
lint.ignore = ["E501", "D107"]
lint.per-file-ignores = {"tests/*" = ["D100","D101","D102","D103","D104"]}

[tool.ruff.lint.pep8-naming]
classmethod-decorators = ['validator']

[tool.ruff.lint.mccabe]
max-complexity = 10
exclude = [".git", "__pycache__", ".tox", "build", "dist", "*.egg_info", "venv"]
select = ["E", "W", "F", "C", "N", "R", "D", "H"]
# Ignore W503, E501 because using black creates errors with this
# Ignore D107 Missing docstring in __init__
ignore = ["W503", "E501", "D107", "N806"]
# D100, D101, D102, D103: Ignore missing docstrings in tests
per-file-ignores = ["tests/*:D100,D101,D102,D103,D104"]
docstring-convention = "google"
# Check for properly formatted copyright header in each file
copyright-check = "True"
copyright-author = "Canonical Ltd."
copyright-regexp = "Copyright\\s\\d{4}([-,]\\d{4})*\\s+%(author)s"

[tool.codespell]
skip = "upstream"
21 changes: 14 additions & 7 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,29 @@
from typing import List

from charms.grafana_k8s.v0.grafana_dashboard import GrafanaDashboardProvider
from charms.prometheus_k8s.v0.prometheus_remote_write import PrometheusRemoteWriteConsumer
from charms.prometheus_k8s.v0.prometheus_remote_write import (
PrometheusRemoteWriteConsumer,
)
from cilium_manifests import CiliumManifests
from httpx import ConnectError, HTTPError
from hubble_manifests import HubbleManifests
from jinja2 import Environment, FileSystemLoader
from lightkube import Client, codecs
from lightkube.core.exceptions import ApiError
from metrics_validator import HubbleMetrics
from ops.charm import CharmBase
from ops.framework import StoredState
from ops.main import main
from ops.manifests import Collector, ManifestClientError
from ops.model import ActiveStatus, BlockedStatus, MaintenanceStatus, ModelError, WaitingStatus
from ops.model import (
ActiveStatus,
BlockedStatus,
MaintenanceStatus,
ModelError,
WaitingStatus,
)
from pydantic import ValidationError

from cilium_manifests import CiliumManifests
from hubble_manifests import HubbleManifests
from metrics_validator import HubbleMetrics

log = logging.getLogger(__name__)

CLI_CLIENTS_PATH = Path("/usr/local/bin")