config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// StageDevelopment is the name for the development-stage
	StageDevelopment = "development"
	// StageProduction is the name for the production-stage
	StageProduction = "production"
	// StageEnvironmentVariable is the name of the environment-variable containing the configured stage
	StageEnvironmentVariable = "STAGE"
)

Variables

View Source
var (
	Stage = StageProduction
)

Functions

This section is empty.

Types

type EndpointSchema added in v0.1.0

type EndpointSchema string
const EndpointSchemaOCI EndpointSchema = "oci"

type HelmRepositoryData

type HelmRepositoryData struct {
	// Endpoint contains the Helm registry endpoint URL.
	Endpoint string `json:"endpoint" yaml:"endpoint"`
	// Schema describes the way how clients communicate with the Helm registry endpoint.
	Schema EndpointSchema `json:"schema" yaml:"schema"`
	// PlainHttp indicates that the repository endpoint should be accessed using plain http
	PlainHttp bool `json:"plainHttp,omitempty" yaml:"plainHttp,omitempty"`
	// InsecureTls allows invalid or selfsigned certificates to be used. This option may be overridden by PlainHttp which forces HTTP traffic.
	InsecureTLS bool `json:"insecureTls" yaml:"insecureTls"`
}

HelmRepositoryData contains all necessary data for the helm repository.

func GetHelmRepositoryData

func GetHelmRepositoryData(ctx context.Context, configMapClient configMapInterface) (*HelmRepositoryData, error)

GetHelmRepositoryData reads the repository data either from file or from a secret in the cluster.

func NewHelmRepoDataFromCluster added in v0.1.0

func NewHelmRepoDataFromCluster(ctx context.Context, configMapClient configMapInterface) (*HelmRepositoryData, error)

NewHelmRepoDataFromCluster reads the repo data ConfigMap, validates and returns it.

func NewHelmRepoDataFromFile added in v0.1.0

func NewHelmRepoDataFromFile(filepath string) (*HelmRepositoryData, error)

func (*HelmRepositoryData) URL added in v0.1.1

func (hrd *HelmRepositoryData) URL() string

URL returns the full URL Helm repository endpoint including schema.

type OperatorConfig

type OperatorConfig struct {
	// Namespace specifies the namespace that the operator is deployed to.
	Namespace string `json:"namespace"`
	// Version contains the current version of the operator
	Version *semver.Version `json:"version"`
	// HelmRepositoryData contains all necessary data for the helm repository.
	HelmRepositoryData *HelmRepositoryData `json:"helm_repository"`
}

OperatorConfig contains all configurable values for the dogu operator.

func NewOperatorConfig

func NewOperatorConfig(version string) (*OperatorConfig, error)

NewOperatorConfig creates a new operator config by reading values from the environment variables

Jump to

Keyboard shortcuts

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