Documentation
¶
Index ¶
- func Detect(ctx context.Context, c client.Reader) (*semver.Version, error)
- func DetectFromDSCInitialization(ctx context.Context, c client.Reader) (string, bool, error)
- func DetectFromDataScienceCluster(ctx context.Context, c client.Reader) (string, bool, error)
- func DetectFromOLM(ctx context.Context, c client.Reader) (string, bool, error)
- func DetectOpenShiftVersion(ctx context.Context, k8sClient client.Reader) (*semver.Version, error)
- func IsUpgradeFrom2xTo3x(from *semver.Version, to *semver.Version) bool
- func IsVersionAtLeast(version *semver.Version, major uint64, minor uint64) bool
- func VersionToBranch(version string) (string, error)
- type ClusterVersion
- type VersionConfidence
- type VersionSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Detect ¶
Detect performs priority-based version detection from multiple sources Priority order: DataScienceCluster > DSCInitialization > OLM Returns parsed semver.TargetVersion or error if version cannot be determined from any source.
func DetectFromDSCInitialization ¶
DetectFromDSCInitialization attempts to detect version from DSCInitialization resource Returns version string and true if found, empty string and false otherwise.
func DetectFromDataScienceCluster ¶
DetectFromDataScienceCluster attempts to detect version from DataScienceCluster resource Returns version string and true if found, empty string and false otherwise.
func DetectFromOLM ¶
DetectFromOLM attempts to detect version from OLM ClusterServiceVersion Returns version string and true if found, empty string and false otherwise.
func DetectOpenShiftVersion ¶ added in v0.0.11
func DetectOpenShiftVersion( ctx context.Context, k8sClient client.Reader, ) (*semver.Version, error)
DetectOpenShiftVersion queries the OpenShift ClusterVersion resource to determine the cluster version.
func IsUpgradeFrom2xTo3x ¶ added in v0.0.9
IsUpgradeFrom2xTo3x checks if the versions represent an upgrade from 2.x to 3.x specifically. Future major versions (4.x+) may have different compatibility requirements. Returns false if either version is nil.
func IsVersionAtLeast ¶ added in v0.0.9
IsVersionAtLeast checks if the given version is at least the specified major.minor version. Patch version is ignored in the comparison. Returns false if version is nil.
func VersionToBranch ¶
VersionToBranch maps a version string to the corresponding Git branch TargetVersion format: X.Y.Z Branch mapping:
- 2.x.x → stable-2.x
- 3.x.x → main
- Unknown → ""
Types ¶
type ClusterVersion ¶
type ClusterVersion struct {
// Version is the semver version string (e.g., "2.17.0")
Version string
// Source indicates where the version was detected from
Source VersionSource
// Confidence indicates the reliability of the detection
Confidence VersionConfidence
// Branch is the corresponding Git branch for this version (e.g., "stable-2.17")
Branch string
}
ClusterVersion represents detected OpenShift AI cluster version.
func (*ClusterVersion) String ¶
func (v *ClusterVersion) String() string
String returns a human-readable representation of the cluster version.
type VersionConfidence ¶
type VersionConfidence string
VersionConfidence indicates the reliability of the version detection.
const ( ConfidenceHigh VersionConfidence = "High" // From DataScienceCluster or DSCInitialization ConfidenceMedium VersionConfidence = "Medium" // From OLM ClusterServiceVersion ConfidenceLow VersionConfidence = "Low" // Fallback or uncertain )
func (VersionConfidence) String ¶
func (c VersionConfidence) String() string
String returns the string representation of the confidence level.
type VersionSource ¶
type VersionSource string
VersionSource indicates where the version information was obtained.
const ( SourceDataScienceCluster VersionSource = "DataScienceCluster" SourceDSCInitialization VersionSource = "DSCInitialization" SourceOLM VersionSource = "OLM" SourceManual VersionSource = "Manual" // User-specified target version SourceUnknown VersionSource = "Unknown" )
func (VersionSource) String ¶
func (s VersionSource) String() string
String returns the string representation of the version source.