base

package
v1.108.8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 65 Imported by: 1

Documentation

Index

Constants

View Source
const NamespaceTemplateConst = "repl{{ Namespace}}"

Variables

View Source
var (
	HelmV3ManifestNameRegex = regexp.MustCompile("^# Source: (.+)")
)

Functions

func AddBundlePart

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

func FindHelmChartArchiveInRelease added in v1.99.0

func FindHelmChartArchiveInRelease(upstreamFiles []upstreamtypes.UpstreamFile, kotsHelmChart helmchart.HelmChartInterface) ([]byte, error)

FindHelmChartArchiveInRelease iterates through all files in the release (upstreamFiles), looking for a helm chart archive that matches the chart name and version specified in the kotsHelmChart parameter

func FindImages added in v1.106.0

func FindImages(b *Base) ([]string, []k8sdoc.K8sDoc, error)

func NewConfigContextTemplateBuilder

func NewConfigContextTemplateBuilder(u *upstreamtypes.Upstream, renderOptions *RenderOptions) (*template.Builder, map[string]template.ItemValue, error)

func RenderKotsKinds added in v1.105.0

func RenderKotsKinds(u *upstreamtypes.Upstream, renderOptions *RenderOptions) (map[string][]byte, error)

RenderKotsKinds is responsible for rendering KOTS custom resources

func RenderUpstream

func RenderUpstream(u *upstreamtypes.Upstream, renderOptions *RenderOptions, renderedKotsKinds *kotsutil.KotsKinds) (base *Base, helmBases []Base, err error)

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

func RewriteImages added in v1.82.0

func RewriteImages(images []string, destRegistry dockerregistrytypes.RegistryOptions) ([]kustomizetypes.Image, error)

RewriteImages rewrites all images to point to the configured destination registry.

func RewritePrivateImages added in v1.106.0

func RewritePrivateImages(images []string, kotsKinds *kotsutil.KotsKinds, license *kotsv1beta1.License) ([]kustomizetypes.Image, error)

RewritePrivateImages rewrites private images to be proxied through proxy.replicated.com, and rewrites replicated registry images to use the custom registry domain if configured

Types

type Base

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

func RenderHelm

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

func (*Base) DeepCopy

func (in *Base) DeepCopy() *Base

func (*Base) DeepCopyInto

func (in *Base) DeepCopyInto(out *Base)

func (Base) ListErrorFiles

func (b Base) ListErrorFiles() []BaseFile

func (*Base) SetNamespace

func (b *Base) SetNamespace(namespace string)

func (*Base) WriteBase

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

type BaseFile

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

func PrependBaseFilesPath

func PrependBaseFilesPath(files []BaseFile, prefix string) []BaseFile

func (*BaseFile) DeepCopy

func (in *BaseFile) DeepCopy() *BaseFile

func (*BaseFile) DeepCopyInto

func (in *BaseFile) DeepCopyInto(out *BaseFile)

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 HelmChartDependencies

type HelmChartDependencies struct {
	Dependencies []HelmChartDependency `yaml:"dependencies"`
}

type HelmChartDependency

type HelmChartDependency struct {
	Alias      string `yaml:"alias"`
	Name       string `yaml:"name"`
	Repository string `yaml:"repository"`
}

type OverlySimpleGVK

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

func GetGVKWithNameAndNs

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

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
	HelmValues        map[string]interface{}
	RegistrySettings  registrytypes.RegistrySettings
	ExcludeKotsKinds  bool
	AppSlug           string
	Sequence          int64
	IsAirgap          bool
	UseHelmInstall    bool
	Log               *logger.CLILogger
}

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
	IsHelmBase       bool
}

Jump to

Keyboard shortcuts

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