versions

package
v1.44.0-0.dev Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CalicoRegistryConfigKey      = "CalicoRegistry"
	CalicoImagePathConfigKey     = "CalicoImagePath"
	EnterpriseRegistryConfigKey  = "TigeraRegistry"
	EnterpriseImagePathConfigKey = "TigeraImagePath"
	OperatorRegistryConfigKey    = "OperatorRegistry"
	OperatorImagePathConfigKey   = "OperatorImagePath"
)

Component image config key constants used as keys in ModifyComponentImageConfig.

View Source
const (

	// CalicoConfigPath is the repo-relative path to the Calico versions config file.
	CalicoConfigPath = configDir + "/calico_versions.yml"
	// EnterpriseConfigPath is the repo-relative path to the Enterprise versions config file.
	EnterpriseConfigPath = configDir + "/enterprise_versions.yml"

	// MakeTargetGenVersionsCalico is the make target to regenerate Calico versions.
	MakeTargetGenVersionsCalico = "gen-versions-calico"
	// MakeTargetGenVersionsEnterprise is the make target to regenerate Enterprise versions.
	MakeTargetGenVersionsEnterprise = "gen-versions-enterprise"
)

Variables

View Source
var ComponentImageConfigRelPath = "pkg/components/images.go"

ComponentImageConfigRelPath is the repo-relative path to the component image config file.

Functions

func ModifyComponentImageConfig

func ModifyComponentImageConfig(repoRootDir, imageConfigRelPath, configKey, newValue string) error

ModifyComponentImageConfig modifies variables in the specified component image config file.

func ReplaceConfigVersions

func ReplaceConfigVersions(rootDir, gitRef string) error

func UpdateCalicoComponents

func UpdateCalicoComponents(repoDir string, components map[string]string) error

UpdateCalicoComponents updates individual component versions in the Calico config file.

func UpdateCalicoConfigVersion

func UpdateCalicoConfigVersion(repoRootDir, version string) error

UpdateCalicoConfigVersion sets all component versions and the title in the Calico config file to version.

func UpdateEnterpriseComponents

func UpdateEnterpriseComponents(repoDir string, components map[string]string) error

UpdateEnterpriseComponents updates individual component versions in the Enterprise config file.

func UpdateEnterpriseConfigVersion

func UpdateEnterpriseConfigVersion(repoRootDir, version string) error

UpdateEnterpriseConfigVersion sets all component versions and the title in the Enterprise config file to version.

Types

type CalicoVersion

type CalicoVersion struct {
	Title      string               `yaml:"title"`
	Components map[string]Component `yaml:"components"`
}

CalicoVersion represents a config/calico_versions.yml or enterprise_versions.yml.

func CalicoConfigVersions

func CalicoConfigVersions(repoDir string) (*CalicoVersion, error)

CalicoConfigVersions reads the CalicoVersion from the local Calico config file.

func EnterpriseConfigVersions

func EnterpriseConfigVersions(repoDir string) (*CalicoVersion, error)

EnterpriseConfigVersions reads the CalicoVersion from the local Enterprise config file.

func GitRefConfigCalicoVersion

func GitRefConfigCalicoVersion(gitRef string) (*CalicoVersion, error)

func GitRefConfigEnterpriseVersion

func GitRefConfigEnterpriseVersion(gitRef string) (*CalicoVersion, error)

func ParseConfigVersions

func ParseConfigVersions(content []byte) (*CalicoVersion, error)

ParseConfigVersions parses a versions YAML file content.

type Component

type Component struct {
	Version string `yaml:"version"`
	Image   string `yaml:"image,omitempty"`
}

Component represents a versioned component in a versions YAML file.

type VersionConfig

type VersionConfig struct {
	Dir      string
	Version  string
	Registry string
}

VersionConfig holds version, registry, and optional local CRD directory for one product.

type Versions

type Versions struct {
	Calico     string
	Enterprise string
}

Versions holds the Calico and Enterprise release version strings.

func ConfigVersions

func ConfigVersions(repoDir string) (Versions, error)

ConfigVersions reads the current Calico and Enterprise title versions from their config files.

func GitRefConfigVersions

func GitRefConfigVersions(gitRef string) (Versions, error)

GitRefConfigVersions reads Calico and Enterprise title versions from the given git ref.

func (Versions) ToMap

func (v Versions) ToMap() map[string]string

ToMap returns a human-readable map of non-empty version strings keyed by product name.

type VersionsConfig

type VersionsConfig struct {
	RepoRootDir string
	Calico      VersionConfig
	Enterprise  VersionConfig
}

VersionsConfig holds configuration for generating both Calico and Enterprise versions.

func (*VersionsConfig) Generate

func (vc *VersionsConfig) Generate() error

Generate updates the version config files and runs the appropriate make targets to regenerate derived files for the configured products.

Jump to

Keyboard shortcuts

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