Skip to content

Commit

Permalink
Merge pull request #34993 from kinarashah/rc8
Browse files Browse the repository at this point in the history
add WorkloadID selector only if service is created by norman
  • Loading branch information
kinarashah committed Sep 30, 2021
2 parents 5dd546e + bb18ed1 commit 8fece92
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (

const (
WorkloadIDLabelPrefix = "workloadID"
creatorLabelKey = "cattle.io/creator"
creatorNorman = "norman"
)

var workloadServiceUUIDToWorkloadIDs sync.Map
Expand Down Expand Up @@ -74,6 +76,11 @@ func (c *Controller) sync(key string, obj *corev1.Service) (runtime.Object, erro
return nil, nil
}

// add WorkloadID selector only if service is created by norman
if obj.Labels == nil || obj.Labels[creatorLabelKey] != creatorNorman {
return obj, nil
}

workloadIDs := getServiceWorkloadIDs(obj)
// update pods (if needed) with service selector labels
targetWorkloadIDs, err := c.reconcilePods(key, obj, workloadIDs)
Expand Down

0 comments on commit 8fece92

Please sign in to comment.