2 # Copyright (c) 2017 GigaSpaces Technologies Ltd. All rights reserved
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # * See the License for the specific language governing permissions and
14 # * limitations under the License.
17 from cloudify import ctx
18 from cloudify.decorators import operation
20 from common import constants
21 from common import helm
22 from common import init_pod, namespace
26 def create_init_pod(**kwargs):
27 init_pod.do_create_init_pod()
32 def create_namespace(**kwargs):
33 namespace.do_create_namespace()
37 def delete_init_pod(**kwargs):
38 init_pod.do_delete_init_pod()
42 def delete_namespace(**kwargs):
43 namespace.do_delete_namespace()
47 def setup_helm_templates(**kwargs):
48 helm_url = constants.HELM_URL
49 ctx.instance.runtime_properties[constants.RT_HELM_CLI_PATH] = helm.get_helm_path(helm_url)
50 ctx.logger.debug('Helm cli path = {}'.format(ctx.instance.runtime_properties[constants.RT_HELM_CLI_PATH]))
52 oom_git_url = constants.OOM_GIT_URL
53 ctx.instance.runtime_properties[constants.RT_APPS_ROOT_PATH] = helm.get_apps_root_path(oom_git_url)
54 ctx.logger.debug('Apps root path = {}'.format(ctx.instance.runtime_properties[constants.RT_APPS_ROOT_PATH]))