Golang

kind: golang

sourceconditiontarget

source

The Golang "source" retrieves the Golang version matching then versioning rule.

condition

The Golang "condition" checks if the Golang version matching then versioning rule exist.

target

the Golang "target" is not supported.

Parameter

NameTypeDescriptionRequired
ageobject

age defines the minimum or maximum age of a release to be considered valid. It accepts a duration string (e.g., “24h”, “7d”).

Compatible:

  • source
  • condition

Remarks: If age is specified, the Updatecli retrieves the release date of each Golang version from a git repository. This has significant performance implications, as it requires fetching git tags and their associated commit dates. Use wisely.

    maximumstringMaximum defines the maximum age of a release to be considered valid. It accepts a duration string (e.g., “24h”, “7d”, “3w”, “1y”). Accepted time units are “h” for hours, “d” for days, “w” for weeks, “mo” for months, and “y” for years. If no unit is provided, hours are assumed.
    minimumstringMinimum defines the minimum age of a release to be considered valid. It accepts a duration string (e.g., “24h”, “7d”, “3w”, “1y”). Accepted time units are “h” for hours, “d” for days, “w” for weeks, “mo” for months, and “y” for years. If no unit is provided, hours are assumed.
versionstring

Version defines a specific golang version

Compatible:

  • condition
versionfilterobject

versionfilter provides parameters to specify version pattern and its type like regex, semver, or just latest.

Compatible:

  • source
    kindstringspecifies the version kind such as semver, regex, or latest
    patternstringspecifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format
    regexstringspecifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used.
    replaceallobjectreplaceAll applies a regex replacement to version strings before filtering. This is useful for transforming versions (e.g., curl-8_15_0 to curl-8.15.0) before regex extraction.
    strictbooleanstrict enforce strict versioning rule. Only used for semantic versioning at this time

Example

# updatecli.yaml
name: "Golang example"

sources:
  default:
    name: Get Golang version
    kind: golang
    spec:
      versionfilter:
        kind: semver
        pattern: "1.15.x"

conditions:
  # The version to check is inherited from source "default"
  default:
    name: Checks that golang version from source default exists
    kind: golang
    sourceid: default

  nosourceinput:
    disablesourceinput: true
    name: Checks that golang version 1.20.1 exists
    kind: golang
    spec:
      version: "1.20.1"
Top