ceph: add 'ceph_daemon_type' label to pod labels

This can help users identify the daemon type similarly to how
'ceph_daemon_id' helps identify the daemon ID. This also makes it so
scripts users create don't have to parse "app=rook-ceph-<daemonType>"
into "<daemonType>" if they desire that bit of info.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
This commit is contained in:
Blaine Gardner committed 2020-07-30 11:16:22 -06:00
1 parent fd57eff0f8
commit 9b6114c192
1 file changed
+1
+1
View File
@@ -312,6 +312,7 @@ func AppLabels(appName, namespace string) map[string]string {
// Daemon ID is the ID portion of the Ceph daemon name: "a" for "mon.a"; "c" for "mds.c"
func PodLabels(appName, namespace, daemonType, daemonID string) map[string]string {
labels := AppLabels(appName, namespace)
labels["ceph_daemon_type"] = daemonType
labels["ceph_daemon_id"] = daemonID
// Also report the daemon id keyed by its daemon type: "mon: a", "mds: c", etc.
labels[daemonType] = daemonID