authenticator

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigMapName = "ns-secret-map"

	MirrorCredName = "registry-mirror-cred"
)

Variables

This section is empty.

Functions

func NewECRSecret added in v0.2.0

func NewECRSecret(config *rest.Config) (*ecrSecret, error)

func NewTargetClusterClient added in v0.2.8

func NewTargetClusterClient(logger logr.Logger, config *rest.Config, client client.Client) *targetClusterClient

Types

type Authenticator

type Authenticator interface {
	// Initialize Points Authenticator to target cluster
	Initialize(clusterName string) error

	// AuthFilename Gets Authentication File Path for OCI Registry
	AuthFilename() string

	// AddToConfigMap Adds Namespace to config map
	AddToConfigMap(ctx context.Context, name, namespace string) error

	// DelFromConfigMap Removes Namespace from config map
	DelFromConfigMap(ctx context.Context, name, namespace string) error

	// GetSecretValues Retrieves ImagePullSecrets data to pass to helm chart
	GetSecretValues(ctx context.Context, namespace string) (map[string]interface{}, error)

	// AddSecretToAllNamespace Add Secrets to all namespaces
	AddSecretToAllNamespace(ctx context.Context) error
}

Authenticator is an interface for creating an authentication file with credentials to private registries

Currently this is used with the Helm Driver which takes credentials in this way For this first implementation, kubernetes secrets will be used to pass in a token

type DockerAuth

type DockerAuth struct {
	Auths map[string]DockerAuthRegistry `json:"auths,omitempty"`
}

DockerAuth Structure for the authentication file

type DockerAuthRegistry

type DockerAuthRegistry struct {
	Auth string `json:"auth"`
}

type TargetClusterClient added in v0.2.8

type TargetClusterClient interface {
	// Init the target cluster client
	Initialize(ctx context.Context, clusterName string) error

	// GetServerVersion of the target api server
	GetServerVersion(ctx context.Context, clusterName string) (info *version.Info, err error)

	// CreateClusterNamespace for the workload cluster.
	CreateClusterNamespace(ctx context.Context, clusterName string) (err error)

	// CheckNamespace tests for the existence of a namespace.
	CheckNamespace(ctx context.Context, namespace string) bool

	// ApplySecret for the workload cluster
	ApplySecret(ctx context.Context, secret *corev1.Secret) (err error)

	// Implement RESTClientGetter
	ToRESTConfig() (*rest.Config, error)
	ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
	ToRESTMapper() (meta.RESTMapper, error)
	ToRawKubeConfigLoader() clientcmd.ClientConfig
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL