Documentation
¶
Index ¶
- func Copy(imageAssets []*ImageAsset, fileAssets []*FileAsset, cluster *kops.Cluster) error
- type AssetBuilder
- func (a *AssetBuilder) RemapFileAndSHA(fileURL *url.URL) (*url.URL, *hashing.Hash, error)
- func (a *AssetBuilder) RemapFileAndSHAValue(fileURL *url.URL, shaValue string) (*url.URL, error)
- func (a *AssetBuilder) RemapImage(image string) (string, error)
- func (a *AssetBuilder) RemapManifest(data []byte) ([]byte, error)
- type CopyFile
- type CopyImage
- type FileAsset
- type ImageAsset
- type StaticFile
- type StaticManifest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssetBuilder ¶
type AssetBuilder struct {
ImageAssets []*ImageAsset
FileAssets []*FileAsset
AssetsLocation *kops.AssetsSpec
GetAssets bool
// KubernetesVersion is the version of kubernetes we are installing
KubernetesVersion semver.Version
// StaticManifests records manifests used by nodeup:
// * e.g. sidecar manifests for static pods run by kubelet
StaticManifests []*StaticManifest
// StaticFiles records static files:
// * Configuration files supporting static pods
StaticFiles []*StaticFile
}
AssetBuilder discovers and remaps assets.
func NewAssetBuilder ¶
func NewAssetBuilder(assets *kops.AssetsSpec, kubernetesVersion string, getAssets bool) *AssetBuilder
NewAssetBuilder creates a new AssetBuilder.
func (*AssetBuilder) RemapFileAndSHA ¶
RemapFileAndSHA returns a remapped URL for the file, if AssetsLocation is defined. It also returns the SHA hash of the file.
func (*AssetBuilder) RemapFileAndSHAValue ¶
RemapFileAndSHAValue returns a remapped URL for the file without a SHA file in object storage, if AssetsLocation is defined.
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 CopyFile ¶ added in v1.21.3
type CopyFile struct {
Name string
SourceFile string
TargetFile string
SHA string
Cluster *kops.Cluster
}
CopyFile copies an from a source file repository, to a target repository, typically used for highly secure clusters.
type CopyImage ¶ added in v1.21.3
CopyImage copies a docker image from a source registry, to a target registry, typically used for highly secure clusters.
type FileAsset ¶
type FileAsset struct {
// DownloadURL is the URL from which the cluster should download the asset.
DownloadURL *url.URL
// CanonicalURL is the canonical location of the asset, for example as distributed by the kops project
CanonicalURL *url.URL
// SHAValue is the SHA hash of the FileAsset.
SHAValue string
}
FileAsset models a file's location.
type ImageAsset ¶ added in v1.21.3
type ImageAsset struct {
// DownloadLocation will be the name of the image we should run.
// This is used to copy an image to a ContainerRegistry.
DownloadLocation string
// CanonicalLocation will be the source location of the image.
CanonicalLocation string
}
ImageAsset models an image's location.
type StaticFile ¶ added in v1.25.0
type StaticFile struct {
// Path is the path to the manifest.
Path string
// Content holds the desired file contents.
Content string
// The static manifest will only be applied to instances matching the specified role
Roles []kops.InstanceGroupRole
}
type StaticManifest ¶ added in v1.17.0
type StaticManifest struct {
// Key is the unique identifier of the manifest
Key string
// Path is the path to the manifest.
Path string
// The static manifest will only be applied to instances matching the specified role
Roles []kops.InstanceGroupRole
}