context

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const EnvironmentVariableStage = "STAGE"
View Source
const EnvironmentVariableTargetNamespace = "POD_NAMESPACE"
View Source
const SecretDockerRegistry = "k8s-dogu-operator-docker-registry"
View Source
const SecretDoguRegistry = "k8s-dogu-operator-dogu-registry"
View Source
const SetupConfigConfigmap = "k8s-ces-setup-config"
View Source
const SetupConfigConfigmapDevPath = "k8s/dev-resources/k8s-ces-setup.yaml"
View Source
const SetupStartUpConfigMap = "k8s-ces-setup-json"
View Source
const SetupStartUpConfigMapDevPath = "k8s/dev-resources/setup.json"
View Source
const SetupStateConfigMap = "k8s-setup-config"
View Source
const SetupStateInstalled = "installed"
View Source
const SetupStateInstalling = "installing"
View Source
const SetupStateKey = "state"
View Source
const StageDevelopment = "development"

Variables

This section is empty.

Functions

func GetEnvVar added in v0.5.0

func GetEnvVar(name string) (string, error)

GetEnvVar returns an arbitrary environment variable; otherwise it returns an error

func GetSetupStateConfigMap added in v0.5.0

func GetSetupStateConfigMap(client kubernetes.Interface, namespace string) (*corev1.ConfigMap, error)

GetSetupStateConfigMap returns or creates if it does not exist the configmap map for presenting the state of the setup process

Types

type Config

type Config struct {
	// LogLevel sets the log level for the app
	LogLevel logrus.Level `yaml:"log_level"`
	// TargetNamespace represents the namespace that is created for the ecosystem
	TargetNamespace string `yaml:"target_namespace"`
	// DoguOperatorResourceURL sets the K8s resource URL which controls the installation of the operator into the current cluster.
	DoguOperatorURL string `yaml:"dogu_operator_url"`
	// ServiceDiscoveryURL sets the K8s resource URL which controls the installation of the service discovery into the current cluster.
	ServiceDiscoveryURL string `yaml:"service_discovery_url"`
	// EtcdServerResourceURL sets the K8s resource URL which controls the installation of the etcd server into the current cluster.
	EtcdServerResourceURL string `yaml:"etcd_server_url"`
	// EtcdServerResourceURL sets the K8s resource URL which controls the installation of the etcd server into the current cluster.
	EtcdClientImageRepo string `yaml:"etcd_client_image_repo"`
	// KeyProvider sets the key provider used to encrypt etcd values
	KeyProvider string `yaml:"key_provider"`
	// RemoteRegistryURLSchema sets the url schema for the remote registry. It can be empty, "default" or "index"
	RemoteRegistryURLSchema string `yaml:"remote_registry_url_schema"`
}

Config contains the common configuration for the setup

func ReadConfigFromCluster added in v0.5.0

func ReadConfigFromCluster(client kubernetes.Interface, namespace string) (*Config, error)

ReadConfigFromCluster reads the setup config from the cluster state

func ReadConfigFromFile added in v0.5.0

func ReadConfigFromFile(path string) (*Config, error)

ReadConfigFromFile reads the application configuration from a configuration file.

type CustomKeyValue added in v0.4.0

type CustomKeyValue map[string]map[string]interface{}

CustomKeyValue is a map of string -> map pairs.

type Dogus added in v0.4.0

type Dogus struct {
	DefaultDogu string   `json:"defaultDogu"`
	Install     []string `json:"install"`
	Completed   bool     `json:"completed"`
}

Dogus struct defines which dogus are installed and which one is the default.

type Naming added in v0.4.0

type Naming struct {
	Fqdn            string `json:"fqdn"`
	Domain          string `json:"domain"`
	CertificateType string `json:"certificateType"`
	Certificate     string `json:"certificate"`
	CertificateKey  string `json:"certificateKey"`
	RelayHost       string `json:"relayHost"`
	MailAddress     string `json:"mailAddress"`
	Completed       bool   `json:"completed"`
	UseInternalIp   bool   `json:"useInternalIp"` //todo look at this
	InternalIp      string `json:"internalIp"`
}

