Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Updating rolling updater selector. #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pykube/rolling_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def update(self):
self.old_rc.name
))
new_labels = self.new_rc.obj["spec"]["template"]["metadata"]["labels"]
if new_selector != new_labels:
new_labels_set = set((x, new_labels[x]) for x in new_labels)
new_selector_set = set((x, new_selector[x]) for x in new_selector)
if not new_selector_set <= new_labels_set:
raise KubernetesError(
"The ReplicationController {} is invalid. spec.template.metadata.labels: Invalid value: {}: `selector` does not match template `labels` {}".format(
self.new_rc.name,
Expand Down