Skip to content

Commit

Permalink
Merge pull request #10 from swimlane/disable-swimlane-tasks
Browse files Browse the repository at this point in the history
Disable swimlane-tasks for 23.4
  • Loading branch information
bagel-dawg authored Nov 29, 2023
2 parents 2fcc132 + b4beb09 commit 6d860ab
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tenant_operator/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def create_fn(spec, **kwargs):

t_pdb = kubernetes_templates.pdb_template( tenant_id, account_id, namespace )
t_secret = kubernetes_templates.secret_template( tenant_id, account_id, namespace )
t_tasks = kubernetes_templates.deployment_template( "/templates/swimlane-tasks-deployment.yaml", tenant_id, account_id, namespace, spec.get("tasksReplicas") )

# swimlane-tasks was removed in 23.4
# t_tasks = kubernetes_templates.deployment_template( "/templates/swimlane-tasks-deployment.yaml", tenant_id, account_id, namespace, spec.get("tasksReplicas") )
t_agent = kubernetes_templates.deployment_template( "/templates/turbine-agent-deployment.yaml" , tenant_id, account_id, namespace, spec.get("agentReplicas") )
t_engine = kubernetes_templates.deployment_template( "/templates/turbine-engine-deployment.yaml", tenant_id, account_id, namespace, spec.get("engineReplicas") )

Expand Down Expand Up @@ -70,14 +72,14 @@ def create_fn(spec, **kwargs):
else:
raise kopf.TemporaryError(e)

try:
kapi.read_namespaced_deployment(name=t_tasks["metadata"]["name"], namespace=namespace)
kapi.replace_namespaced_deployment(name=t_tasks["metadata"]["name"], namespace=namespace, body=t_tasks)
except ApiException as e:
if e.status == 404:
kapi.create_namespaced_deployment(namespace=namespace, body=t_tasks)
else:
raise kopf.TemporaryError(e)
# try:
# kapi.read_namespaced_deployment(name=t_tasks["metadata"]["name"], namespace=namespace)
# kapi.replace_namespaced_deployment(name=t_tasks["metadata"]["name"], namespace=namespace, body=t_tasks)
# except ApiException as e:
# if e.status == 404:
# kapi.create_namespaced_deployment(namespace=namespace, body=t_tasks)
# else:
# raise kopf.TemporaryError(e)

try:
kapi.read_namespaced_deployment(name=t_agent["metadata"]["name"], namespace=namespace)
Expand All @@ -100,7 +102,7 @@ def create_fn(spec, **kwargs):
return {
'tenantNamespace': namespace,
'deployments': {
"tasks": t_tasks["metadata"]["name"],
# "tasks": t_tasks["metadata"]["name"],
"agent": t_agent["metadata"]["name"],
"engine": t_engine["metadata"]["name"]
},
Expand Down Expand Up @@ -128,4 +130,4 @@ def delete_fn(spec, meta, **kwargs):
pass
else:
raise kopf.TemporaryError(e)
return {}
return {}

0 comments on commit 6d860ab

Please sign in to comment.