chartimages

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepoTypeDefault = iota
	RepoTypeSystem
)
View Source
const ChartfileName = "Chart.yaml"
View Source
const RancherVersionAnnotationKey = "catalog.cattle.io/rancher-version"

Variables

View Source
var (
	ChartsToCheckConstraints       = map[string]bool{}
	SystemChartsToCheckConstraints = map[string]bool{
		"rancher-monitoring": true,
	}
)

chartsToCheckConstraints and *ChartsToCheckConstraints define which charts and system charts should be checked for images and added to imageSet based on whether the given Rancher version/tag satisfies the chart's Rancher version constraints to allow support for multiple version lines of a chart in airgap setups. If a chart is not defined here, only the latest version of it will be checked for images. INFO: CRD charts need to be added as well.

View Source
var IgnoreChartImages = map[string]bool{
	"rancher/mirrored-sig-storage-csi-attacher:latest":                   true,
	"rancher/mirrored-sig-storage-csi-node-driver-registrar:latest":      true,
	"rancher/mirrored-sig-storage-csi-provisioner:latest":                true,
	"rancher/mirrored-sig-storage-csi-resizer:latest":                    true,
	"rancher/mirrored-sig-storage-livenessprobe:latest":                  true,
	"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:latest":  true,
	"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:latest":  true,
	"rancher/mirrored-cloud-provider-vsphere-cpi-release-manager:latest": true,
}

Some latest tag chart images does not exists.

Functions

func BuildOrGetIndex

func BuildOrGetIndex(dir string) (*repo.IndexFile, error)

BuildOrGetIndex builds or get index from local chart repo directory

func DecodeValuesInDir added in v1.5.0

func DecodeValuesInDir(dir string) ([]map[interface{}]interface{}, error)

DecodeValuesInDir reads directory and returns a slice of values corresponding to values.yaml files found inside of it.

func DecodeValuesInTgz added in v1.5.0

func DecodeValuesInTgz(path string) ([]map[interface{}]interface{}, error)

DecodeValuesInTgz reads tarball and returns a slice of values corresponding to values.yaml files found inside of it.

func IsChartDir added in v1.5.0

func IsChartDir(dirName string) (bool, error)

IsChartDir validate a chart directory.

Checks for a valid Chart.yaml.

func LoadMetadata

func LoadMetadata(path string) (*chart.Metadata, error)

LoadMetadata loads chart metadata from chart directory (not tgz file)

func PickImagesFromValuesMap added in v1.5.0

func PickImagesFromValuesMap(
	imagesSet map[string]map[string]bool,
	values map[interface{}]interface{},
	chartSource string,
	OS OsType,
) error

PickImagesFromValuesMap walks a values map to find images, and add them to imagesSet.

Types

type Chart

type Chart struct {
	RancherVersion  string
	OS              OsType
	Type            ChartRepoType // chart type: default, system, etc...
	Path            string
	URL             string
	CloneBaseDir    string // directory to clone
	Branch          string // git branch if in URL mode
	InsecureSkipTLS bool

	ImageSet map[string]map[string]bool // map[image]map[source]
}

func (*Chart) FetchImages

func (c *Chart) FetchImages(ctx context.Context) error

type ChartRepoType

type ChartRepoType int

func (*ChartRepoType) String

func (t *ChartRepoType) String() string

type OsType

type OsType int
const (
	Linux OsType = iota
	Windows
)

func (*OsType) String

func (t *OsType) String() string

type Questions

type Questions struct {
	RancherMinVersion string `yaml:"rancher_min_version"`
	RancherMaxVersion string `yaml:"rancher_max_version"`
}

Jump to

Keyboard shortcuts

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