secretbootstrap

package
v0.0.0-...-d1f8b28 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const OSDGlobalPullSecretGroupName = "osd_global_pull_secret"
View Source
const OpenShiftConfigPullSecretGroupName = "openshift_config_pull_secret"

Variables

This section is empty.

Functions

func ByDestination

func ByDestination(targetTo *SecretContext) secretConfigFilter

Filter secret that targets a specific destination.

func ByDestinationFunc

func ByDestinationFunc(predicate func(*SecretContext) bool) secretConfigFilter

Filter secrets for which at least one destination matches a predicate function.

func ExplainFilters

func ExplainFilters(filters ...secretConfigFilter) string

func LoadConfigFromFile

func LoadConfigFromFile(file string, config *Config) error

LoadConfigFromFile renders a Config object loaded from the given file

func SaveConfigToFile

func SaveConfigToFile(file string, config *Config) error

SaveConfigToFile serializes a Config object to the given file

Types

type Config

type Config struct {
	VaultDPTPPrefix           string              `json:"vault_dptp_prefix,omitempty"`
	ClusterGroups             map[string][]string `json:"cluster_groups,omitempty"`
	Secrets                   []SecretConfig      `json:"secret_configs"`
	UserSecretsTargetClusters []string            `json:"user_secrets_target_clusters,omitempty"`
}

Config is what we version in our repository

func (*Config) MarshalJSON

func (c *Config) MarshalJSON() ([]byte, error)

func (*Config) OSDGlobalPullSecretGroup

func (c *Config) OSDGlobalPullSecretGroup() []string

OSDGlobalPullSecretGroup returns the list of the OSD cluster names where we need to partially manage the global pull secret

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(d []byte) error

func (*Config) Validate

func (c *Config) Validate() error

type DockerAuth

type DockerAuth struct {
	Auth  string `json:"auth"`
	Email string `json:"email,omitempty"`
}

type DockerConfigJSON

type DockerConfigJSON struct {
	Auths map[string]DockerAuth `json:"auths"`
}

type DockerConfigJSONData

type DockerConfigJSONData struct {
	Item        string `json:"item"`
	RegistryURL string `json:"registry_url"`
	AuthField   string `json:"auth_field"`
	EmailField  string `json:"email_field,omitempty"`
}

type ItemContext

type ItemContext struct {
	Item                 string                 `json:"item,omitempty"`
	Field                string                 `json:"field,omitempty"`
	DockerConfigJSONData []DockerConfigJSONData `json:"dockerconfigJSON,omitempty"`
	// If the secret should be base64 decoded before uploading to kube. Encoding
	// it is useful to be able to store binary data.
	Base64Decode bool `json:"base64_decode,omitempty"`
}

type SecretConfig

type SecretConfig struct {
	From map[string]ItemContext `json:"from"`
	To   []SecretContext        `json:"to"`
}

func FindSecret

func FindSecret(secrets []SecretConfig, filters ...secretConfigFilter) (*SecretConfig, int)

FindSecret returns the first secret that matches all filters. If found, the second argument represents the secret's index, -1 otherwise.

type SecretContext

type SecretContext struct {
	// A cluster to target. Mutually exclusive with 'ClusterGroups'
	Cluster string `json:"cluster,omitempty"`
	// A list of clusterGroups to target. Mutually exclusive with 'cluster'
	ClusterGroups []string          `json:"cluster_groups,omitempty"`
	Namespace     string            `json:"namespace"`
	Name          string            `json:"name"`
	Type          corev1.SecretType `json:"type,omitempty"`
}

func (SecretContext) String

func (sc SecretContext) String() string

Jump to

Keyboard shortcuts

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