annotations

package
v1.11.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	COMMENT_CFG_SNIPPET_END   = "  ###_config-snippet_### END"
	COMMENT_CFG_SNIPPET_BEGIN = "  ###_config-snippet_### BEGIN"
	BACKEND                   = "backend"
	COMMMENT_INGRESS_PREFIX   = "### ingress:"
	COMMENT_ENDING            = " ###"
	COMMENT_CONFIGMAP_PREFIX  = "### configmap:"
	COMMMENT_SERVICE_PREFIX   = "### service:"
	SERVICE_NAME_PREFIX       = "svc_"
	INGRESS_NAME_PREFIX       = "ing_"
)

Variables

This section is empty.

Functions

func Bool

func Bool(name string, annotations ...map[string]string) (out bool, err error)

func CheckBackendConfigSnippetError added in v1.11.0

func CheckBackendConfigSnippetError(configErr error, cfgDir string) (rerun bool, err error)

func DisableConfigSnippets added in v1.11.0

func DisableConfigSnippets(disableConfigSnippets string)

DisableConfigSnippets fills a map[cfgSnippetType]struct{} of disabled config snippet types: - backend/frontend/global and store it in the global var cfgSnippet from a comma separated list : all,backend,frontend,global. If "all" is present in the list, then: backend, frontend and global config snippets are disabled.

func InitCfgSnippet added in v1.11.0

func InitCfgSnippet()

func Int

func Int(name string, annotations ...map[string]string) (out int, err error)

func IsConfigSnippetDisabled added in v1.11.0

func IsConfigSnippetDisabled(name CfgSnippetType) bool

func ModelBackend

func ModelBackend(name, defaultNS string, k store.K8s, annotations ...map[string]string) (backend *models.Backend, err error)

ModelBackend takes an annotation holding the path of a backend cr and returns corresponding Backend model

func ModelDefaults

func ModelDefaults(name, defaultNS string, k store.K8s, annotations ...map[string]string) (defaults *models.Defaults, err error)

ModelDefaults takes an annotation holding the path of a defaults cr and returns corresponding Defaults model

func ModelGlobal

func ModelGlobal(name, defaultNS string, k store.K8s, annotations ...map[string]string) (global *models.Global, err error)

ModelGlobal takes an annotation holding the path of a global cr and returns corresponding Global model

func ModelLog

func ModelLog(name, defaultNS string, k store.K8s, annotations ...map[string]string) (log models.LogTargets, err error)

ModelLog takes an annotation holding the path of a global cr and returns corresponding LogTargerts model

func ParseBool

func ParseBool(name string, annotations ...map[string]string) (out string, err error)

func RemoveBackendCfgSnippet

func RemoveBackendCfgSnippet(backend string)

func Secret

func Secret(name, defaultNs string, k store.K8s, annotations ...map[string]string) (secret *store.Secret, err error)

func SetDefaultValue

func SetDefaultValue(annotation, value string)

func String

func String(name string, annotations ...map[string]string) string

func Timeout

func Timeout(name string, annotations ...map[string]string) (out *int64, err error)

func UpdateFrontendCfgSnippet

func UpdateFrontendCfgSnippet(api api.HAProxyClient, frontends ...string) (updated []string, err error)

func UpdateGlobalCfgSnippet

func UpdateGlobalCfgSnippet(api api.HAProxyClient) (updated []string, err error)

Types

type Annotation

type Annotation interface {
	GetName() string
	Process(k store.K8s, annotations ...map[string]string) error
}

type Annotations

type Annotations interface {
	GlobalCfgSnipp() []Annotation
	Global(g *models.Global, l *models.LogTargets) []Annotation
	Defaults(d *models.Defaults) []Annotation
	Backend(b *models.Backend, s store.K8s, c certs.Certificates) []Annotation
	Frontend(i *store.Ingress, r *rules.List, m maps.Maps) []Annotation
	Secret(name, defaultNs string, k store.K8s, annotations ...map[string]string) (secret *store.Secret, err error)
	Timeout(name string, annotations ...map[string]string) (out *int64, err error)
	String(name string, annotations ...map[string]string) string
}

func New

func New() Annotations

type CfgSnippet

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

func NewCfgSnippet added in v1.11.0

func NewCfgSnippet(opts ConfigSnippetOptions) *CfgSnippet

func (*CfgSnippet) GetName

func (a *CfgSnippet) GetName() string

func (*CfgSnippet) Process

func (a *CfgSnippet) Process(k store.K8s, annotations ...map[string]string) error

func (*CfgSnippet) SetService added in v1.11.0

func (a *CfgSnippet) SetService(service *store.Service)

type CfgSnippetType added in v1.11.0

type CfgSnippetType string

CfgSnippetType represents type of a config snippet

const (
	// CfgSnippetType values
	ConfigSnippetBackend  CfgSnippetType = "backend"
	ConfigSnippetFrontend CfgSnippetType = "frontend"
	ConfigSnippetGlobal   CfgSnippetType = "global"
)

type ConfigSnippetHandler added in v1.11.0

type ConfigSnippetHandler struct{}

func (ConfigSnippetHandler) Update added in v1.11.0

func (h ConfigSnippetHandler) Update(k store.K8s, api haproxy.HAProxy, ann Annotations) (err error)

type ConfigSnippetOptions added in v1.11.0

type ConfigSnippetOptions struct {
	Name     string
	Backend  *string
	Frontend *string
	Ingress  *store.Ingress
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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