diff --git a/pykube/rolling_updater.py b/pykube/rolling_updater.py index 170d52f..6df060e 100644 --- a/pykube/rolling_updater.py +++ b/pykube/rolling_updater.py @@ -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,