assets

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RewriteManifests = featureflag.New("RewriteManifests", featureflag.Bool(true))

RewriteManifests controls whether we rewrite manifests Because manifest rewriting converts everything to and from YAML, we normalize everything by doing so

Functions

This section is empty.

Types

type AssetBuilder

type AssetBuilder struct {
	ContainerAssets []*ContainerAsset
	FileAssets      []*FileAsset
	AssetsLocation  *kops.Assets
	// TODO we'd like to use cloudup.Phase here, but that introduces a go cyclic dependency
	Phase string

	// KubernetesVersion is the version of kubernetes we are installing
	KubernetesVersion semver.Version
}

AssetBuilder discovers and remaps assets.

func NewAssetBuilder

func NewAssetBuilder(cluster *kops.Cluster, phase string) *AssetBuilder

NewAssetBuilder creates a new AssetBuilder.

func (*AssetBuilder) RemapFileAndSHA

func (a *AssetBuilder) RemapFileAndSHA(fileURL *url.URL) (*url.URL, *hashing.Hash, error)

RemapFileAndSHA returns a remapped url for the file, if AssetsLocation is defined. It also returns the SHA hash of the file.

func (*AssetBuilder) RemapFileAndSHAValue

func (a *AssetBuilder) RemapFileAndSHAValue(fileURL *url.URL, shaValue string) (*url.URL, error)

RemapFileAndSHAValue is used exclusively to remap the cni tarball, as the tarball does not have a sha file in object storage.

func (*AssetBuilder) RemapImage

func (a *AssetBuilder) RemapImage(image string) (string, error)

RemapImage normalizes a containers location if a user sets the AssetsLocation ContainerRegistry location.

func (*AssetBuilder) RemapManifest

func (a *AssetBuilder) RemapManifest(data []byte) ([]byte, error)

RemapManifest transforms a kubernetes manifest. Whenever we are building a Task that includes a manifest, we should pass it through RemapManifest first. This will: * rewrite the images if they are being redirected to a mirror, and ensure the image is uploaded

type ContainerAsset

type ContainerAsset struct {
	// DockerImage will be the name of the container we should run.
	// This is used to copy a container to a ContainerRegistry.
	DockerImage string
	// CanonicalLocation will be the source location of the container.
	CanonicalLocation string
}

ContainerAsset models a container's location.

type FileAsset

type FileAsset struct {
	// FileURL is the URL of a file that is accessed by a Kubernetes cluster.
	FileURL *url.URL
	// CanonicalFileURL is the source URL of a file. This is used to copy a file to a FileRepository.
	CanonicalFileURL *url.URL
	// SHAValue is the SHA hash of the FileAsset.
	SHAValue string
}

FileAsset models a file's location.

Jump to

Keyboard shortcuts

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