utils

package
v0.41.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanPCVersion

func CleanPCVersion(version string) string

CleanPCVersion normalizes a Prism Central version string by trimming whitespace, lower-casing it, and removing the optional "pc." prefix.

func ComparePCVersions

func ComparePCVersions(v1, v2 string) int

ComparePCVersions compares PC version numbers of the format '2024.2.0.1', '7.3', etc. Returns 0 : if ver1 == ver2 Returns 1 : if ver1 > ver2 Returns -1: if ver1 < ver2

If either version is not in the correct format, they will be the greater, unless neither can be parsed in which case they are equal. The case where a branch can't be parsed is if the cluster is running master, or some other non-release branch. This is only expected in a test/debug situation and is the motivation for making an unparseable format greater.

func CompareVersions

func CompareVersions(v1, v2 string) int

CompareVersions compares version numbers of the format '3.5.2.1'. Returns 0 : if v1 == v2 Returns 1 : if v1 > v2 Returns -1: if v1 < v2

If either version is not in the correct format, they will be the greater, unless neither can be parsed in which case they are equal. The case where a branch can't be parsed is if the cluster is running master, or some other non-release branch, or empty string. This is only expected in a test/debug situation and is the motivation for making an unparseable format greater.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL