clusterstack

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package clusterstack has necessary function to work on cluster stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BumpVersion

func BumpVersion(version string) (string, error)

BumpVersion bumps the version of the cluster stacks component.

func GetClusterStackReleaseDirectoryName

func GetClusterStackReleaseDirectoryName(metadata *MetaData, config *CsctlConfig) (string, error)

GetClusterStackReleaseDirectoryName returns cluster stack release directory. e.g. - docker-ferrol-1-27-v1/ .

func GetClusterStackReleaseName added in v0.0.4

func GetClusterStackReleaseName(metada *MetaData, config *CsctlConfig) (string, error)

GetClusterStackReleaseName return the cluster stack release name. e.g. - docker-ferrol-1-27-v0-sha.uxumi7s .

Types

type Component

type Component struct {
	ClusterAddon string `yaml:"clusterAddon"`
	NodeImage    string `yaml:"nodeImage,omitempty"`
}

Component contains component.

type CsctlConfig

type CsctlConfig struct {
	APIVersion string `yaml:"apiVersion"`
	Config     struct {
		KubernetesVersion string `yaml:"kubernetesVersion"`
		ClusterStackName  string `yaml:"clusterStackName"`
		Provider          struct {
			Type       string                 `yaml:"type"`
			APIVersion string                 `yaml:"apiVersion"`
			Config     map[string]interface{} `yaml:"config"`
		} `yaml:"provider"`
	} `yaml:"config"`
}

CsctlConfig contains information of CsctlConfig yaml.

func GetCsctlConfig

func GetCsctlConfig(path string) (*CsctlConfig, error)

GetCsctlConfig returns CsctlConfig.

func (*CsctlConfig) ParseKubernetesVersion

func (c *CsctlConfig) ParseKubernetesVersion() (kubernetesversion.KubernetesVersion, error)

ParseKubernetesVersion parse the kubernetes version present in the Csctl Config.

type MetaData

type MetaData struct {
	APIVersion string   `yaml:"apiVersion"`
	Versions   Versions `yaml:"versions"`
}

MetaData contains metadata.

func HandleCustomMode

func HandleCustomMode(kubernetesVersion, clusterStackVersion, clusterAddonVersion, nodeImageVersion string) (*MetaData, error)

HandleCustomMode handles custom mode with version for all components.

func HandleHashMode

func HandleHashMode(currentRelease hash.ReleaseHash, kubernetesVersion string) *MetaData

HandleHashMode handles the hash mode with the cluster stack hash.

func HandleStableMode

func HandleStableMode(gitHubReleasePath string, currentReleaseHash, latestReleaseHash hash.ReleaseHash) (*MetaData, error)

HandleStableMode returns metadata for the stable mode.

func ParseMetaData

func ParseMetaData(path string) (*MetaData, error)

ParseMetaData parse the metadata file.

type Versions

type Versions struct {
	ClusterStack string    `yaml:"clusterStack"`
	Kubernetes   string    `yaml:"kubernetes"`
	Components   Component `yaml:"components"`
}

Versions contains version information.

Jump to

Keyboard shortcuts

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