def modify_labels(self, body, update_labels):
    """
      Modifies labels and deployment selectors as required by the schema
    """
    for label_modifier in self.schema.get("labels", []):

      # handle the service selector lookup
      spec = label_modifier.get("service")
      if spec is not None:
        try:
          # get the service we're after
          service = self.k8s_inventory.k8s_client.get_service(
            name=spec.get("name"),
            namespace=spec.get("namespace"),
          )
          # reset the existing labels
          update_labels()
          # update with the selectors from the service
          update_labels(**service.spec.selector)
        except:
          return False

      # handle the static label modifications
      spec = label_modifier.get("label")
      if spec is not None:
        updates = dict()
        updates[spec.get("key")] = spec.get("value")
        update_labels(**updates)

    return body

      Modifies labels and deployment selectors as required by the schema
    
powerfulseal/policy/action_clone.py