Skip to content

Commit

Permalink
added storageclass
Browse files Browse the repository at this point in the history
  • Loading branch information
ycliuhw committed Dec 13, 2018
1 parent 376c603 commit 3ae8bff
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion acceptancetests/assess_caas_deploy_charms.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
log = logging.getLogger("assess_caas_charm_deployment")

JUJU_STORAGECLASS_NAME = "juju-storageclass"
JUJU_STORAGECLASS_TEMPLATE = """
JUJU_PV_TEMPLATE = """
kind: PersistentVolume
apiVersion: v1
metadata:
Expand All @@ -54,6 +54,19 @@
path: "/mnt/data/{model}"
"""

JUJU_STORAGECLASS_TEMPLATE = """
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
namespace: {model}
name: {class_name}
annotations:
storageclass.kubernetes.io/is-default-class: "true"
labels:
addonmanager.kubernetes.io/mode: EnsureExists
provisioner: kubernetes.io/host-path
"""


def check_app_healthy(url, timeout=300):
status_code = None
Expand Down Expand Up @@ -89,6 +102,7 @@ def assess_caas_charm_deployment(client):

# ensure storage class
caas_client.kubectl_apply(JUJU_STORAGECLASS_TEMPLATE.format(model=model_name, class_name=JUJU_STORAGECLASS_NAME))
caas_client.kubectl_apply(JUJU_PV_TEMPLATE.format(model=model_name, class_name=JUJU_STORAGECLASS_NAME))

# ensure tmp dir for storage class.model_name
o = subprocess.check_output(
Expand Down

0 comments on commit 3ae8bff

Please sign in to comment.