From 77a2b9ce32df81efc1a7ae6cc0e4f062ad264a4b Mon Sep 17 00:00:00 2001 From: Guillaume Boutry Date: Tue, 3 Oct 2023 15:07:36 +0200 Subject: [PATCH] Add jobs configuration files Apply fmt changes. Remove py3.9 and 3.10 features. Change-Id: I15fdd1a207fa6a9dceae52f63a8d0028e0f1d6ae --- charms/designate-bind-k8s/.gitreview | 5 +++++ charms/designate-bind-k8s/.zuul.yaml | 11 +++++++++++ charms/designate-bind-k8s/osci.yaml | 10 ++++++++++ charms/designate-bind-k8s/src/charm.py | 16 ++++++++++------ .../designate-bind-k8s/tests/bundles/smoke.yaml | 2 +- charms/designate-bind-k8s/tests/tests.yaml | 6 +----- 6 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 charms/designate-bind-k8s/.gitreview create mode 100644 charms/designate-bind-k8s/.zuul.yaml create mode 100644 charms/designate-bind-k8s/osci.yaml diff --git a/charms/designate-bind-k8s/.gitreview b/charms/designate-bind-k8s/.gitreview new file mode 100644 index 00000000..15594b28 --- /dev/null +++ b/charms/designate-bind-k8s/.gitreview @@ -0,0 +1,5 @@ +[gerrit] +host=review.opendev.org +port=29418 +project=openstack/charm-designate-bind-k8s.git +defaultbranch=main diff --git a/charms/designate-bind-k8s/.zuul.yaml b/charms/designate-bind-k8s/.zuul.yaml new file mode 100644 index 00000000..ef9a2ff4 --- /dev/null +++ b/charms/designate-bind-k8s/.zuul.yaml @@ -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 diff --git a/charms/designate-bind-k8s/osci.yaml b/charms/designate-bind-k8s/osci.yaml new file mode 100644 index 00000000..4cc088c3 --- /dev/null +++ b/charms/designate-bind-k8s/osci.yaml @@ -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 diff --git a/charms/designate-bind-k8s/src/charm.py b/charms/designate-bind-k8s/src/charm.py index 355f6772..ef979798 100755 --- a/charms/designate-bind-k8s/src/charm.py +++ b/charms/designate-bind-k8s/src/charm.py @@ -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 @@ -94,8 +96,10 @@ class BindRndcProvidesRelationHandler(sunbeam_rhandlers.RelationHandler): self._on_bind_client_updated, ) 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. diff --git a/charms/designate-bind-k8s/tests/bundles/smoke.yaml b/charms/designate-bind-k8s/tests/bundles/smoke.yaml index efa850f6..b5bc668e 100644 --- a/charms/designate-bind-k8s/tests/bundles/smoke.yaml +++ b/charms/designate-bind-k8s/tests/bundles/smoke.yaml @@ -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 diff --git a/charms/designate-bind-k8s/tests/tests.yaml b/charms/designate-bind-k8s/tests/tests.yaml index fcc3cb55..079ebe56 100644 --- a/charms/designate-bind-k8s/tests/tests.yaml +++ b/charms/designate-bind-k8s/tests/tests.yaml @@ -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