Merge ~mthaddon/charm-k8s-ingress/+git/charm-k8s-ingress:master into charm-k8s-ingress:master

Proposed by Tom Haddon
Status: Merged
Approved by: Jon Seager
Approved revision: 0ed33b2eb9e99c2d472335197940a214a06504f5
Merged at revision: 058e690492c5a50d1dcf1a87f6c387f1fd65cc9c
Proposed branch: ~mthaddon/charm-k8s-ingress/+git/charm-k8s-ingress:master
Merge into: charm-k8s-ingress:master
Diff against target: 122 lines (+34/-24)
6 files modified
.flake8 (+1/-1)
.gitignore (+8/-0)
config.yaml (+5/-9)
manifest.yaml (+1/-0)
metadata.yaml (+17/-4)
src/charm.py (+2/-10)
Reviewer Review Type Date Requested Status
ingress-charmers Pending
Review via email: mp+399871@code.launchpad.net

Commit message

Initial working version of the charm

Description of the change

Initial working version of the charm

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 058e690492c5a50d1dcf1a87f6c387f1fd65cc9c

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.flake8 b/.flake8
2index 8ef84fc..41512a8 100644
3--- a/.flake8
4+++ b/.flake8
5@@ -1,5 +1,5 @@
6 [flake8]
7-max-line-length = 99
8+max-line-length = 120
9 select: E,W,F,C,N
10 exclude:
11 venv
12diff --git a/.gitignore b/.gitignore
13new file mode 100644
14index 0000000..58a7dc6
15--- /dev/null
16+++ b/.gitignore
17@@ -0,0 +1,8 @@
18+*~
19+*swp
20+*.charm
21+.tox
22+.coverage
23+__pycache__
24+build
25+venv
26diff --git a/config.yaml b/config.yaml
27index fc2a7af..5323e7e 100644
28--- a/config.yaml
29+++ b/config.yaml
30@@ -1,11 +1,7 @@
31 # Copyright 2021 Tom Haddon
32 # See LICENSE file for licensing details.
33-#
34-# This is only an example, and you should edit to suit your needs.
35-# If you don't need config, you can remove the file entirely.
36-#
37-# options:
38-# thing:
39-# default: 🎁
40-# description: A thing used by the charm.
41-# type: string
42+options:
43+ thing:
44+ default: 🎁
45+ description: A thing used by the charm.
46+ type: string
47diff --git a/manifest.yaml b/manifest.yaml
48new file mode 100644
49index 0000000..0967ef4
50--- /dev/null
51+++ b/manifest.yaml
52@@ -0,0 +1 @@
53+{}
54diff --git a/metadata.yaml b/metadata.yaml
55index 6d44a76..6b4c014 100644
56--- a/metadata.yaml
57+++ b/metadata.yaml
58@@ -1,10 +1,23 @@
59 # Copyright 2021 Tom Haddon
60 # See LICENSE file for licensing details.
61-name: charm-k8s-ingress
62+name: k8s-ingress
63 description: |
64- TODO: fill out the charm's description
65+ An operator to configure a kubernetes ingress.
66 summary: |
67- TODO: fill out the charm's summary
68-series: [kubernetes]
69+ An operator to configure a kubernetes ingress.
70+min-juju-version: 2.9.0
71+platforms:
72+ - kubernetes
73+systems:
74+ - os: ubuntu
75+ channel: 20.04/stable
76
77+containers:
78+ placeholder:
79+ systems:
80+ - resource: placeholder-image
81
82+resources:
83+ placeholder-image:
84+ type: oci-image
85+ description: A placeholder image, operator code won't do anything with it.
86diff --git a/src/charm.py b/src/charm.py
87index 84bf9c9..ced295f 100755
88--- a/src/charm.py
89+++ b/src/charm.py
90@@ -14,6 +14,7 @@ import logging
91
92 from ops.charm import CharmBase
93 from ops.main import main
94+from ops.model import ActiveStatus
95 from ops.framework import StoredState
96
97 logger = logging.getLogger(__name__)
98@@ -27,7 +28,6 @@ class CharmK8SIngressCharm(CharmBase):
99 def __init__(self, *args):
100 super().__init__(*args)
101 self.framework.observe(self.on.config_changed, self._on_config_changed)
102- self.framework.observe(self.on.fortune_action, self._on_fortune_action)
103 self._stored.set_default(things=[])
104
105 def _on_config_changed(self, _):
106@@ -37,15 +37,7 @@ class CharmK8SIngressCharm(CharmBase):
107 if current not in self._stored.things:
108 logger.debug("found a new thing: %r", current)
109 self._stored.things.append(current)
110-
111- def _on_fortune_action(self, event):
112- # Note: you need to uncomment the example in the actions.yaml file for this to work (ensure
113- # to not just leave the example, but adapt to your needs for actions commands)
114- fail = event.params["fail"]
115- if fail:
116- event.fail(fail)
117- else:
118- event.set_results({"fortune": "A bug in the code is worth two in the documentation."})
119+ self.unit.status = ActiveStatus()
120
121
122 if __name__ == "__main__":

Subscribers

People subscribed via source and target branches

to all changes: