Skip to content

Commit fc2f39c

Browse files
committed
Add example local charm to test and reproduce #865
Unfortunately we can't write an integration test that uses this because we run our tests on lxd so the charm will be deployed but will never actually get 'active'. We could test the deployment itself (that it doesn't error), but if we did that, the 3.0 will actually fail to deploy on lxd because the series is kubernetes so the test will be invalid anyways.
1 parent 6f80985 commit fc2f39c

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
options:
2+
status:
3+
type: string
4+
default: "active"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
status="$(config-get status)"
4+
5+
if [[ "$status" == "error" ]]; then
6+
if [[ -e .errored ]]; then
7+
status="active"
8+
else
9+
touch .errored
10+
exit 1
11+
fi
12+
fi
13+
status-set "$status"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: charm
2+
series: ["kubernetes"]
3+
summary: "test"
4+
description: "test"
5+
maintainers: ["test"]

0 commit comments

Comments
 (0)