operator

package
v0.0.0-...-fc29aca Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: UPL-1.0 Imports: 14 Imported by: 0

Documentation

Overview

Package operator package contains types and functions used directly by the Operator main

Index

Constants

View Source
const (
	DefaultRestHost       = "0.0.0.0"
	DefaultRestPort int32 = 8000

	// DefaultCertValidity makes new certificates default to a one-year expiration
	DefaultCertValidity = 365 * 24 * time.Hour
	// DefaultRotateBefore defines how long before expiration a certificate
	// should be re-issued
	DefaultRotateBefore = 24 * time.Hour

	// CertFileName is used for Certificates inside a secret
	CertFileName = "tls.crt"
	// KeyFileName is used for Private Keys inside a secret
	KeyFileName = "tls.key"

	CertTypeSelfSigned    = "self-signed"
	CertTypeCertManager   = "cert-manager"
	CertTypeManual        = "manual"
	CertManagerIssuerName = "coherence-webhook-server-issuer"

	DefaultMutatingWebhookName   = "coherence-operator-mutating-webhook-configuration"
	DefaultValidatingWebhookName = "coherence-operator-validating-webhook-configuration"

	FlagCACertRotateBefore    = "ca-cert-rotate-before"
	FlagCACertValidity        = "ca-cert-validity"
	FlagCertType              = "cert-type"
	FlagCertIssuer            = "cert-issuer"
	FlagCoherenceImage        = "coherence-image"
	FlagCRD                   = "install-crd"
	FlagDevMode               = "coherence-dev-mode"
	FlagDryRun                = "dry-run"
	FlagEnableWebhook         = "enable-webhook"
	FlagGlobalAnnotation      = "global-annotation"
	FlagGlobalLabel           = "global-label"
	FlagHealthAddress         = "health-addr"
	FlagLeaderElection        = "enable-leader-election"
	FlagMetricsAddress        = "metrics-addr"
	FlagMutatingWebhookName   = "mutating-webhook-name"
	FlagOperatorNamespace     = "operator-namespace"
	FlagRackLabel             = "rack-label"
	FlagRestHost              = "rest-host"
	FlagRestPort              = "rest-port"
	FlagServiceName           = "service-name"
	FlagServicePort           = "service-port"
	FlagSiteLabel             = "site-label"
	FlagSkipServiceSuspend    = "skip-service-suspend"
	FlagOperatorImage         = "operator-image"
	FlagValidatingWebhookName = "validating-webhook-name"
	FlagWebhookCertDir        = "webhook-cert-dir"
	FlagWebhookSecret         = "webhook-secret"
	FlagWebhookService        = "webhook-service"

	// EnvVarWatchNamespace is the environment variable to use to set the watch namespace(s)
	EnvVarWatchNamespace = "WATCH_NAMESPACE"
	// EnvVarCoherenceImage is the environment variable to use to set the default Coherence image
	EnvVarCoherenceImage = "COHERENCE_IMAGE"

	// LabelOciNodeFaultDomain is the OCI Node label for the fault domain.
	LabelOciNodeFaultDomain = "oci.oraclecloud.com/fault-domain"

	// LabelHostName is the Node label for the Node's hostname.
	LabelHostName = "kubernetes.io/hostname"
)

Variables

Functions

func DetectKubernetesVersion

func DetectKubernetesVersion(cs clients.ClientSet) (*version.Version, error)

func GetCACertRotateBefore

func GetCACertRotateBefore() time.Duration

func GetDefaultCoherenceImage

func GetDefaultCoherenceImage() string

func GetDefaultOperatorImage

func GetDefaultOperatorImage() string

func GetGlobalAnnotations

func GetGlobalAnnotations(v *viper.Viper) (map[string]string, error)

func GetGlobalAnnotationsNoError

func GetGlobalAnnotationsNoError() map[string]string

func GetGlobalLabels

func GetGlobalLabels(v *viper.Viper) (map[string]string, error)

func GetGlobalLabelsNoError

func GetGlobalLabelsNoError() map[string]string

func GetNamespace

func GetNamespace() string

func GetRackLabel

func GetRackLabel() []string

func GetRestHost

func GetRestHost() string

func GetRestPort

func GetRestPort() int32

func GetRestServiceName

func GetRestServiceName() string

func GetRestServicePort

func GetRestServicePort() int32

func GetSiteLabel

func GetSiteLabel() []string

func GetVersion

func GetVersion() string

GetVersion returns the Operator version. The Operator version is injected at compile time. In development environments, for example running in an IDE where the version has not been injected the version 999.0.0 will be returned

func GetViper

func GetViper() *viper.Viper

func GetWatchNamespace

func GetWatchNamespace() []string

GetWatchNamespace returns the Namespace(s) the operator should be watching for changes

func GetWebhookCertDir

func GetWebhookCertDir() string

func GetWebhookServiceDNSNames

func GetWebhookServiceDNSNames() []string

func IsDevMode

func IsDevMode() bool

func IsDryRun

func IsDryRun() bool

func SetVersion

func SetVersion(v string)

func SetViper

func SetViper(v *viper.Viper)

func SetupFlags

func SetupFlags(cmd *cobra.Command, v *viper.Viper)

func SetupOperatorManagerFlags

func SetupOperatorManagerFlags(cmd *cobra.Command, v *viper.Viper)

func ShouldEnableWebhooks

func ShouldEnableWebhooks() bool

func ShouldInstallCRDs

func ShouldInstallCRDs() bool

func ShouldUseCertManager

func ShouldUseCertManager() bool

func ShouldUseSelfSignedCerts

func ShouldUseSelfSignedCerts() bool

func ValidateFlags

func ValidateFlags(v *viper.Viper) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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