config

package
v2.11.26 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretsConfigName       = "config-secrets"
	BuildImagePushSecretKey = "build.imagePushSecrets"
	GoogleServiceAccountKey = "wi.googleServiceAccount"
	GoogleProjectIDKey      = "wi.googleProjectID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func FromContext

func FromContext(ctx context.Context) *Config

FromContext gets the *Config from the context.

func (*Config) Secrets

func (c *Config) Secrets() (*SecretsConfig, error)

Secrets returns the SecretsConfig and an error if there was an issue loading the config.

type SecretsConfig

type SecretsConfig struct {
	// BuildImagePushSecrets are the names of the Secrets that should be used
	// in each space to push images via the build pipeline.
	BuildImagePushSecrets []corev1.ObjectReference

	// GoogleProjectID is the GCP project ID used with Workload Identity. If
	// left empty, the metadata server will be used to fetch it.
	GoogleProjectID string

	// GoogleServiceAccount is the GSA that is linked to the KSA in each space
	// for Workload Identity. If it's empty, then WI is disabled and the Kf
	// controllers will not make calls to the IAM API.
	GoogleServiceAccount string
}

SecretsConfig contains the configuration defined in the build secrets config map.

func NewSecretsConfigFromConfigMap

func NewSecretsConfigFromConfigMap(
	configMap *corev1.ConfigMap,
) (*SecretsConfig, error)

NewSecretsConfigFromConfigMap creates a SecretConfig from the supplied ConfigMap

type Store

type Store struct {
	*configmap.UntypedStore
}

Store is based on configmap.UntypedStore and is used to store and watch for updates to configuration related to Secrets.

func NewSecretsConfigStore

func NewSecretsConfigStore(logger configmap.Logger) *Store

NewSecretsConfigStore creates a secrets config store populated with default keys and values.

func NewStore

func NewStore(
	logger configmap.Logger,
	onAfterStore ...func(name string, value interface{}),
) *Store

NewStore creates a configmap.UntypedStore based config store.

logger must be non-nil implementation of configmap.Logger (commonly used loggers conform)

onAfterStore is a variadic list of callbacks to run after the ConfigMap has been processed and stored.

See also: configmap.NewUntypedStore().

func (*Store) ToContext

func (s *Store) ToContext(ctx context.Context) context.Context

ToContext loads the SecretsConfig from the store into the context. If there is an error loading the secrets config, the error is stored on the Config type.

Jump to

Keyboard shortcuts

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