Version returns the current operator version
(namespace, podName string)
| 298 | |
| 299 | // Version returns the current operator version |
| 300 | func Version(namespace, podName string) (string, error) { |
| 301 | out, _, err := run.Unchecked(fmt.Sprintf( |
| 302 | "kubectl -n %v exec %v -c manager -- /manager version", |
| 303 | namespace, |
| 304 | podName, |
| 305 | )) |
| 306 | if err != nil { |
| 307 | return "", err |
| 308 | } |
| 309 | versionRegexp := regexp.MustCompile(`^Build: {Version:(\d+.*) Commit.*}$`) |
| 310 | ver := versionRegexp.FindStringSubmatch(strings.TrimSpace(out))[1] |
| 311 | return ver, nil |
| 312 | } |
| 313 | |
| 314 | // Architectures returns all the supported operator architectures |
| 315 | func Architectures(operatorPod *corev1.Pod) ([]string, error) { |
nothing calls this directly
no test coverage detected