config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretK8sCorev1BasicAuthUsernameKey = "username"
	SecretK8sCorev1BasicAuthPasswordKey = "password"

	SecretK8sCoreV1SSHAuthPrivateKey = "ssh-privatekey"
	SecretSSHAuthKnownHosts          = "ssh-knownhosts" // not part of k8s

	SecretToken = "token"
)
View Source
const (
	EntireDirPath = "."
)

Variables

View Source
var (
	DefaultLegalPaths = []string{
		"{LICENSE,LICENCE,License,Licence}{,.md,.txt,.rst}",
		"{COPYRIGHT,Copyright}{,.md,.txt,.rst}",
		"{NOTICE,Notice}{,.md,.txt,.rst}",
	}
)

Functions

func NewConfigFromFiles added in v0.15.0

func NewConfigFromFiles(paths []string) (Config, []Secret, []ConfigMap, error)

Types

type Config

type Config struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`

	MinimumRequiredVersion string `json:"minimumRequiredVersion"`

	Directories []Directory `json:"directories,omitempty"`
}

func NewConfigFromBytes

func NewConfigFromBytes(bs []byte) (Config, error)

func (Config) AsBytes added in v0.15.0

func (c Config) AsBytes() ([]byte, error)

func (Config) Lock added in v0.15.0

func (c Config) Lock(lockConfig LockConfig) error

func (Config) Subset added in v0.15.0

func (c Config) Subset(paths []string) (Config, error)

func (Config) UseDirectory added in v0.15.0

func (c Config) UseDirectory(path, dirPath string) error

func (Config) Validate

func (c Config) Validate() error

type ConfigMap added in v0.15.0

type ConfigMap struct {
	APIVersion string
	Kind       string

	Metadata GenericMetadata
	Data     map[string]string
}

type Directory added in v0.15.0

type Directory struct {
	Path     string              `json:"path"`
	Contents []DirectoryContents `json:"contents,omitempty"`
}

func (Directory) Validate added in v0.15.0

func (c Directory) Validate() error

type DirectoryContents added in v0.15.0

type DirectoryContents struct {
	Path string `json:"path"`

	Git           *DirectoryContentsGit           `json:"git,omitempty"`
	HTTP          *DirectoryContentsHTTP          `json:"http,omitempty"`
	Image         *DirectoryContentsImage         `json:"image,omitempty"`
	GithubRelease *DirectoryContentsGithubRelease `json:"githubRelease,omitempty"`
	HelmChart     *DirectoryContentsHelmChart     `json:"helmChart,omitempty"`
	Manual        *DirectoryContentsManual        `json:"manual,omitempty"`
	Directory     *DirectoryContentsDirectory     `json:"directory,omitempty"`
	Inline        *DirectoryContentsInline        `json:"inline,omitempty"`

	IncludePaths []string `json:"includePaths,omitempty"`
	ExcludePaths []string `json:"excludePaths,omitempty"`

	// By default LICENSE/LICENCE/NOTICE/COPYRIGHT files are kept
	LegalPaths []string `json:"legalPaths,omitempty"`

	NewRootPath string `json:"newRootPath,omitempty"`
}

func (DirectoryContents) IsEntireDir added in v0.15.0

func (c DirectoryContents) IsEntireDir() bool

func (DirectoryContents) LegalPathsWithDefaults added in v0.15.0

func (c DirectoryContents) LegalPathsWithDefaults() []string

func (DirectoryContents) Lock added in v0.15.0

func (c DirectoryContents) Lock(lockConfig LockDirectoryContents) error

func (DirectoryContents) Validate added in v0.15.0

func (c DirectoryContents) Validate() error

type DirectoryContentsDirectory added in v0.15.0

type DirectoryContentsDirectory struct {
	Path string `json:"path"`
}

type DirectoryContentsGit added in v0.15.0

type DirectoryContentsGit struct {
	URL          string                            `json:"url,omitempty"`
	Ref          string                            `json:"ref,omitempty"`
	RefSelection *ctlver.VersionSelection          `json:"refSelection,omitempty"`
	Verification *DirectoryContentsGitVerification `json:"verification,omitempty"`
	// Secret may include one or more keys: ssh-privatekey, ssh-knownhosts
	// +optional
	SecretRef *DirectoryContentsLocalRef `json:"secretRef,omitempty"`
	// +optional
	LFSSkipSmudge bool `json:"lfsSkipSmudge,omitempty"`
}

func (*DirectoryContentsGit) Lock added in v0.15.0

type DirectoryContentsGitVerification added in v0.15.0

type DirectoryContentsGitVerification struct {
	PublicKeysSecretRef *DirectoryContentsLocalRef `json:"publicKeysSecretRef,omitempty"`
}

type DirectoryContentsGithubRelease added in v0.15.0

type DirectoryContentsGithubRelease struct {
	Slug   string `json:"slug"` // e.g. organization/repository
	Tag    string `json:"tag"`
	Latest bool   `json:"latest,omitempty"`
	URL    string `json:"url,omitempty"`

	Checksums                     map[string]string `json:"checksums,omitempty"`
	DisableAutoChecksumValidation bool              `json:"disableAutoChecksumValidation,omitempty"`

	AssetNames    []string                        `json:"assetNames,omitempty"`
	UnpackArchive *DirectoryContentsUnpackArchive `json:"unpackArchive,omitempty"`

	// Secret may include one key: token
	// +optional
	SecretRef *DirectoryContentsLocalRef `json:"secretRef,omitempty"`
}

func (*DirectoryContentsGithubRelease) Lock added in v0.15.0

type DirectoryContentsHTTP added in v0.15.0

type DirectoryContentsHTTP struct {
	// URL can point to one of following formats: text, tgz, zip
	URL string `json:"url,omitempty"`
	// +optional
	SHA256 string `json:"sha256,omitempty"`
	// Secret may include one or more keys: username, password
	// +optional
	SecretRef *DirectoryContentsLocalRef `json:"secretRef,omitempty"`
}

func (*DirectoryContentsHTTP) Lock added in v0.15.0

type DirectoryContentsHelmChart added in v0.15.0

type DirectoryContentsHelmChart struct {
	// Example: stable/redis
	Name string `json:"name,omitempty"`
	// +optional
	Version    string                          `json:"version,omitempty"`
	Repository *DirectoryContentsHelmChartRepo `json:"repository,omitempty"`

	// +optional
	HelmVersion string `json:"helmVersion,omitempty"`
}

func (*DirectoryContentsHelmChart) Lock added in v0.15.0

type DirectoryContentsHelmChartRepo added in v0.15.0

type DirectoryContentsHelmChartRepo struct {
	URL string `json:"url,omitempty"`
	// +optional
	SecretRef *DirectoryContentsLocalRef `json:"secretRef,omitempty"`
}

type DirectoryContentsImage added in v0.15.0

type DirectoryContentsImage struct {
	// Example: username/app1-config:v0.1.0
	URL string `json:"url,omitempty"`
	// Secret may include one or more keys: username, password, token.
	// By default anonymous access is used for authentication.
	// TODO support docker config formated secret
	// +optional
	SecretRef *DirectoryContentsLocalRef `json:"secretRef,omitempty"`
}

func (*DirectoryContentsImage) Lock added in v0.15.0

type DirectoryContentsInline added in v0.15.0

type DirectoryContentsInline struct {
	Paths     map[string]string               `json:"paths,omitempty"`
	PathsFrom []DirectoryContentsInlineSource `json:"pathsFrom,omitempty"`
}

type DirectoryContentsInlineSource added in v0.15.0

type DirectoryContentsInlineSource struct {
	SecretRef    *DirectoryContentsInlineSourceRef `json:"secretRef,omitempty"`
	ConfigMapRef *DirectoryContentsInlineSourceRef `json:"configMapRef,omitempty"`
}

type DirectoryContentsInlineSourceRef added in v0.15.0

type DirectoryContentsInlineSourceRef struct {
	DirectoryPath             string `json:"directoryPath,omitempty"`
	DirectoryContentsLocalRef `json:",inline"`
}

type DirectoryContentsLocalRef added in v0.15.0

type DirectoryContentsLocalRef struct {
	Name string `json:"name,omitempty"`
}

type DirectoryContentsManual added in v0.15.0

type DirectoryContentsManual struct{}

type DirectoryContentsUnpackArchive added in v0.15.0

type DirectoryContentsUnpackArchive struct {
	Path string `json:"path"`
}

type GenericMetadata added in v0.15.0

type GenericMetadata struct {
	Name string
}

type LockConfig

type LockConfig struct {
	APIVersion  string          `json:"apiVersion"`
	Kind        string          `json:"kind"`
	Directories []LockDirectory `json:"directories"`
}

func NewLockConfig

func NewLockConfig() LockConfig

func NewLockConfigFromBytes added in v0.15.0

func NewLockConfigFromBytes(bs []byte) (LockConfig, error)

func NewLockConfigFromFile added in v0.15.0

func NewLockConfigFromFile(path string) (LockConfig, error)

func (LockConfig) AsBytes added in v0.3.0

func (c LockConfig) AsBytes() ([]byte, error)

func (LockConfig) FindContents added in v0.15.0

func (c LockConfig) FindContents(dirPath, conPath string) (LockDirectoryContents, error)

func (LockConfig) Merge added in v0.15.0

func (c LockConfig) Merge(other LockConfig) error

func (LockConfig) MergeContents added in v0.15.0

func (c LockConfig) MergeContents(path string, replaceCon LockDirectoryContents) error

func (LockConfig) Validate added in v0.15.0

func (c LockConfig) Validate() error

func (LockConfig) WriteToFile

func (c LockConfig) WriteToFile(path string) error

type LockDirectory added in v0.15.0

type LockDirectory struct {
	Path     string                  `json:"path"`
	Contents []LockDirectoryContents `json:"contents"`
}

type LockDirectoryContents added in v0.15.0

type LockDirectoryContents struct {
	Path string `json:"path"`

	Git           *LockDirectoryContentsGit           `json:"git,omitempty"`
	HTTP          *LockDirectoryContentsHTTP          `json:"http,omitempty"`
	Image         *LockDirectoryContentsImage         `json:"image,omitempty"`
	GithubRelease *LockDirectoryContentsGithubRelease `json:"githubRelease,omitempty"`
	HelmChart     *LockDirectoryContentsHelmChart     `json:"helmChart,omitempty"`
	Manual        *LockDirectoryContentsManual        `json:"manual,omitempty"`
	Directory     *LockDirectoryContentsDirectory     `json:"directory,omitempty"`
	Inline        *LockDirectoryContentsInline        `json:"inline,omitempty"`
}

type LockDirectoryContentsDirectory added in v0.15.0

type LockDirectoryContentsDirectory struct{}

type LockDirectoryContentsGit added in v0.15.0

type LockDirectoryContentsGit struct {
	SHA         string   `json:"sha"`
	Tags        []string `json:"tags,omitempty"`
	CommitTitle string   `json:"commitTitle"`
}

type LockDirectoryContentsGithubRelease added in v0.15.0

type LockDirectoryContentsGithubRelease struct {
	URL string `json:"url"`
}

type LockDirectoryContentsHTTP added in v0.15.0

type LockDirectoryContentsHTTP struct{}

type LockDirectoryContentsHelmChart added in v0.15.0

type LockDirectoryContentsHelmChart struct {
	Version    string `json:"version"`
	AppVersion string `json:"appVersion"`
}

type LockDirectoryContentsImage added in v0.15.0

type LockDirectoryContentsImage struct {
	URL string `json:"url"`
}

type LockDirectoryContentsInline added in v0.15.0

type LockDirectoryContentsInline struct{}

type LockDirectoryContentsManual added in v0.15.0

type LockDirectoryContentsManual struct{}

type Secret added in v0.15.0

type Secret struct {
	APIVersion string
	Kind       string

	Metadata GenericMetadata
	Data     map[string][]byte
}

Jump to

Keyboard shortcuts

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