Skip to content

Commit

Permalink
Merge pull request #51 from ocadotechnology/priority-class
Browse files Browse the repository at this point in the history
feat: add priorityClass to RegistryMirror
  • Loading branch information
gkaskonas authored Jul 23, 2020
2 parents df3c28b + d04b53b commit 09b7f3a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mirroroperator/registrymirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def __init__(self, event_type, namespace, hostess_docker_registry,

self.core_api = client.CoreV1Api()
self.apps_api = client.AppsV1Api()
self.priority_class = kwargs.get(
"spec", {}).get("priorityClass", "user-standard")

def apply(self):
if self.event_type != "DELETED":
Expand Down Expand Up @@ -229,7 +231,7 @@ def generate_daemon_set(self, daemon_set):
daemon_set.metadata.labels = ds_labels
daemon_set.spec = client.V1DaemonSetSpec(
min_ready_seconds=10,
selector=self.labels,
selector= {"matchLabels": self.labels},
template=client.V1PodTemplateSpec(
metadata=client.V1ObjectMeta(
labels=ds_pod_labels
Expand Down Expand Up @@ -389,7 +391,7 @@ def generate_stateful_set(self):
# we can't update service name or pod management policy
service_name=self.full_name + "-headless",
pod_management_policy="Parallel",
selector=self.labels,
selector= {"matchLabels": self.labels},
template=client.V1PodTemplateSpec(),
# we can't update volume claim templates
volume_claim_templates=[client.V1PersistentVolumeClaim(
Expand Down Expand Up @@ -563,6 +565,7 @@ def generate_stateful_set(self):
tolerations=self.ss_ds_tolerations,
termination_grace_period_seconds=10,
volumes=volumes,
priority_class_name=self.priority_class
)
)
stateful_set.spec.update_strategy = client.V1StatefulSetUpdateStrategy(type="RollingUpdate",)
Expand Down

0 comments on commit 09b7f3a

Please sign in to comment.