Architectures returns all the supported operator architectures
(operatorPod *corev1.Pod)
| 313 | |
| 314 | // Architectures returns all the supported operator architectures |
| 315 | func Architectures(operatorPod *corev1.Pod) ([]string, error) { |
| 316 | out, _, err := run.Unchecked(fmt.Sprintf( |
| 317 | "kubectl -n %v exec %v -c manager -- /manager debug show-architectures", |
| 318 | operatorPod.Namespace, |
| 319 | operatorPod.Name, |
| 320 | )) |
| 321 | if err != nil { |
| 322 | return nil, err |
| 323 | } |
| 324 | |
| 325 | // `debug show-architectures` will print a JSON object |
| 326 | var res []string |
| 327 | err = json.Unmarshal([]byte(out), &res) |
| 328 | if err != nil { |
| 329 | return nil, err |
| 330 | } |
| 331 | |
| 332 | return res, err |
| 333 | } |
| 334 | |
| 335 | // GetLeaderInfoFromLease gathers leader holderIdentity from the lease |
| 336 | func GetLeaderInfoFromLease( |
no test coverage detected