util

package
v1.9.23 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSoftErrorMode

func InitSoftErrorMode()

func IsSoftErrorOn

func IsSoftErrorOn() bool

func SetSoftErrorMode

func SetSoftErrorMode(newValue bool)

func SortUpstreamAppVersions added in v1.9.22

func SortUpstreamAppVersions(vA, vB string) bool

SortUpstreamAppVersions compares 2 Rancher chart version strings for Descending sort. Returns true if vA should come before vB (higher version first).

Version format: <upstream_version>+up<chart_version> Examples:

  • "109.0.1+up0.10.4-rc.1"
  • "109.0.1+up0.10.1"
  • "109.0.1"

Comparison logic:

  1. Split on "+up" delimiter into upstream and chart parts
  2. Compare upstream versions using semver (descending)
  3. If upstream equal, compare chart versions using semver (descending)
  4. Semver automatically handles prereleases (rc, alpha, beta) per spec
  5. Invalid semver versions pushed to end of sort order

Use with sort.Slice:

sort.Slice(versions, func(i, j int) bool {
    return util.SortUpstreamAppVersions(versions[i], versions[j])
})

Types

type SoftErrorMode

type SoftErrorMode struct {
	Enabled bool
}

SoftErrorMode allows for skipping certain non-fatal errors from breaking execution

Jump to

Keyboard shortcuts

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