config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRSpec

type CRSpec struct {
	// relative to manifestsRoot folder, ex. ./manifests/base
	Profile          string                `json:"profile" yaml:"profile"`
	Secrets          map[string]NameValues `json:"secrets,omitempty" yaml:"secrets,omitempty"`
	Configs          map[string]NameValues `json:"configs,omitempty" yaml:"configs,omitempty"`
	ManifestsRoot    string                `json:"manifestsRoot,omitempty" yaml:"manifestsRoot,omitempty"`
	RotateKeys       string                `json:"rotateKeys,omitempty" yaml:"rotateKeys,omitempty"`
	StorageClassName string                `json:"storageClassName,omitempty" yaml:"storageClassName,omitempty"`
	Git              *Repo                 `json:"git,omitempty" yaml:"git,omitempty"`
	OpsRunner        *OpsRunner            `json:"opsRunner,omitempty" yaml:"opsRunner,omitempty"`
	FetchSource      *Repo                 `json:"fetchSource,omitempty" yaml:"fetchSource,omitempty"`
	TlsCertHost      string                `json:"tlsCertHost,omitempty" yaml:"tlsCertHost,omitempty"`
	TlsCertOrg       string                `json:"tlsCertOrg,omitempty" yaml:"tlsCertOrg,omitempty"`
}

CRSpec defines the configuration for the whole manifests It is expecting in the manifestsRoot folder two subfolders .operator and .configuration exist operator will add patch into .operator folder customer will add patch into .configuration folder

func (*CRSpec) AddToConfigs

func (cr *CRSpec) AddToConfigs(svcName, name, value string)

func (*CRSpec) AddToSecrets

func (cr *CRSpec) AddToSecrets(svcName, name, value, secretName string)

AddToSecrets adds pieces to the secret section to the CR if secretName is provided value is ignored secretName is a kubernetes secret resource name, that already/will exist in the cluster

func (*CRSpec) DeepCopy

func (in *CRSpec) DeepCopy() *CRSpec

func (*CRSpec) DeepCopyInto

func (in *CRSpec) DeepCopyInto(out *CRSpec)

func (*CRSpec) GetFromSecrets

func (cr *CRSpec) GetFromSecrets(svcName, name string) string

GetFromSecrets return value of the secret that exist in serets map of the spec

func (*CRSpec) GetImageRegistry added in v0.0.37

func (crs *CRSpec) GetImageRegistry() string

func (*CRSpec) GetManifestsRoot

func (cr *CRSpec) GetManifestsRoot() string

func (*CRSpec) GetProfileDir

func (cr *CRSpec) GetProfileDir() string

func (*CRSpec) IsEqualExceptOpsRunner added in v0.1.2

func (crs *CRSpec) IsEqualExceptOpsRunner(anotherSpec *CRSpec) bool

type CustomMetadata added in v0.0.36

type CustomMetadata struct {
	Name        string            `json:"name,omitempty" yaml:"name,omitempty"`
	Labels      map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
}

type KApiCr

type KApiCr struct {
	metav1.TypeMeta   `json:",inline" yaml:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Spec              *CRSpec `json:"spec" yaml:"spec"`
}

func ReadCRSpecFromEnvYaml

func ReadCRSpecFromEnvYaml() (*KApiCr, error)

ReadCRSpecFromEnvYaml return CR config from env yaml

func ReadCRSpecFromFile

func ReadCRSpecFromFile(file io.Reader) (*KApiCr, error)

ReadCRSpecFromFile return CR config from yaml file

func (*KApiCr) DeepCopy

func (in *KApiCr) DeepCopy() *KApiCr

func (*KApiCr) DeepCopyInto

func (in *KApiCr) DeepCopyInto(out *KApiCr)

type NameValue

type NameValue struct {
	Name      string     `yaml:"name" json:"name"`
	Value     string     `yaml:"value,omitempty" json:"value,omitempty"`
	ValueFrom *ValueFrom `yaml:"valueFrom,omitempty" json:"valueFrom,omitempty"`
}

func (NameValue) GetSecretValue

func (nv NameValue) GetSecretValue() string

type NameValues

type NameValues []NameValue

operator-sdk needs named type

type OpsRunner added in v0.1.2

type OpsRunner struct {
	Enabled     string `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	Schedule    string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
	WatchBranch string `json:"watchBranch,omitempty" yaml:"watchBranch,omitempty"`
	Image       string `json:"image,omitempty" yaml:"image,omitempty"`
}

type Repo

type Repo struct {
	Repository  string `json:"repository"`
	UserName    string `json:"userName,omitempty" yaml:"userName,omitempty"`
	Password    string `json:"password,omitempty" yaml:"password,omitempty"`
	AccessToken string `json:"accessToken,omitempty" yaml:"accessToken,omitempty"`
	SecretName  string `json:"secretName,omitempty" yaml:"secretName,omitempty"`
}

func (*Repo) GetAccessToken

func (repo *Repo) GetAccessToken() (string, error)

type SecretKeyRef

type SecretKeyRef struct {
	Name string `yaml:"name" json:"name"`
	Key  string `yaml:"key" json:"key"`
}

type SelectivePatch

type SelectivePatch struct {
	ApiVersion string          `yaml:"apiVersion"`
	Kind       string          `yaml:"kind"`
	Metadata   *CustomMetadata `yaml:"metadata"`
	Enabled    bool            `yaml:"enabled"`
	Default    bool            `yaml:"default,omitempty"`
	Patches    []types.Patch   `yaml:"patches,omitempty"`
}

type SupperConfigMap

type SupperConfigMap struct {
	ApiVersion string            `yaml:"apiVersion"`
	Kind       string            `yaml:"kind"`
	Metadata   map[string]string `yaml:"metadata,omitempty"`
	Data       map[string]string `yaml:"data,omitempty"`
}

type SupperSecret

type SupperSecret struct {
	ApiVersion string            `yaml:"apiVersion"`
	Kind       string            `yaml:"kind"`
	Metadata   map[string]string `yaml:"metadata,omitempty"`
	Data       map[string]string `yaml:"data,omitempty"`
	StringData map[string]string `yaml:"stringData,omitempty"`
}

type ValueFrom

type ValueFrom struct {
	SecretKeyRef *SecretKeyRef `yaml:"secretKeyRef" json:"secretKeyRef"`
}

Jump to

Keyboard shortcuts

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