Skip to content

Commit 6f80985

Browse files
committed
Add kubernetes as supported series as per juju/core/series/supported.go
Fixes #865
1 parent 1992aea commit 6f80985

1 file changed

Lines changed: 13 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 == '':

0 commit comments

Comments
 (0)