Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type K8sRESTConfigFactory ¶
type K8sRESTConfigFactory struct {
// contains filtered or unexported fields
}
K8sRESTConfigFactory is an implementation of the RESTConfigFactory interface that doles out configs based on a base one.
func NewRESTConfigFactory ¶
func NewRESTConfigFactory(cfg *rest.Config, insecure bool) *K8sRESTConfigFactory
NewRestConfigFactory creates and returns a RESTConfigFactory with a known config.
type KubeSecretGetter ¶
type KubeSecretGetter struct {
// contains filtered or unexported fields
}
KubeSecretGetter is an implementation of SecretGetter.
func New ¶
func New(c RESTConfigFactory) *KubeSecretGetter
New creates and returns a KubeSecretGetter that looks up secrets in k8s.
func NewFromConfig ¶
func NewFromConfig(cfg *rest.Config, insecure bool) *KubeSecretGetter
NewFromConfig creates a secret getter from a rest.Config.
func (KubeSecretGetter) SecretToken ¶
func (k KubeSecretGetter) SecretToken(ctx context.Context, authToken string, id types.NamespacedName, key string) (string, error)
SecretToken looks for a namespaced secret, and returns the 'token' key from it, or an error if not found.
type MockSecret ¶
type MockSecret struct {
// contains filtered or unexported fields
}
MockSecret implements the SecretGetter interface.
func (MockSecret) AddStubResponse ¶
func (k MockSecret) AddStubResponse(authToken string, secretID types.NamespacedName, token, key string)
AddStubResponse is a mock method that sets up a token to be returned.
func (MockSecret) SecretToken ¶
func (k MockSecret) SecretToken(ctx context.Context, authToken string, secretID types.NamespacedName, key string) (string, error)
Secret implements the SecretGetter interface.
type RESTConfigFactory ¶
RESTConfigFactory creates and returns new Kubernetes client configurations for accessing the API.
type SecretGetter ¶
type SecretGetter interface {
SecretToken(ctx context.Context, authToken string, id types.NamespacedName, key string) (string, error)
}
SecretGetter takes a namespaced name and finds a secret with that name, or returns an error.