Documentation ¶
Index ¶
- Constants
- Variables
- func NewGithubClient(httpClient *http.Client, token string) *githubClient
- func NewGitlabClient(httpClient *http.Client, token string) (*gitlabClient, error)
- func WithTarget(path string) loadOption
- func WithUrl(url string) loadOption
- type GenericProviderClient
- type LoadOptions
- type Provider
- type PullFunc
- type Repository
- type RepositoryConfigurator
- type RepositoryManager
- type WithKeySuffix
Constants ¶
View Source
const ( GitHub = "github" GitLab = "gitlab" Generic = "generic" )
View Source
const ( K8sSecretName = "vcs-auth" K8sSecretDataAuthType = "auth" K8sSecretDataAuthTypeSSH = "ssh" SSHKey = "identity" SSHPubKey = "identity.pub" SSHKnownHosts = "known_hosts" )
View Source
const (
GitHubSSHKey = "github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl"
)
View Source
const (
GitLabSSHKey = "gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf"
)
Variables ¶
View Source
var (
ErrAuthKeyNotFound = errors.New("VCS auth key secret not found")
)
View Source
var (
ErrRepositoryID = errors.New("Unknown repository id")
)
View Source
var (
ErrUnknownURLFormat = errors.New("Unknown git url format")
)
Functions ¶
func NewGithubClient ¶
func NewGitlabClient ¶
func WithTarget ¶
func WithTarget(path string) loadOption
WithTarget provides a local path to where the vcs repository is cloned.
Types ¶
type GenericProviderClient ¶
type GenericProviderClient struct{}
func (*GenericProviderClient) CreateDeployKey ¶
func (*GenericProviderClient) CreateDeployKey( ctx context.Context, repoID string, opts ...deployKeyOption, ) (*deployKey, error)
func (*GenericProviderClient) GetHostPublicSSHKey ¶
func (*GenericProviderClient) GetHostPublicSSHKey() string
type LoadOptions ¶
type LoadOptions struct {
// contains filtered or unexported fields
}
LoadOptions define configuration how to load a vcs repository.
type Repository ¶
type Repository struct { Path string // contains filtered or unexported fields }
A vcs Repository.
func NewRepository ¶
func NewRepository(path string, pull PullFunc) Repository
func (*Repository) Pull ¶
func (repository *Repository) Pull() error
type RepositoryConfigurator ¶
type RepositoryConfigurator struct {
// contains filtered or unexported fields
}
RepositoryConfigurator is capable of setting up Declcd with a Git provider.
func NewRepositoryConfigurator ¶
func NewRepositoryConfigurator( controllerNamespace string, kubeClient kube.Client[unstructured.Unstructured], httpClient *http.Client, url string, token string, ) (*RepositoryConfigurator, error)
func (RepositoryConfigurator) CreateDeployKeySecretIfNotExists ¶
func (config RepositoryConfigurator) CreateDeployKeySecretIfNotExists( ctx context.Context, fieldManager string, ) error
type RepositoryManager ¶
type RepositoryManager struct {
// contains filtered or unexported fields
}
RepositoryManager clones a remote vcs repository to a local path.
func NewRepositoryManager ¶
func NewRepositoryManager( controllerNamespace string, kubeClient kube.Client[unstructured.Unstructured], log logr.Logger, ) RepositoryManager
func (RepositoryManager) Load ¶
func (manager RepositoryManager) Load( ctx context.Context, opts ...loadOption, ) (*Repository, error)
Load loads a remote vcs repository to a local path or opens it if it exists.
type WithKeySuffix ¶
type WithKeySuffix string
Click to show internal directories.
Click to hide internal directories.