Naming settings such as fqdn, hostname and domain.

type SetupConfiguration added in v0.4.0

type SetupConfiguration struct {
	Naming                  Naming         `json:"naming"`
	Dogus                   Dogus          `json:"dogus"`
	Admin                   User           `json:"admin"`
	UserBackend             UserBackend    `json:"userBackend"`
	RegistryConfig          CustomKeyValue `json:"registryConfig"`
	RegistryConfigEncrypted CustomKeyValue `json:"registryConfigEncrypted"`
}

SetupConfiguration is the main struct for the configuration of the setup.

func ReadSetupConfigFromCluster added in v0.5.0

func ReadSetupConfigFromCluster(client kubernetes.Interface, namespace string) (*SetupConfiguration, error)

ReadSetupConfigFromCluster reads the setup configuration from the configmap

func ReadSetupConfigFromFile added in v0.5.0

func ReadSetupConfigFromFile(path string) (*SetupConfiguration, error)

ReadSetupConfigFromFile reads the setup configuration from a setup json file.

func (*SetupConfiguration) IsCompleted added in v0.4.0

func (conf *SetupConfiguration) IsCompleted() bool

IsCompleted checks if a SetupConfiguration is completed.

type SetupContext

type SetupContext struct {
	AppVersion           string              `yaml:"app_version"`
	AppConfig            *Config             `yaml:"app_config"`
	StartupConfiguration *SetupConfiguration `json:"startup_configuration"`
}

SetupContext contains all context information provided by the setup.

type SetupContextBuilder added in v0.5.0

type SetupContextBuilder struct {
	DevSetupConfigPath   string
	DevStartupConfigPath string
	// contains filtered or unexported fields
}

SetupContextBuilder contains information to create a setup context

func NewSetupContextBuilder added in v0.5.0

func NewSetupContextBuilder(version string) *SetupContextBuilder

NewSetupContextBuilder creates a new builder to create a setup context. Default dev resources paths are used.

func (*SetupContextBuilder) NewSetupContext added in v0.5.0

func (scb *SetupContextBuilder) NewSetupContext(clientSet kubernetes.Interface) (*SetupContext, error)

NewSetupContext creates a new setup context.

type User added in v0.4.0

type User struct {
	Username        string `json:"username"`
	Mail            string `json:"mail"`
	Password        string `json:"password"`
	AdminGroup      string `json:"adminGroup"`
	Completed       bool   `json:"completed"`
	AdminMember     bool   `json:"adminMember"`
	SendWelcomeMail bool   `json:"sendWelcomeMail"`
}

User account for a ces instance.

type UserBackend added in v0.4.0

type UserBackend struct {
	DsType             string `json:"dsType"`
	Server             string `json:"server"`
	AttributeID        string `json:"attributeID"`
	AttributeGivenName string `json:"attributeGivenName"`
	AttributeSurname   string `json:"attributeSurname"`
	AttributeFullname  string `json:"attributeFullname"`
	AttributeMail      string `json:"attributeMail"`
	AttributeGroup     string `json:"attributeGroup"`
	BaseDN             string `json:"baseDN"`
	SearchFilter       string `json:"searchFilter"`
	ConnectionDN       string `json:"connectionDN"`
	Password           string `json:"password"`
	Host               string `json:"host"`
	Port               string `json:"port"`
	LoginID            string `json:"loginID"`
	LoginPassword      string `json:"loginPassword"`
	Encryption         string `json:"encryption"`
	Completed          bool   `json:"completed"`

	GroupBaseDN               string `json:"groupBaseDN"`
	GroupSearchFilter         string `json:"groupSearchFilter"`
	GroupAttributeName        string `json:"groupAttributeName"`
	GroupAttributeDescription string `json:"groupAttributeDescription"`
	GroupAttributeMember      string `json:"groupAttributeMember"`
}

UserBackend contains configuration for the directory service.

Jump to

Keyboard shortcuts

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