Skip to content

Commit

Permalink
fix: service missing erda component labels (#87)
Browse files Browse the repository at this point in the history
Signed-off-by: iutx <[email protected]>

Signed-off-by: iutx <[email protected]>
  • Loading branch information
iutx authored Dec 20, 2022
1 parent 2cd664e commit 5a8d77d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkg/cluster/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,23 @@ func buildService(
})
}

labels := map[string]string{
"dice/component": dicesvcname,
"dice/koperator": "true",
"dice/cluster-name": clus.Name,
}
selectorLabels := labels

return &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: convertServiceName(dicesvcname),
Namespace: clus.Namespace,
OwnerReferences: ownerRefs,
Labels: labels,
},
Spec: corev1.ServiceSpec{
Selector: map[string]string{
"dice/component": dicesvcname,
"dice/koperator": "true",
"dice/cluster-name": clus.Name,
},
Ports: ports,
Selector: selectorLabels,
Ports: ports,
},
}
}
Expand Down

0 comments on commit 5a8d77d

Please sign in to comment.