Skip to content

Commit

Permalink
Do not merge values from replication controller selector with labels …
Browse files Browse the repository at this point in the history
…if labels are configured
  • Loading branch information
pdecat committed Nov 10, 2018
1 parent 94c584a commit fff421c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions kubernetes/structures_replication_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,9 @@ func expandReplicationControllerTemplate(rct []interface{}, selector map[string]
// Get user defined metadata
metadata := expandMetadata(in["metadata"].([]interface{}))

// Add or merge labels from selector to ensure proper selection of pods by the replication controller
// Add labels from selector to ensure proper selection of pods by the replication controller for deprecated use case
if metadata.Labels == nil {
metadata.Labels = selector
} else {
for k, v := range selector {
metadata.Labels[k] = v
}
}
obj.ObjectMeta = metadata

Expand Down

0 comments on commit fff421c

Please sign in to comment.