Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
// Username identifies a principal, which combined with the value of the
// Password field, can be used for access to some repository.
Username string
// Password, when combined with the principal identified by the Username
// field, can be used for access to some repository.
Password string
// SSHPrivateKey is a private key that can be used for access to some remote
// repository. This is primarily applicable for Git repositories.
SSHPrivateKey string
}
Credentials generically represents any type of repository credential.
type Database ¶
type Database interface {
Get(
ctx context.Context,
namespace string,
credType Type,
repo string,
) (Credentials, bool, error)
}
Database is an interface for a Credentials store.
func NewKubernetesDatabase ¶
func NewKubernetesDatabase( kargoClient client.Client, opts ...KubernetesDatabaseOption, ) Database
NewKubernetesDatabase initializes and returns an implementation of the Database interface that utilizes a Kubernetes controller runtime client to index and retrieve Credentials stored in Kubernetes Secrets. This function carries out the important task of indexing Credentials stored in Kubernetes Secrets by repository type + URL.
type FakeDB ¶
type FakeDB struct {
GetFn func(
ctx context.Context,
namespace string,
credType Type,
repo string,
) (Credentials, bool, error)
}
FakeDB is a mock implementation of the Database interface that is used to facilitate unit testing.
type KubernetesDatabaseOption ¶ added in v0.3.0
type KubernetesDatabaseOption func(*kubernetesDatabaseConfig)
KubernetesDatabaseOption is a functional option for configuring a kubernetesDatabase. Options defined in credentials_options.go.
func WithArgoCDNamespace ¶ added in v0.3.0
func WithArgoCDNamespace(namespace string) KubernetesDatabaseOption
func WithArgoClient ¶ added in v0.3.0
func WithArgoClient(argoClient client.Client) KubernetesDatabaseOption
func WithGlobalCredentialsNamespaces ¶ added in v0.3.0
func WithGlobalCredentialsNamespaces(namespaces []string) KubernetesDatabaseOption