scheme

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Scheme defines methods for serializing and deserializing API objects.
	Scheme = runtime.NewScheme()
	// Codecs provides methods for retrieving codecs and serializers for specific
	// versions and content types.
	Codecs = serializer.NewCodecFactory(Scheme)
	// Encoder provides json encoder
	Encoder = json.NewSerializerWithOptions(
		json.DefaultMetaFactory, Scheme, Scheme,
		json.SerializerOptions{Yaml: false, Pretty: false, Strict: false},
	)
)

Functions

This section is empty.

Types

type ListResult

type ListResult struct {
	Items      []interface{} `json:"items"`
	TotalItems int           `json:"totalItems"`
}

type MetaAddonManifest added in v1.2.0

type MetaAddonManifest struct {
	Name     string   `json:"name"`
	Type     string   `json:"type"`
	Versions []string `json:"versions"` // the currently supported component version of kc
}

type MetaChart

type MetaChart struct {
	Name           string                    `json:"name"`            // k8s
	MinorVersion   string                    `json:"minor_version"`   // kubernetes minor version, for example: v1.23 v.24
	VersionControl []MetaChartVersionControl `json:"version_control"` // the current kubernetes`s addons version control chart
}

type MetaChartVersionControl

type MetaChartVersionControl struct {
	Name             string `json:"name"`
	Type             string `json:"type"`              // cni csi cri
	RecommendVersion string `json:"recommend_version"` // for some addons, the recommended version is used when no version is specified
	MinVersion       string `json:"min_version"`       // kubernetes minor version the minimum installed version of this addon allowed
	MaxVersion       string `json:"max_version"`       // kubernetes minor version the maximum installed version of this addon allowed
}

type MetaKcVersion added in v1.2.0

type MetaKcVersion struct {
	Version        string              `json:"version"`         // kc release tag
	LatestVersion  string              `json:"latest_version"`  // kc last latest tag, for the debug
	Charts         []MetaChart         `json:"charts"`          // kubernetes addons version control chart
	AddonManifests []MetaAddonManifest `json:"addon_manifests"` // a list of all addons versions currently supported by kc
}

func (MetaKcVersion) CheckAddonVersion added in v1.2.0

func (kv MetaKcVersion) CheckAddonVersion(k8sVersion, name, version string, vc []MetaChartVersionControl) (bool, bool)

CheckAddonVersion check whether the component is valid and default 1. `RecommendVersion` value indicates the default version of the control addon 2. `MinVersion\MaxVersion` value controls the valid range of the addon 3. `MetaAddonManifest.Versions` value controls addon versions currently supported by kc 4. The intersection of `MinVersion\MaxVersion` and `MetaAddonManifest.Versions` is the final effective version

func (MetaKcVersion) FindAddonTypes added in v1.2.0

func (kv MetaKcVersion) FindAddonTypes(k8sVersion string) []string

func (MetaKcVersion) FindK8sMatchCniVersion added in v1.2.0

func (kv MetaKcVersion) FindK8sMatchCniVersion(k8sVersion, cniName string) string

func (MetaKcVersion) FindK8sVersionControl added in v1.2.0

func (kv MetaKcVersion) FindK8sVersionControl(k8sVersion string) MetaChart

func (MetaKcVersion) GetMetaAddonManifest added in v1.2.0

func (kv MetaKcVersion) GetMetaAddonManifest(name string) MetaAddonManifest

type MetaKcVersions added in v1.2.0

type MetaKcVersions []MetaKcVersion

MetaKcVersions kc versions involved in updating kc support addons will be recorded. Means that the recorded versions will not be consecutive release tags.

func (MetaKcVersions) Len added in v1.2.0

func (x MetaKcVersions) Len() int

func (MetaKcVersions) Less added in v1.2.0

func (x MetaKcVersions) Less(i, j int) bool

func (MetaKcVersions) Swap added in v1.2.0

func (x MetaKcVersions) Swap(i, j int)

type MetaResource

type MetaResource struct {
	Type    string `json:"type"` // addon type cni / csi / cri / app
	Name    string `json:"name"`
	Version string `json:"version"`
	Arch    string `json:"arch"` // amd64 / arm64
}

type PackageMetadata

type PackageMetadata struct {
	Addons     []MetaResource `json:"addons"`      // kubernetes addons
	KcVersions MetaKcVersions `json:"kc_versions"` // kc release tag record, only tags with addon version updates are recorded
}

func (*PackageMetadata) AddonsAppendOnly

func (m *PackageMetadata) AddonsAppendOnly(typeName, name, version, arch string)

func (*PackageMetadata) AddonsDelete

func (m *PackageMetadata) AddonsDelete(name, version, arch string) error

func (PackageMetadata) AddonsExist

func (m PackageMetadata) AddonsExist(name, version, arch string) bool

func (*PackageMetadata) AddonsSort

func (m *PackageMetadata) AddonsSort()

func (PackageMetadata) FindAddons added in v1.2.0

func (m PackageMetadata) FindAddons(typeName string) []MetaResource

func (PackageMetadata) GetK8sVersionControlRules added in v1.2.0

func (m PackageMetadata) GetK8sVersionControlRules(kcVersion string) []map[string]interface{}

GetK8sVersionControlRules get k8s version control rules data

func (PackageMetadata) GetPrecedingAndSucceedingKcVersion added in v1.2.0

func (m PackageMetadata) GetPrecedingAndSucceedingKcVersion(version string) (MetaKcVersion, MetaKcVersion)

func (PackageMetadata) MatchKcVersion added in v1.2.0

func (m PackageMetadata) MatchKcVersion(kcVersion string) MetaKcVersion

MatchKcVersion find the best version control for the incoming version

func (*PackageMetadata) ReadMetadata

func (m *PackageMetadata) ReadMetadata(online bool, path string) error

func (*PackageMetadata) WriteFile

func (m *PackageMetadata) WriteFile(path string, sort bool) error

Directories

Path Synopsis
v1
iam
v1

Jump to

Keyboard shortcuts

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