v1

package
v0.0.0-...-b25b198 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Overview

Package v1 defines some common types used in TKR.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterTkgVersionByTkr

func FilterTkgVersionByTkr(compatibility Compatibility, tkrName string) (version string, err error)

Types

type AMIInfo

type AMIInfo struct {
	ID string `yaml:"id"`
	OSInfo
	Metadata map[string]interface{} `yaml:"metadata,omitempty"`
}

AMIInfo defines information about an AMI shipped

type AMIInfos

type AMIInfos map[string][]AMIInfo

AMIInfos is a lookup of AMIInfo

type Addon

type Addon struct {
	Category             string               `yaml:"category,omitempty"`
	ClusterTypes         []string             `yaml:"clusterTypes,omitempty"`
	Version              string               `yaml:"version,omitempty"`
	TemplatesImagePath   string               `yaml:"templatesImagePath,omitempty"`
	TemplatesImageTag    string               `yaml:"templatesImageTag,omitempty"`
	AddonTemplatesImage  []ComponentReference `yaml:"addonTemplatesImage,omitempty"`
	AddonContainerImages []ComponentReference `yaml:"addonContainerImages,omitempty"`
	PackageName          string               `yaml:"packageName,omitempty"`
}

Addon contains addon info

type Addons

type Addons map[string]Addon

Addons represents map of Addons

type AzureInfo

type AzureInfo struct {
	Sku             string                 `yaml:"sku"`
	Publisher       string                 `yaml:"publisher"`
	Offer           string                 `yaml:"offer"`
	Version         string                 `yaml:"version"`
	ThirdPartyImage bool                   `yaml:"thirdPartyImage,omitempty"`
	Metadata        map[string]interface{} `yaml:"metadata,omitempty"`
	OSInfo
}

AzureInfo defines information about an Azure Image shipped

type AzureInfos

type AzureInfos []AzureInfo

AzureInfos is an array of AzureInfo

type Bom

type Bom struct {
	// contains filtered or unexported fields
}

Bom represents a BOM file

func NewBom

func NewBom(content []byte) (Bom, error)

NewBom creates a new Bom from raw data

func (*Bom) Addons

func (b *Bom) Addons() (Addons, error)

Addons gets all the addons in the BOM

func (*Bom) Components

func (b *Bom) Components() (map[string][]ComponentInfo, error)

Components gets all release components in the BOM file

func (*Bom) GetAMIInfo

func (b *Bom) GetAMIInfo() (map[string][]AMIInfo, error)

GetAMIInfo gets ami info

func (*Bom) GetAddon

func (b *Bom) GetAddon(name string) (Addon, error)

GetAddon gets an addon info from BOM

func (*Bom) GetAzureInfo

func (b *Bom) GetAzureInfo() ([]AzureInfo, error)

GetAzureInfo gets azure os image info

func (*Bom) GetCompatibility

func (b *Bom) GetCompatibility() string

func (*Bom) GetComponent

func (b *Bom) GetComponent(name string) ([]ComponentInfo, error)

GetComponent gets a release component

func (*Bom) GetImageInfo

func (b *Bom) GetImageInfo(componentName, componentVersion, imageName string) (ImageInfo, error)

GetImageInfo gets a image in a component of specific version. If version is "" or not found, get the image of the first version in the component array

func (*Bom) GetImageRepository

func (b *Bom) GetImageRepository() (string, error)

GetImageRepository gets the image repository

func (*Bom) GetOVAInfo

func (b *Bom) GetOVAInfo() ([]OVAInfo, error)

GetOVAInfo gets vsphere ova info

func (*Bom) GetReleaseVersion

func (b *Bom) GetReleaseVersion() (string, error)

GetReleaseVersion gets the Tanzu release version

type BomContent

type BomContent struct {
	Release       Release                    `yaml:"release"`
	Components    map[string][]ComponentInfo `yaml:"components"`
	ImageConfig   ImageConfig                `yaml:"imageConfig"`
	OVA           OVAInfos                   `yaml:"ova"`
	AMI           AMIInfos                   `yaml:"ami,omitempty"`
	Azure         AzureInfos                 `yaml:"azure,omitempty"`
	Addons        Addons                     `yaml:"addons,omitempty"`
	Compatibility ImagePathInfo              `yaml:"tkr-compatibility"`
}

BomContent contains the content of a BOM file

type Compatibility

type Compatibility struct {
	ManagementClusterVersions []ManagementClusterVersions `yaml:"managementClusterVersions"`
}

