Move deploy_memcache to utils
Change-Id: I52eb33da08025834b73dcccbf4428afa31026b13
This commit is contained in:
parent
67e6c49f60
commit
46ba8104c9
@ -55,16 +55,6 @@ def operator_configmap(namespace, name, **_):
|
|||||||
and name == "operator-config"
|
and name == "operator-config"
|
||||||
|
|
||||||
|
|
||||||
async def deploy_memcached(item, **_):
|
|
||||||
"""
|
|
||||||
Deploy a generic instance of Memcached
|
|
||||||
|
|
||||||
This function deploys a generic instance of Memcached with sane defaults,
|
|
||||||
it's meant to be here to be consumed/called by the function below.
|
|
||||||
"""
|
|
||||||
utils.create_or_update('operator/memcached.yml.j2', name=item, adopt=True)
|
|
||||||
|
|
||||||
|
|
||||||
@kopf.on.resume('', 'v1', 'configmaps', when=operator_configmap)
|
@kopf.on.resume('', 'v1', 'configmaps', when=operator_configmap)
|
||||||
@kopf.on.create('', 'v1', 'configmaps', when=operator_configmap)
|
@kopf.on.create('', 'v1', 'configmaps', when=operator_configmap)
|
||||||
@kopf.on.update('', 'v1', 'configmaps', when=operator_configmap)
|
@kopf.on.update('', 'v1', 'configmaps', when=operator_configmap)
|
||||||
@ -85,7 +75,8 @@ async def deploy_memcacheds(body, **_):
|
|||||||
module = entry_point.load()
|
module = entry_point.load()
|
||||||
if hasattr(module, 'MEMCACHED') and module.MEMCACHED:
|
if hasattr(module, 'MEMCACHED') and module.MEMCACHED:
|
||||||
fns[entry_point.name] = \
|
fns[entry_point.name] = \
|
||||||
functools.partial(deploy_memcached, item=entry_point.name)
|
functools.partial(utils.deploy_memcached,
|
||||||
|
item=entry_point.name)
|
||||||
|
|
||||||
await kopf.execute(fns=fns)
|
await kopf.execute(fns=fns)
|
||||||
|
|
||||||
|
@ -285,3 +285,13 @@ def get_backup_schedule(name):
|
|||||||
if name not in BACKUP_SCHEDULE:
|
if name not in BACKUP_SCHEDULE:
|
||||||
return "0 0 * * * *"
|
return "0 0 * * * *"
|
||||||
return BACKUP_SCHEDULE[name]
|
return BACKUP_SCHEDULE[name]
|
||||||
|
|
||||||
|
|
||||||
|
async def deploy_memcached(item, **_):
|
||||||
|
"""
|
||||||
|
Deploy a generic instance of Memcached
|
||||||
|
|
||||||
|
This function deploys a generic instance of Memcached with sane defaults,
|
||||||
|
it's meant to be here to be consumed/called by the serices.
|
||||||
|
"""
|
||||||
|
create_or_update('operator/memcached.yml.j2', name=item, adopt=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user