Documentation ¶
Overview ¶
Package config contains logic for parsing config.
Index ¶
- Constants
- Variables
- func LockFileExists(path string) bool
- func NewConfigFromFiles(paths []string) (Config, []Secret, []ConfigMap, error)
- type Config
- type ConfigMap
- type Directory
- type DirectoryContents
- type DirectoryContentsDirectory
- type DirectoryContentsGit
- type DirectoryContentsGitVerification
- type DirectoryContentsGithubRelease
- type DirectoryContentsHTTP
- type DirectoryContentsHelmChart
- type DirectoryContentsHelmChartRepo
- type DirectoryContentsHg
- type DirectoryContentsHgVerification
- type DirectoryContentsImage
- type DirectoryContentsImgpkgBundle
- type DirectoryContentsInline
- type DirectoryContentsInlineSource
- type DirectoryContentsInlineSourceRef
- type DirectoryContentsLocalRef
- type DirectoryContentsManual
- type DirectoryContentsUnpackArchive
- type GenericMetadata
- type LockConfig
- func (c LockConfig) AsBytes() ([]byte, error)
- func (c LockConfig) FindContents(dirPath, conPath string) (LockDirectoryContents, error)
- func (c LockConfig) FindDirectory(dirPath string) (LockDirectory, error)
- func (c LockConfig) Merge(other LockConfig) error
- func (c LockConfig) MergeContents(path string, replaceCon LockDirectoryContents) error
- func (c LockConfig) Validate() error
- func (c LockConfig) WriteToFile(path string) error
- type LockDirectory
- type LockDirectoryContents
- type LockDirectoryContentsDirectory
- type LockDirectoryContentsGit
- type LockDirectoryContentsGithubRelease
- type LockDirectoryContentsHTTP
- type LockDirectoryContentsHelmChart
- type LockDirectoryContentsHg
- type LockDirectoryContentsImage
- type LockDirectoryContentsImgpkgBundle
- type LockDirectoryContentsInline
- type LockDirectoryContentsManual
- type Secret
Constants ¶
View Source
const ( SecretK8sCorev1BasicAuthUsernameKey = "username" SecretK8sCorev1BasicAuthPasswordKey = "password" SecretK8sCoreV1SSHAuthPrivateKey = "ssh-privatekey" SecretSSHAuthKnownHosts = "ssh-knownhosts" // not part of k8s SecretRegistryHostnameKey = "hostname" SecretRegistryBearerToken = "token" SecretRegistryIdentityToken = "identity-token" SecretGithubAPIToken = "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 LockFileExists ¶ added in v0.35.1
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 (Config) Lock ¶ added in v0.15.0
func (c Config) Lock(lockConfig LockConfig) error
func (Config) UseDirectory ¶ added in v0.15.0
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"` Permissions *os.FileMode `json:"permissions,omitempty"` }
type DirectoryContents ¶ added in v0.15.0
type DirectoryContents struct { Path string `json:"path"` Lazy bool `json:"lazy,omitempty"` Git *DirectoryContentsGit `json:"git,omitempty"` Hg *DirectoryContentsHg `json:"hg,omitempty"` HTTP *DirectoryContentsHTTP `json:"http,omitempty"` Image *DirectoryContentsImage `json:"image,omitempty"` ImgpkgBundle *DirectoryContentsImgpkgBundle `json:"imgpkgBundle,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"` IgnorePaths []string `json:"ignorePaths,omitempty"` // By default LICENSE/LICENCE/NOTICE/COPYRIGHT files are kept LegalPaths *[]string `json:"legalPaths,omitempty"` NewRootPath string `json:"newRootPath,omitempty"` Permissions *os.FileMode `json:"permissions,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"` DangerousSkipTLSVerify bool `json:"dangerousSkipTLSVerify,omitempty"` SkipInitSubmodules bool `json:"skipInitSubmodules,omitempty"` Depth int `json:"depth,omitempty"` }
func (*DirectoryContentsGit) Lock ¶ added in v0.15.0
func (c *DirectoryContentsGit) Lock(lockConfig *LockDirectoryContentsGit) error
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"` TagSelection *ctlver.VersionSelection `json:"tagSelection,omitempty"` 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"` // +optional HTTP *DirectoryContentsHTTP `json:"http,omitempty"` }
func (*DirectoryContentsGithubRelease) Lock ¶ added in v0.15.0
func (c *DirectoryContentsGithubRelease) Lock(lockConfig *LockDirectoryContentsGithubRelease) error
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"` // +optional DisableUnpack bool `json:"disableUnpack,omitempty"` }
func (*DirectoryContentsHTTP) Lock ¶ added in v0.15.0
func (c *DirectoryContentsHTTP) Lock(lockConfig *LockDirectoryContentsHTTP) error
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
func (c *DirectoryContentsHelmChart) Lock(lockConfig *LockDirectoryContentsHelmChart) error
type DirectoryContentsHelmChartRepo ¶ added in v0.15.0
type DirectoryContentsHelmChartRepo struct { URL string `json:"url,omitempty"` // +optional SecretRef *DirectoryContentsLocalRef `json:"secretRef,omitempty"` }
type DirectoryContentsHg ¶ added in v0.22.0
type DirectoryContentsHg struct { URL string `json:"url,omitempty"` Ref string `json:"ref,omitempty"` Evolve bool `json:"evolve,omitempty"` // Secret may include one or more keys: ssh-privatekey, ssh-knownhosts // +optional SecretRef *DirectoryContentsLocalRef `json:"secretRef,omitempty"` }
func (*DirectoryContentsHg) Lock ¶ added in v0.22.0
func (c *DirectoryContentsHg) Lock(lockConfig *LockDirectoryContentsHg) error
type DirectoryContentsHgVerification ¶ added in v0.22.0
type DirectoryContentsHgVerification struct {
PublicKeysSecretRef *DirectoryContentsLocalRef `json:"publicKeysSecretRef,omitempty"`
}
type DirectoryContentsImage ¶ added in v0.15.0
type DirectoryContentsImage struct { // Example: username/app1-config:v0.1.0 URL string `json:"url,omitempty"` TagSelection *ctlver.VersionSelection `json:"tagSelection,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"` DangerousSkipTLSVerify bool `json:"dangerousSkipTLSVerify,omitempty"` // contains filtered or unexported fields }
func (*DirectoryContentsImage) Lock ¶ added in v0.15.0
func (c *DirectoryContentsImage) Lock(lockConfig *LockDirectoryContentsImage) error
func (DirectoryContentsImage) PreresolvedTag ¶ added in v0.22.0
func (c DirectoryContentsImage) PreresolvedTag() string
type DirectoryContentsImgpkgBundle ¶ added in v0.16.0
type DirectoryContentsImgpkgBundle struct { // Example: username/app1-config:v0.1.0 Image string `json:"image,omitempty"` TagSelection *ctlver.VersionSelection `json:"tagSelection,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"` DangerousSkipTLSVerify bool `json:"dangerousSkipTLSVerify,omitempty"` Recursive bool `json:"recursive,omitempty"` // contains filtered or unexported fields }
func (*DirectoryContentsImgpkgBundle) Lock ¶ added in v0.16.0
func (c *DirectoryContentsImgpkgBundle) Lock(lockConfig *LockDirectoryContentsImgpkgBundle) error
func (DirectoryContentsImgpkgBundle) PreresolvedTag ¶ added in v0.22.0
func (c DirectoryContentsImgpkgBundle) PreresolvedTag() string
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"` }
LockConfig outputs a vendir.lock with shas for reproducible vendir-ing.
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) FindDirectory ¶ added in v0.35.1
func (c LockConfig) FindDirectory(dirPath string) (LockDirectory, 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"` }
func (LockDirectory) FindContents ¶ added in v0.35.1
func (d LockDirectory) FindContents(conPath string) (LockDirectoryContents, error)
type LockDirectoryContents ¶ added in v0.15.0
type LockDirectoryContents struct { Path string `json:"path"` ConfigDigest string `json:"configDigest,omitempty"` Git *LockDirectoryContentsGit `json:"git,omitempty"` Hg *LockDirectoryContentsHg `json:"hg,omitempty"` HTTP *LockDirectoryContentsHTTP `json:"http,omitempty"` Image *LockDirectoryContentsImage `json:"image,omitempty"` ImgpkgBundle *LockDirectoryContentsImgpkgBundle `json:"imgpkgBundle,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 LockDirectoryContentsGithubRelease ¶ added in v0.15.0
type LockDirectoryContentsHTTP ¶ added in v0.15.0
type LockDirectoryContentsHTTP struct{}
type LockDirectoryContentsHelmChart ¶ added in v0.15.0
type LockDirectoryContentsHg ¶ added in v0.22.0
type LockDirectoryContentsImage ¶ added in v0.15.0
type LockDirectoryContentsImgpkgBundle ¶ added in v0.16.0
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 Type string Data map[string][]byte }
func (Secret) ToRegistryAuthSecrets ¶ added in v0.22.0
ToRegistryAuthSecrets splits secret into multiple secrets if secret of type dockerconfigjson; otherwise returns same secret.
Click to show internal directories.
Click to hide internal directories.