MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / Version

Function Version

tests/utils/operator/operator.go:300–312  ·  view source on GitHub ↗

Version returns the current operator version

(namespace, podName string)

Source from the content-addressed store, hash-verified

298
299// Version returns the current operator version
300func 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
315func Architectures(operatorPod *corev1.Pod) ([]string, error) {

Callers

nothing calls this directly

Calls 1

UncheckedFunction · 0.92

Tested by

no test coverage detected