IsPrimary check if a certain resource belongs to a primary
(meta metav1.ObjectMeta)
| 52 | |
| 53 | // IsPrimary check if a certain resource belongs to a primary |
| 54 | func IsPrimary(meta metav1.ObjectMeta) bool { |
| 55 | role, hasRole := utils.GetInstanceRole(meta.Labels) |
| 56 | if !hasRole { |
| 57 | return false |
| 58 | } |
| 59 | |
| 60 | return role == ClusterRoleLabelPrimary |
| 61 | } |
| 62 | |
| 63 | // IsPodStandby check if a certain pod belongs to a standby |
| 64 | func IsPodStandby(pod corev1.Pod) bool { |
no test coverage detected