version

package
v1.74.13 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker validates version constraints using semantic versioning. Always acts as a blocker - packages cannot be enabled if version requirements aren't met.

func NewChecker

func NewChecker(getter Getter, constraints *semver.Constraints, reason string) *Checker

NewChecker creates a new version checker with the given getter and constraints.

Example constraints:

  • ">=1.21" - Minimum version 1.21
  • ">=1.21, <2.0" - Range from 1.21 to 2.0
  • "~1.21" - Patch releases of 1.21
  • "^1.21" - Minor releases of 1.x

func (*Checker) Check

func (c *Checker) Check() checker.Result

Check retrieves the current version and validates it against constraints. Returns disabled if:

  • Version getter fails (network error, API error, etc.)
  • Version doesn't satisfy constraints

type Getter

type Getter func() (*semver.Version, error)

Getter retrieves the current version from the system. Examples:

  • Kubernetes version from API server
  • Deckhouse version from deployment
  • Module version from registry

Jump to

Keyboard shortcuts

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