base

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 44 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HelmV3ManifestNameRegex = regexp.MustCompile("^# Source: [^/]+/(.+)\n")
)

Functions

func AddBundlePart

func AddBundlePart(baseDir string, filename string, content []byte) error

func FindObjectsWithImages

func FindObjectsWithImages(options FindObjectsWithImagesOptions) ([]k8sdoc.K8sDoc, error)

func GetGVKWithNameAndNs

func GetGVKWithNameAndNs(content []byte, baseNS string) string

func UnmarshalConfigValuesContent added in v0.9.14

func UnmarshalConfigValuesContent(content []byte) (map[string]template.ItemValue, error)

func UnmarshalLicenseContent added in v1.4.0

func UnmarshalLicenseContent(content []byte, log *logger.Logger) *kotsv1beta1.License

Types

type Base

type Base struct {
	Path       string
	Namespace  string
	Files      []BaseFile
	ErrorFiles []BaseFile
	Bases      []Base
}

func RenderHelm

func RenderHelm(u *upstreamtypes.Upstream, renderOptions *RenderOptions) (*Base, error)

func RenderUpstream

func RenderUpstream(u *upstreamtypes.Upstream, renderOptions *RenderOptions) (*Base, error)

RenderUpstream is responsible for any conversions or transpilation steps are required to take an upstream and make it a valid kubernetes base

func (*Base) GetOverlaysDir

func (b *Base) GetOverlaysDir(options WriteOptions) string

func (Base) ListErrorFiles

func (b Base) ListErrorFiles() []BaseFile

func (*Base) WriteBase

func (b *Base) WriteBase(options WriteOptions) error

type BaseFile

type BaseFile struct {
	Path    string
	Content []byte
	Error   error
}

func (BaseFile) IsKotsKind

func (f BaseFile) IsKotsKind() (bool, error)

func (BaseFile) ShouldBeIncludedInBaseKustomization

func (f BaseFile) ShouldBeIncludedInBaseKustomization(excludeKotsKinds bool) (bool, error)

ShouldBeIncludedInBaseKustomization attempts to determine if this is a valid Kubernetes manifest. It accomplished this by trying to unmarshal the YAML and looking for a apiVersion and Kind

type Document

type Document struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
}

type FindObjectsWithImagesOptions added in v1.9.0

type FindObjectsWithImagesOptions struct {
	BaseDir string
}

type FindPrivateImagesOptions

type FindPrivateImagesOptions struct {
	BaseDir            string
	AppSlug            string
	ReplicatedRegistry registry.RegistryOptions
	Installation       *kotsv1beta1.Installation
	AllImagesPrivate   bool
}

type FindPrivateImagesResult

type FindPrivateImagesResult struct {
	Images        []kustomizeimage.Image          // images to be rewritten
	Docs          []k8sdoc.K8sDoc                 // docs that have rewritten images
	CheckedImages []kotsv1beta1.InstallationImage // all images found in the installation
}

type OverlySimpleGVK

type OverlySimpleGVK struct {
	APIVersion string               `yaml:"apiVersion"`
	Kind       string               `yaml:"kind"`
	Metadata   OverlySimpleMetadata `yaml:"metadata"`
}

type OverlySimpleMetadata

type OverlySimpleMetadata struct {
	Name        string                 `yaml:"name"`
	Namespace   string                 `yaml:"namespace"`
	Annotations map[string]interface{} `json:"annotations"`
}

type ParseError

type ParseError struct {
	Err error
}

func (ParseError) Error

func (e ParseError) Error() string

type RenderOptions

type RenderOptions struct {
	SplitMultiDocYAML      bool
	Namespace              string
	HelmVersion            string
	HelmOptions            []string
	LocalRegistryHost      string
	LocalRegistryNamespace string
	LocalRegistryUsername  string
	LocalRegistryPassword  string
	ExcludeKotsKinds       bool
	Log                    *logger.Logger
}

type SkippedFile

type SkippedFile struct {
	Path   string `yaml:"path"`
	Reason string `yaml:"reason"`
}

type SkippedFilesIndex

type SkippedFilesIndex struct {
	SkippedFiles []SkippedFile `yaml:"skippedFiles"`
}

type WriteOptions

type WriteOptions struct {
	BaseDir          string
	SkippedDir       string
	Overwrite        bool
	ExcludeKotsKinds bool
}

type WriteUpstreamImageOptions

type WriteUpstreamImageOptions struct {
	BaseDir        string
	AppSlug        string
	SourceRegistry registry.RegistryOptions
	DestRegistry   registry.RegistryOptions
	DryRun         bool
	IsAirgap       bool
	Log            *logger.Logger
	ReportWriter   io.Writer
	Installation   *kotsv1beta1.Installation
	Application    *kotsv1beta1.Application
}

type WriteUpstreamImageResult

type WriteUpstreamImageResult struct {
	Images        []kustomizeimage.Image          // images to be rewritten
	CheckedImages []kotsv1beta1.InstallationImage // all images found in the installation
}

func CopyUpstreamImages added in v1.9.0

func CopyUpstreamImages(options WriteUpstreamImageOptions) (*WriteUpstreamImageResult, error)

Jump to

Keyboard shortcuts

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