Skip to content

Commit 9593122

Browse files
Merge pull request #868 from cderici/kubernetes-series-version-2.9
[JUJU-3886] Kubernetes series version
2 parents 1992aea + fc2f39c commit 9593122

4 files changed

Lines changed: 35 additions & 3 deletions

File tree

juju/utils.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,18 @@ def get_local_charm_charmcraft_yaml(path):
316316
KINETIC: "22.10",
317317
}
318318

319+
KUBERNETES = "kubernetes"
320+
KUBERNETES_SERIES = {
321+
KUBERNETES: "kubernetes"
322+
}
323+
324+
ALL_SERIES_VERSIONS = {**UBUNTU_SERIES, **KUBERNETES_SERIES}
325+
319326

320327
def get_series_version(series_name):
321-
if series_name not in UBUNTU_SERIES:
328+
if series_name not in ALL_SERIES_VERSIONS:
322329
raise errors.JujuError("Unknown series : %s", series_name)
323-
return UBUNTU_SERIES[series_name]
330+
return ALL_SERIES_VERSIONS[series_name]
324331

325332

326333
def get_version_series(version):
@@ -349,7 +356,10 @@ def get_local_charm_base(series, charm_path, base_class):
349356
# we currently only support ubuntu series (statically)
350357
# TODO (cderici) : go juju/core/series/supported.go and get the
351358
# others here too
352-
os_name_for_base = 'ubuntu'
359+
if series in KUBERNETES_SERIES:
360+
os_name_for_base = 'kubernetes'
361+
else:
362+
os_name_for_base = 'ubuntu'
353363

354364
# Check the charm manifest
355365
if channel_for_base == '':
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)