Add jobs configuration files

Apply fmt changes.
Remove py3.9 and 3.10 features.

Change-Id: I15fdd1a207fa6a9dceae52f63a8d0028e0f1d6ae
This commit is contained in:
Guillaume Boutry 2023-10-03 15:07:36 +02:00
parent cbd313d56d
commit 77a2b9ce32
6 changed files with 38 additions and 12 deletions

View File

@ -0,0 +1,5 @@
[gerrit]
host=review.opendev.org
port=29418
project=openstack/charm-designate-bind-k8s.git
defaultbranch=main

View File

@ -0,0 +1,11 @@
- project:
templates:
- openstack-python3-charm-jobs
- openstack-cover-jobs
- microk8s-func-test
vars:
charm_build_name: designate-bind-k8s
juju_channel: 3.1/stable
juju_classic_mode: false
microk8s_channel: 1.28-strict/stable
microk8s_classic_mode: false

View File

@ -0,0 +1,10 @@
- project:
templates:
- charm-publish-jobs
vars:
needs_charm_build: true
charm_build_name: designate-bind-k8s
build_type: charmcraft
publish_charm: true
charmcraft_channel: 2.0/stable
publish_channel: 9/edge

View File

@ -24,7 +24,9 @@ import logging
import secrets
from typing import (
Callable,
Dict,
List,
Optional,
)
import charms.designate_bind_k8s.v0.bind_rndc as bind_rndc
@ -95,7 +97,9 @@ class BindRndcProvidesRelationHandler(sunbeam_rhandlers.RelationHandler):
)
return interface
def _on_bind_client_attached(self, event: bind_rndc.NewBindClientAttachedEvent):
def _on_bind_client_attached(
self, event: bind_rndc.NewBindClientAttachedEvent
):
"""Handle bind client attached event."""
self.refresh_address()
self.callback_f(event)
@ -123,11 +127,11 @@ class BindRndcProvidesRelationHandler(sunbeam_rhandlers.RelationHandler):
self.interface.set_host(relation, str(address))
@property
def _relations(self) -> list[ops.Relation]:
def _relations(self) -> List[ops.Relation]:
"""Get relations."""
return self.model.relations[self.relation_name]
def keys(self, rndc_keys: dict[str, dict[str, str]]) -> str:
def keys(self, rndc_keys: Dict[str, Dict[str, str]]) -> str:
"""Get rndc keys formatted for named.conf allowed keys.
Format is "key1";"key2";"key3";
@ -398,8 +402,8 @@ class BindOperatorCharm(sunbeam_charm.OSBaseOperatorCharmK8S):
def _create_or_update_secret(
self,
label: str,
content: dict[str, str],
relation: ops.Relation | None = None,
content: Dict[str, str],
relation: Optional[ops.Relation] = None,
) -> ops.Secret:
"""Create or update a secret.

View File

@ -5,4 +5,4 @@ applications:
scale: 1
trust: false
resources:
designate-bind-image: ubuntu/designate-bind:9.18-22.04_beta
designate-bind-image: ubuntu/bind9:9.18-22.04_beta

View File

@ -5,17 +5,13 @@ smoke_bundles:
configure:
- zaza.charm_tests.noop.setup.basic_setup
tests:
- smoke
- zaza.charm_tests.noop.tests.NoopTest
tests_options:
trust:
- smoke
ignore_hard_deploy_errors:
- smoke
tempest:
default:
smoke: True
target_deploy_status:
designate-bind:
workload-status: active