Documentation
¶
Index ¶
- type CommitMessageSpec
- type EndpointRef
- type EndpointSpec
- type EndpointType
- type FileTypeSpec
- type GitProvider
- type Header
- type ImagePullSecretRef
- type NormalizedConfig
- type RegistryAuthSpec
- type RepositoryRef
- type RepositorySpec
- type ResolverSpec
- type Strategy
- type SubscriptionSpec
- type UserConfigV1
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitMessageSpec ¶
type EndpointRef ¶
type EndpointRef struct {
Name string `json:"name,omitempty"`
}
type EndpointSpec ¶
type EndpointSpec struct {
Name string `json:"name,omitempty"`
Type EndpointType `json:"type,omitempty"`
Path string `json:"path,omitempty"`
RequiredHeaders []Header `json:"requiredHeaders,omitempty"`
}
type EndpointType ¶
type EndpointType string
const ( EndpointTypeGeneric EndpointType = "generic" EndpointTypeACR EndpointType = "acr" EndpointTypeDockerhub EndpointType = "dockerhub" EndpointTypeDistribution EndpointType = "distribution" )
type FileTypeSpec ¶
type GitProvider ¶
type GitProvider string
const ( ProviderGithub GitProvider = "github" ProviderAzure GitProvider = "azure" )
func InferGitProvider ¶
func InferGitProvider(giturl string) GitProvider
infer the provider from the given url. If the provider cannot be inferred, an empty string is returned
TODO: handle edge cases. i.e. azure repo url contains github.com for some reason
type ImagePullSecretRef ¶
type ImagePullSecretRef struct {
Name string `json:"name,omitempty"`
}
type NormalizedConfig ¶
type NormalizedConfig struct {
// List of endpoints to listen on
Endpoints []EndpointSpec `json:"endpoints,omitempty"`
// list of repositories to use
Repositories []RepositorySpec `json:"repositories,omitempty"`
// subscriptions link repositories to one or more endpoints
Subscriptions []SubscriptionSpec `json:"subscriptions,omitempty"`
// the registry auth is only used when using the k8s chain
// it allows to configure where/how imagePullSecrets are obtained
// this is only needed for registries that require an extra api call
// such as dockerhub, which does not send the digest
RegistryAuth RegistryAuthSpec `json:"registryAuth,omitempty"`
// the commit message is used when kobold makes commits
// both title and description are parsed as template string and executed
// with an array of changes as context
CommitMessage CommitMessageSpec `json:"commitMessage,omitempty"`
// list of custom path resolvers to find image refs
// this allows the user to lookup images in arbitrary paths
Resolvers []ResolverSpec `json:"resolvers,omitempty"`
}
in memory representation of the config used to setup kobold this is used so that the user facing config can have different formats. I.e. v1 and v2 or a flat kubernetes configmap
func ReadPath ¶
func ReadPath(path string) (*NormalizedConfig, error)
read the config at the given path and expand its env var references the config will be coded into an intermediate struct based on the version and afterwards normalized
func (*NormalizedConfig) Defaults ¶ added in v0.2.2
func (c *NormalizedConfig) Defaults()
type RegistryAuthSpec ¶
type RegistryAuthSpec struct {
ServiceAccount string `json:"serviceAccount,omitempty"`
Namespace string `json:"namespace,omitempty"`
ImagePullSecrets []ImagePullSecretRef `json:"imagePullSecrets,omitempty"`
}
type RepositoryRef ¶
type RepositoryRef struct {
Name string `json:"name,omitempty"`
}
type RepositorySpec ¶
type RepositorySpec struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
Provider GitProvider `json:"provider,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
type ResolverSpec ¶
type SubscriptionSpec ¶
type SubscriptionSpec struct {
Name string `json:"name,omitempty"`
EndpointRefs []EndpointRef `json:"endpointRefs,omitempty"`
RepositoryRef RepositoryRef `json:"repositoryRef,omitempty"`
Branch string `json:"branch,omitempty"`
Strategy Strategy `json:"strategy,omitempty"`
Scopes []string `json:"scopes,omitempty"`
FileAssociations []FileTypeSpec `json:"fileAssociations,omitempty"`
}
type UserConfigV1 ¶
type UserConfigV1 NormalizedConfig
func (UserConfigV1) Normalize ¶
func (c UserConfigV1) Normalize() *NormalizedConfig
Click to show internal directories.
Click to hide internal directories.