func NewCompatibility

func NewCompatibility(data []byte) (Compatibility, error)

type CompatibilityMetadata

type CompatibilityMetadata struct {
	ManagementClusterVersions []ManagementClusterVersion `json:"managementClusterVersions"`
}

CompatibilityMetadata contains tanzu release support matrix

type ComponentInfo

type ComponentInfo struct {
	Version string `yaml:"version"`
	// Each component can optionally have container images associated with it
	Images map[string]ImageInfo `yaml:"images,omitempty"`
	// Metadata section can be anything for the component
	Metadata map[string]string `yaml:"metadata,omitempty"`
}

ComponentInfo contains component information

type ComponentReference

type ComponentReference struct {
	ComponentRef string   `yaml:"componentRef"`
	ImageRefs    []string `yaml:"imageRefs"`
}

ComponentReference references the images in a component

type DNSAddOnType

type DNSAddOnType string

DNSAddOnType defines string identifying DNS add-on types

type ImageConfig

type ImageConfig struct {
	ImageRepository string `yaml:"imageRepository"`
}

ImageConfig contains the path of the image registry

type ImageInfo

type ImageInfo struct {
	ImagePath string `yaml:"imagePath"`
	Tag       string `yaml:"tag"`
}

ImageInfo contains the image information

type ImagePathInfo

type ImagePathInfo struct {
	ImagePath string `yaml:"imagePath"`
}

type ManagementClusterVersion

type ManagementClusterVersion struct {
	TKGVersion                  string   `json:"version"`
	SupportedKubernetesVersions []string `json:"supportedKubernetesVersions"`
}

ManagementClusterVersion contains kubernetes versions that are supported by the management cluster with a certain TKG version.

type ManagementClusterVersions

type ManagementClusterVersions struct {
	SupportedKubernetesVersions []string `yaml:"supportedKubernetesVersions"`
	Version                     string   `yaml:"version"`
}

type OSInfo

type OSInfo struct {
	Name    string `yaml:"name"`
	Version string `yaml:"version"`
	Arch    string `yaml:"arch"`
}

OSInfo contains the OS information

func (OSInfo) String

func (os OSInfo) String() string

String gets a string representation of the BOM

type OVAInfo

type OVAInfo struct {
	Name string `yaml:"name"`
	OSInfo
	Version  string                 `yaml:"version"`
	Metadata map[string]interface{} `yaml:"metadata,omitempty"`
}

OVAInfo gets the Open Virtual Appliance (OVA) information

type OVAInfos

type OVAInfos []OVAInfo

OVAInfos is an array of OVAInfo

type Release

type Release struct {
	Version string `yaml:"version"`
}

Release contains the release name.

type ReleaseInfo

type ReleaseInfo struct {
	Version string `yaml:"version"`
}

ReleaseInfo represents the release version information

type TkgBom

type TkgBom struct {
	// contains filtered or unexported fields
}

func NewTkgBom

func NewTkgBom(data []byte) (TkgBom, error)

func (*TkgBom) GetBomContent

func (b *TkgBom) GetBomContent() (TkgBomContent, error)

func (*TkgBom) GetTKRPackage

func (b *TkgBom) GetTKRPackage() (tkrPackage, error)

nolint:revive,stylecheck

func (*TkgBom) GetTKRPackageRepo

func (b *TkgBom) GetTKRPackageRepo() (tkrPackageRepo, error)

nolint:revive,stylecheck

type TkgBomContent

type TkgBomContent struct {
	Default               *defaultInfo               `yaml:"default"`
	Release               *ReleaseInfo               `yaml:"release"`
	Components            map[string][]ComponentInfo `yaml:"components"`
	KindKubeadmConfigSpec []string                   `yaml:"kindKubeadmConfigSpec"`
	KubeadmConfigSpec     *kubeadmConfig             `yaml:"kubeadmConfigSpec"`
	ImageConfig           *imageConfig               `yaml:"imageConfig"`
	Extensions            map[string]*extensionInfo  `yaml:"extensions,omitempty"`
	TKRBOM                *tkrBOMInfo                `yaml:"tkr-bom"`
	TKRCompatibility      *tkrCompatibilityInfo      `yaml:"tkr-compatibility"`
	TKRPackageRepo        tkrPackageRepo             `yaml:"tkr-package-repo"`
	TKRPackage            tkrPackage                 `yaml:"tkr-package"`
}

TkgBomContent defines the struct to represent BOM information

Jump to

Keyboard shortcuts

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