v1alpha1

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

This package contains structure to describe a connection to a Postgres database

+kubebuilder:object:generate=true

Index

Constants

View Source
const (
	PrometheusScrapeAnnotationKey = "prometheus.io/scrape"
	PrometheusPathAnnotationKey   = "prometheus.io/path"
	PrometheusPortAnnotationKey   = "prometheus.io/port"
)
View Source
const (
	NetworkPoliciesAnnotationName     = "goharbor.io/network-policies"
	NetworkPoliciesAnnotationEnabled  = "true"
	NetworkPoliciesAnnotationDisabled = "false"
)
View Source
const (
	PortalHTTPPortName  = "http"
	PortalHTTPSPortName = "https"
)
View Source
const (
	ChartMuseumHTTPPortName  = "http"
	ChartMuseumHTTPSPortName = "https"
)
View Source
const (
	CoreHTTPPortName    = "http"
	CoreHTTPSPortName   = "https"
	CoreMetricsPortName = "metrics"
)
View Source
const (
	JobServiceHTTPPortName    = "http"
	JobServiceHTTPSPortName   = "https"
	JobServiceMetricsPortName = "metrics"
)
View Source
const (
	RegistryControllerHTTPPortName  = "http"
	RegistryControllerHTTPSPortName = "https"
)
View Source
const (
	RegistryAPIPortName     = "api"
	RegistryMetricsPortName = "metrics"
)
View Source
const (
	TrivyHTTPPortName  = "http"
	TrivyHTTPSPortName = "https"
)
View Source
const (
	CoreDatabase         = "core"
	NotaryServerDatabase = "notaryserver"
	NotarySignerDatabase = "notarysigner"
)
View Source
const (
	RedisScheme         = "redis"
	RedisSentinelScheme = "redis+sentinel"
)
View Source
const (
	// SecretTypeHTPasswd contains data needed for authenticate users against password.
	//
	// Required field:
	// - Secret.Data["auth"] - File containing user:password lines.
	SecretTypeHTPasswd corev1.SecretType = "goharbor.io/htpasswd" // nolint:gosec

	// HTPasswdFileName is the file of the users required for SecretTypeHTPasswd secrets.
	HTPasswdFileName = "htpasswd" // https://kubernetes.github.io/ingress-nginx/examples/auth/basic/#basic-authentication
)
View Source
const (
	// SecretTypeSharedSecret contains a single secret to share.
	//
	// Required field:
	// - Secret.Data["secret"] - secret to shared.
	SecretTypeSingle corev1.SecretType = "goharbor.io/single"

	// SharedSecretKey is the password required for SecretTypeSingle.
	SharedSecretKey = "secret"
)
View Source
const (
	// SecretTypeRedis contains a password to connect to redis.
	//
	// Required field:
	// - Secret.Data["redis-password"] - password to connect to redis, may be empty.
	SecretTypeRedis corev1.SecretType = "goharbor.io/redis"

	// RedisPasswordKey is the password to connect to redis.
	RedisPasswordKey = "redis-password" // https://github.com/bitnami/charts/blob/master/bitnami/redis/templates/secret.yaml#L14
)
View Source
const (
	// SecretTypeSharedSecret contains password for a postgresql user.
	//
	// Required field:
	// - Secret.Data["redis-password"] - password to connect to redis, may be empty.
	SecretTypePostgresql corev1.SecretType = "goharbor.io/postgresql"

	// PostgresqlPasswordKey is the password to connect to postgresql.
	PostgresqlPasswordKey = "postgresql-password" // nolint:gosec
)
View Source
const (
	// SecretTypeCSRF contains data needed for CSRF security.
	//
	// Required field:
	// - Secret.Data["key"] - CSRF key.
	SecretTypeCSRF corev1.SecretType = "goharbor.io/csrf" // nolint:gosec

	// CSRFSecretKey is the key for SecretTypeCSRF.
	CSRFSecretKey = "key"
)
View Source
const (
	// SecretTypeNotarySignerAliases contains aliases for encryption keys.
	// Only "default" key is required.
	// Keys must match [a-zA-Z]([a-zA-Z0-9_]*[a-zA-Z0-9])?
	// Passwords may be any string.
	//
	// Required field:
	// - Secret.Data["default"] - The default password.
	SecretTypeNotarySignerAliases corev1.SecretType = "goharbor.io/notary-signer-aliases"

	// SharedSecretKey is the default password to use.
	DefaultAliasSecretKey = "default"
)
View Source
const (
	// SecretTypeGithubToken contains credentials to contact Github API.
	//
	// Required field:
	// - Secret.Data["github-token"] - The Github token.
	SecretTypeGithubToken corev1.SecretType = "goharbor.io/github" // nolint:gosec

	// GithubTokenKey is the token to use with the account.
	GithubTokenKey = "github-token"
)
View Source
const (
	// SecretTypeRegistry contains secret to configure a Docker registry.
	//
	// Registry try to yaml unmarshal fields.
	// So all fields must be yaml marshalled.
	// Otherwise, a string starting with yaml special character may break the configuration.
	SecretTypeRegistry corev1.SecretType = "goharbor.io/registry" // nolint:gosec

	// RegistryHTTPSecret is the http secret.
	RegistryHTTPSecret = "REGISTRY_HTTP_SECRET" // nolint:gosec
)
View Source
const (
	HTTPSPort = 443
	HTTPPort  = 80
)
View Source
const (
	ExporterMetricsPortName = "metrics"
)
View Source
const (
	// JaegerAgentPasswordKey is the password to connect to jaeger.
	JaegerAgentPasswordKey = "jaeger-password"
)
View Source
const (
	NetworkAnnotationName = "goharbor.io/network"
)
View Source
const (
	NotaryServerAPIPortName = "api"
)
View Source
const (
	NotarySignerAPIPortName = "api"
)
View Source
const PostgresConnectTimeoutKey = "connect_timeout"
View Source
const PostgresSSLModeKey = "sslmode"
View Source
const PostgresScheme = "postgres"

Variables

View Source
var ErrUnsupportedComponent = errors.New("component not supported")

Functions

func AddPrometheusAnnotations added in v1.0.1

func AddPrometheusAnnotations(annotations map[string]string, port int32, path string) map[string]string

func GetLargestComponentNameSize

func GetLargestComponentNameSize() int

Types

type Component

type Component int
const (
	CoreComponent               Component = iota // core
	JobServiceComponent                          // jobservice
	PortalComponent                              // portal
	RegistryComponent                            // registry
	RegistryControllerComponent                  // registryctl
	ChartMuseumComponent                         // chartmuseum
	ExporterComponent                            // exporter
	NotaryServerComponent                        // notaryserver
	NotarySignerComponent                        // notarysigner
	TrivyComponent                               // trivy

)

func (Component) String

func (i Component) String() string

type ComponentSpec

type ComponentSpec struct {
	ImageSpec `json:",inline"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Minimum=0
	// Replicas is the number of desired replicas.
	// This is a pointer to distinguish between explicit zero and unspecified.
	// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller
	Replicas *int32 `json:"replicas,omitempty"`

	// +kubebuilder:validation:Optional
	// ServiceAccountName is the name of the ServiceAccount to use to run this component.
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// +kubebuilder:validation:Optional
	// NodeSelector is a selector which must be true for the component to fit on a node.
	// Selector which must match a node's labels for the pod to be scheduled on that node.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// +kubebuilder:validation:Optional
	// If specified, the pod's tolerations.
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// +kubebuilder:validation:Optional
	// Compute Resources required by this component.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

func (*ComponentSpec) ApplyToDeployment

func (c *ComponentSpec) ApplyToDeployment(deploy *appsv1.Deployment)

func (*ComponentSpec) DeepCopy

func (in *ComponentSpec) DeepCopy() *ComponentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentSpec.

func (*ComponentSpec) DeepCopyInto

func (in *ComponentSpec) DeepCopyInto(out *ComponentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ComponentStatus

type ComponentStatus struct {
	// +kubebuilder:validation:Optional
	Operator OperatorStatus `json:"operator,omitempty"`

	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Current number of pods.
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas,omitempty"`

	// Conditions list of extracted conditions from Resource
	// +listType:map
	// +listMapKey:type
	Conditions []Condition `json:"conditions"`
}

+kubebuilder:validation:Type=object ComponentStatus represents the current status of the resource. https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties

func (*ComponentStatus) DeepCopy

func (in *ComponentStatus) DeepCopy() *ComponentStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentStatus.

func (*ComponentStatus) DeepCopyInto

func (in *ComponentStatus) DeepCopyInto(out *ComponentStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ComponentStatus) MarshalJSON

func (s ComponentStatus) MarshalJSON() ([]byte, error)

type ComponentWithRedis

type ComponentWithRedis Component

func (ComponentWithRedis) Index

func (r ComponentWithRedis) Index() int32

func (ComponentWithRedis) String

func (r ComponentWithRedis) String() string

type ComponentWithTLS

type ComponentWithTLS Component

func (ComponentWithTLS) GetName

func (r ComponentWithTLS) GetName() string

func (ComponentWithTLS) String

func (r ComponentWithTLS) String() string

type ComponentsTLSSpec

type ComponentsTLSSpec struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Pattern="[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*"
	CertificateRef string `json:"certificateRef,omitempty"`
}

func (*ComponentsTLSSpec) DeepCopy

func (in *ComponentsTLSSpec) DeepCopy() *ComponentsTLSSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentsTLSSpec.

func (*ComponentsTLSSpec) DeepCopyInto

func (in *ComponentsTLSSpec) DeepCopyInto(out *ComponentsTLSSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ComponentsTLSSpec) Enabled

func (tls *ComponentsTLSSpec) Enabled() bool

func (*ComponentsTLSSpec) GetInternalPort

func (tls *ComponentsTLSSpec) GetInternalPort() int32

func (*ComponentsTLSSpec) GetScheme

func (tls *ComponentsTLSSpec) GetScheme() corev1.URIScheme

type Condition

type Condition struct {
	// +kubebuilder:validation:Required
	// Type condition type
	Type status.ConditionType `json:"type"`

	// +kubebuilder:validation:Required
	// Status String that describes the condition status
	Status corev1.ConditionStatus `json:"status"`

	// +kubebuilder:validation:Optional
	// Reason one work CamelCase reason
	Reason string `json:"reason,omitempty"`

	// +kubebuilder:validation:Optional
	// Message Human readable reason string
	Message string `json:"message,omitempty"`
}

Condition defines the general format for conditions on Kubernetes resources. In practice, each kubernetes resource defines their own format for conditions, but most (maybe all) follows this structure.

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CoreLogLevel

type CoreLogLevel string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"debug","info","warn","error"} CoreLogLevel is the log level for Core.

const (
	CoreDebug   CoreLogLevel = "debug"
	CoreInfo    CoreLogLevel = "info"
	CoreWarning CoreLogLevel = "warn"
	CoreError   CoreLogLevel = "error"
)

type DatabaseName

type DatabaseName string

type ErrPostgresNoHost

type ErrPostgresNoHost bool

func NewErrPostgresNoHost

func NewErrPostgresNoHost() *ErrPostgresNoHost

func (*ErrPostgresNoHost) Error

func (err *ErrPostgresNoHost) Error() string

type ExporterLogLevel added in v1.0.1

type ExporterLogLevel string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"debug","info","warning","error","panic"} ExporterLogLevel is the log level for Exporter.

const (
	ExporterDebug   ExporterLogLevel = "debug"
	ExporterInfo    ExporterLogLevel = "info"
	ExporterWarning ExporterLogLevel = "warning"
	ExporterError   ExporterLogLevel = "error"
	ExporterFatal   ExporterLogLevel = "panic"
)

func (ExporterLogLevel) String added in v1.1.0

func (l ExporterLogLevel) String() string

type HarborLogLevel

type HarborLogLevel string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"debug","info","warning","error","fatal"} HarborLogLevel is the log level for Harbor.

const (
	HarborDebug   HarborLogLevel = "debug"
	HarborInfo    HarborLogLevel = "info"
	HarborWarning HarborLogLevel = "warning"
	HarborError   HarborLogLevel = "error"
	HarborFatal   HarborLogLevel = "fatal"
)

func (HarborLogLevel) Core

func (l HarborLogLevel) Core() CoreLogLevel

Core get the log level for Core component.

func (HarborLogLevel) Exporter added in v1.0.1

func (l HarborLogLevel) Exporter() ExporterLogLevel

func (HarborLogLevel) JobService

func (l HarborLogLevel) JobService() JobServiceLogLevel

JobService get the log level for JobService component.

func (HarborLogLevel) Notary

func (l HarborLogLevel) Notary() NotaryLogLevel

Notary get the log level for Notary component.

func (HarborLogLevel) Registry

func (l HarborLogLevel) Registry() RegistryLogLevel

Registry get the log level for Registry component.

func (HarborLogLevel) RegistryCtl

func (l HarborLogLevel) RegistryCtl() RegistryCtlLogLevel

RegistryCtl get the log level for RegistryController component.

func (HarborLogLevel) Trivy

func (l HarborLogLevel) Trivy() TrivyLogLevel

Trivy get the log level for Trivy component.

type ImageSourceSpec added in v1.1.0

type ImageSourceSpec struct {
	// +kubebuilder:validation:Required
	// The default repository for the images of the components. eg docker.io/goharbor/
	Repository string `json:"repository,omitempty"`

	// +kubebuilder:validation:Optional
	// The tag suffix for the images of the images of the components. eg '-patch1'
	TagSuffix string `json:"tagSuffix,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Enum={"Always","Never","IfNotPresent"}
	// Image pull policy.
	// More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
	ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// +kubebuilder:validation:Optional
	// +listType:map
	// +listMapKey:name
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
}

func (*ImageSourceSpec) AddRepositoryAndTagSuffixOptions added in v1.1.0

func (spec *ImageSourceSpec) AddRepositoryAndTagSuffixOptions(options ...image.Option) []image.Option

func (*ImageSourceSpec) DeepCopy added in v1.1.0

func (in *ImageSourceSpec) DeepCopy() *ImageSourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSourceSpec.

func (*ImageSourceSpec) DeepCopyInto added in v1.1.0

func (in *ImageSourceSpec) DeepCopyInto(out *ImageSourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ImageSpec added in v1.0.1

type ImageSpec struct {
	// +kubebuilder:validation:Optional
	// Image name for the component.
	Image string `json:"image,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Enum={"Always","Never","IfNotPresent"}
	// Image pull policy.
	// More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
	ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// +kubebuilder:validation:Optional
	// +listType:map
	// +listMapKey:name
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
}

func (*ImageSpec) DeepCopy added in v1.0.1

func (in *ImageSpec) DeepCopy() *ImageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec.

func (*ImageSpec) DeepCopyInto added in v1.0.1

func (in *ImageSpec) DeepCopyInto(out *ImageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IngressController

type IngressController string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"default","gce","ncp","contour"} Type of ingress controller if it has specific requirements.

const (
	// Default ingress controller.
	IngressControllerDefault IngressController = "default"
	// Google Cloud Engine ingress controller.
	IngressControllerGCE IngressController = "gce"
	// NSX-T Container Plugin ingress controller.
	IngressControllerNCP IngressController = "ncp"
	// Contour ingress controller.
	IngressControllerContour IngressController = "contour"
	// ingress-controller name.
	IngressControllerAnnotationName = "goharbor.io/ingress-controller"
)

type JaegerAgentSpec added in v1.2.0

type JaegerAgentSpec struct {
	// +kubebuilder:validation:Required
	// The host of the jaeger agent.
	Host string `json:"host,omitempty"`

	// +kubebuilder:validation:Required
	// The port of the jaeger agent.
	Port int `json:"port,omitempty"`
}

func (*JaegerAgentSpec) DeepCopy added in v1.2.0

func (in *JaegerAgentSpec) DeepCopy() *JaegerAgentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerAgentSpec.

func (*JaegerAgentSpec) DeepCopyInto added in v1.2.0

func (in *JaegerAgentSpec) DeepCopyInto(out *JaegerAgentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JaegerCollectorSpec added in v1.2.0

type JaegerCollectorSpec struct {
	// +kubebuilder:validation:Required
	// The endpoint of the jaeger collector.
	Endpoint string `json:"endpoint"`

	// +kubebuilder:validation:Optional
	// The username of the jaeger collector.
	Username string `json:"username,omitempty"`

	// +kubebuilder:validation:Optional
	// The password secret reference name of the jaeger collector.
	PasswordRef string `json:"passwordRef,omitempty"`
}

func (*JaegerCollectorSpec) DeepCopy added in v1.2.0

func (in *JaegerCollectorSpec) DeepCopy() *JaegerCollectorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerCollectorSpec.

func (*JaegerCollectorSpec) DeepCopyInto added in v1.2.0

func (in *JaegerCollectorSpec) DeepCopyInto(out *JaegerCollectorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JaegerModeType added in v1.2.0

type JaegerModeType string

+kubebuilder:validation:Enum={"collector", "agent"} +kubebuilder:validation:Type="string" The jaeger mode: 'collector' or 'agent'.

const (
	JaegerCollectorMode JaegerModeType = "collector"
	JaegerAgentMode     JaegerModeType = "agent"
)

type JaegerSpec added in v1.2.0

type JaegerSpec struct {
	// +kubebuilder:validation:Required
	Mode JaegerModeType `json:"mode"`

	// +kubebuilder:validation:Optional
	Collector *JaegerCollectorSpec `json:"collector,omitempty"`

	// +kubebuilder:validation:Optional
	Agent *JaegerAgentSpec `json:"agent,omitempty"`
}

func (*JaegerSpec) DeepCopy added in v1.2.0

func (in *JaegerSpec) DeepCopy() *JaegerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerSpec.

func (*JaegerSpec) DeepCopyInto added in v1.2.0

func (in *JaegerSpec) DeepCopyInto(out *JaegerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*JaegerSpec) Validate added in v1.2.0

func (spec *JaegerSpec) Validate(rootPath *field.Path) *field.Error

type JobServiceLogLevel

type JobServiceLogLevel string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"DEBUG","INFO","WARNING","ERROR","FATAL"} JobServiceLogLevel is the log level for JobService.

const (
	JobServiceDebug   JobServiceLogLevel = "DEBUG"
	JobServiceInfo    JobServiceLogLevel = "INFO"
	JobServiceWarning JobServiceLogLevel = "WARNING"
	JobServiceError   JobServiceLogLevel = "ERROR"
	JobServiceFatal   JobServiceLogLevel = "FATAL"
)

type MetricsSpec added in v1.0.1

type MetricsSpec struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=false
	Enabled bool `json:"enabled"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default=8001
	// +kubebuilder:validation:Minimum=1
	// The port of the metrics.
	Port int32 `json:"port"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default="/metrics"
	// +kubebuilder:validation:Pattern="/.+"
	// The path of the metrics.
	Path string `json:"path"`
}

func (*MetricsSpec) AddPrometheusAnnotations added in v1.0.1

func (spec *MetricsSpec) AddPrometheusAnnotations(annotations map[string]string) map[string]string

func (*MetricsSpec) DeepCopy added in v1.0.1

func (in *MetricsSpec) DeepCopy() *MetricsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsSpec.

func (*MetricsSpec) DeepCopyInto added in v1.0.1

func (in *MetricsSpec) DeepCopyInto(out *MetricsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MetricsSpec) GetEnvVars added in v1.1.0

func (spec *MetricsSpec) GetEnvVars(component string) ([]corev1.EnvVar, error)

func (*MetricsSpec) IsEnabled added in v1.0.1

func (spec *MetricsSpec) IsEnabled() bool

type Network added in v1.1.0

type Network struct {
	// +kubebuilder:validation:Optional
	IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty"`
}

func (*Network) DeepCopy added in v1.1.0

func (in *Network) DeepCopy() *Network

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network.

func (*Network) DeepCopyInto added in v1.1.0

func (in *Network) DeepCopyInto(out *Network)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Network) IsIPv4Enabled added in v1.1.0

func (network *Network) IsIPv4Enabled() bool

func (*Network) IsIPv6Enabled added in v1.1.0

func (network *Network) IsIPv6Enabled() bool

func (*Network) Validate added in v1.1.0

func (network *Network) Validate(rootPath *field.Path) *field.Error

type NotaryLogLevel

type NotaryLogLevel string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"debug","info","warning","error","fatal","panic"} NotaryLogLevel is the log level for NotaryServer and NotarySigner.

const (
	NotaryDebug   NotaryLogLevel = "debug"
	NotaryInfo    NotaryLogLevel = "info"
	NotaryWarning NotaryLogLevel = "warning"
	NotaryError   NotaryLogLevel = "error"
	NotaryFatal   NotaryLogLevel = "fatal"
	NotaryPanic   NotaryLogLevel = "panic"
)

type OperatorStatus

type OperatorStatus struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:MinLength=1
	ControllerGitCommit string `json:"controllerGitCommit,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:MinLength=1
	ControllerVersion string `json:"controllerVersion,omitempty"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	ControllerName string `json:"controllerName,omitempty"`
}

+kubebuilder:validation:Type=object ControllerStatus represents the current status of the operator.

func (*OperatorStatus) DeepCopy

func (in *OperatorStatus) DeepCopy() *OperatorStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorStatus.

func (*OperatorStatus) DeepCopyInto

func (in *OperatorStatus) DeepCopyInto(out *OperatorStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OtelSpec added in v1.2.0

type OtelSpec struct {
	// +kubebuilder:validation:Required
	// The endpoint of otel.
	Endpoint string `json:"endpoint"`

	// +kubebuilder:validation:Required
	// The URL path of otel.
	URLPath string `json:"urlPath"`

	// +kubebuilder:validation:Optional
	// Whether enable compression or not for otel.
	Compression bool `json:"compression,omitempty"`

	// +kubebuilder:validation:Optional
	// Whether establish insecure connection or not for otel.
	Insecure bool `json:"insecure,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default="10s"
	// The timeout of otel.
	Timeout *metav1.Duration `json:"timeout,omitempty"`
}

func (*OtelSpec) DeepCopy added in v1.2.0

func (in *OtelSpec) DeepCopy() *OtelSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OtelSpec.

func (*OtelSpec) DeepCopyInto added in v1.2.0

func (in *OtelSpec) DeepCopyInto(out *OtelSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PostgresClientEncoding

type PostgresClientEncoding string

+kubebuilder:default="auto" This sets the client_encoding configuration parameter for this connection. In addition to the values accepted by the corresponding server option, you can use auto to determine the right encoding from the current locale in the client (LC_CTYPE environment variable on Unix systems).

func (*PostgresClientEncoding) Add

func (p *PostgresClientEncoding) Add(query url.Values)

type PostgresConnectTimeout

type PostgresConnectTimeout metav1.Duration

+kubebuilder:validation:Optional Maximum wait for connection. Zero, negative, or not specified means wait indefinitely. The minimum allowed timeout is 2 seconds, therefore a value of 1 is interpreted as 2. This timeout applies separately to each host name or IP address. For example, if you specify two hosts and connect_timeout is 5, each host will time out if no connection is made within 5 seconds, so the total time spent waiting for a connection might be up to 10 seconds.

func (*PostgresConnectTimeout) Add

func (p *PostgresConnectTimeout) Add(query url.Values)

func (*PostgresConnectTimeout) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresConnectTimeout.

func (*PostgresConnectTimeout) DeepCopyInto

func (in *PostgresConnectTimeout) DeepCopyInto(out *PostgresConnectTimeout)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PostgresConnection

type PostgresConnection struct {
	PostgresCredentials `json:",inline"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	Hosts []PostgresHostSpec `json:"hosts,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:MinLength=1
	// The database name. Defaults to be the same as the user name.
	// In certain contexts, the value is checked for extended formats.
	Database string `json:"database,omitempty"`
}

func (*PostgresConnection) DeepCopy

func (in *PostgresConnection) DeepCopy() *PostgresConnection

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresConnection.

func (*PostgresConnection) DeepCopyInto

func (in *PostgresConnection) DeepCopyInto(out *PostgresConnection)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PostgresConnection) GetDSN

func (c *PostgresConnection) GetDSN(password string) *url.URL

func (*PostgresConnection) GetDSNNoCredentials

func (c *PostgresConnection) GetDSNNoCredentials() *url.URL

func (*PostgresConnection) GetDSNStringWithRawPassword

func (c *PostgresConnection) GetDSNStringWithRawPassword(password string) string

type PostgresConnectionWithParameters

type PostgresConnectionWithParameters struct {
	PostgresConnection `json:",inline"`

	// +kubebuilder:validation:Optional
	// libpq parameters.
	Parameters map[string]string `json:"parameters,omitempty"`
}

func (*PostgresConnectionWithParameters) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresConnectionWithParameters.

func (*PostgresConnectionWithParameters) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PostgresConnectionWithParameters) GetDSN

func (c *PostgresConnectionWithParameters) GetDSN(password string) *url.URL

func (*PostgresConnectionWithParameters) GetDSNNoCredentials

func (c *PostgresConnectionWithParameters) GetDSNNoCredentials() *url.URL

func (*PostgresConnectionWithParameters) GetDSNStringWithRawPassword

func (c *PostgresConnectionWithParameters) GetDSNStringWithRawPassword(password string) string

type PostgresCredentials

type PostgresCredentials struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:MinLength=1
	// PostgreSQL user name to connect as.
	// Defaults to be the same as the operating system name of the user running the application.
	Username string `json:"username,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Pattern="[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*"
	// Secret containing the password to be used if the server demands password authentication.
	PasswordRef string `json:"passwordRef,omitempty"`
}

func (*PostgresCredentials) DeepCopy

func (in *PostgresCredentials) DeepCopy() *PostgresCredentials

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresCredentials.

func (*PostgresCredentials) DeepCopyInto

func (in *PostgresCredentials) DeepCopyInto(out *PostgresCredentials)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PostgresCredentials) GetPasswordEnvVarSource added in v1.0.1

func (p *PostgresCredentials) GetPasswordEnvVarSource() *corev1.EnvVarSource

type PostgresHostSpec

type PostgresHostSpec struct {
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// Name of host to connect to.
	// If a host name begins with a slash, it specifies Unix-domain communication rather than
	// TCP/IP communication; the value is the name of the directory in which the socket file is stored.
	Host string `json:"host"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:ExclusiveMinimum=true
	// Port number to connect to at the server host,
	// or socket file name extension for Unix-domain connections.
	// Zero, specifies the default port number established when PostgreSQL was built.
	Port int32 `json:"port,omitempty"`
}

func (*PostgresHostSpec) DeepCopy

func (in *PostgresHostSpec) DeepCopy() *PostgresHostSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresHostSpec.

func (*PostgresHostSpec) DeepCopyInto

func (in *PostgresHostSpec) DeepCopyInto(out *PostgresHostSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PostgresSSLMode

type PostgresSSLMode string

+kubebuilder:validation:Enum={"disable","allow","prefer","require","verify-ca","verify-full"} +kubebuilder:default="prefer" PostgreSQL has native support for using SSL connections to encrypt client/server communications for increased security.

const (
	PostgresSSLModeDisable    PostgresSSLMode = "disable"
	PostgresSSLModeAllow      PostgresSSLMode = "allow"
	PostgresSSLModePrefer     PostgresSSLMode = "prefer"
	PostgresSSLModeRequire    PostgresSSLMode = "require"
	PostgresSSLModeVerifyCA   PostgresSSLMode = "verify-ca"
	PostgresSSLModeVerifyFull PostgresSSLMode = "verify-full"
)

func (*PostgresSSLMode) Add

func (p *PostgresSSLMode) Add(query url.Values)

type ProxySpec added in v1.0.1

type ProxySpec struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Pattern="https?://.+"
	HTTPProxy string `json:"httpProxy,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Pattern="https?://.+"
	HTTPSProxy string `json:"httpsProxy,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default={"127.0.0.1","localhost",".local",".internal"}
	NoProxy []string `json:"noProxy,omitempty"`
}

func (*ProxySpec) DeepCopy added in v1.0.1

func (in *ProxySpec) DeepCopy() *ProxySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxySpec.

func (*ProxySpec) DeepCopyInto added in v1.0.1

func (in *ProxySpec) DeepCopyInto(out *ProxySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ProxySpec) GetEnvVars added in v1.0.1

func (spec *ProxySpec) GetEnvVars() []corev1.EnvVar

type RedisConnection

type RedisConnection struct {
	RedisHostSpec    `json:",inline"`
	RedisCredentials `json:",inline"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=8
	// +kubebuilder:default=0
	// The database number.
	Database int32 `json:"database,omitempty"`
}

func (*RedisConnection) DeepCopy

func (in *RedisConnection) DeepCopy() *RedisConnection

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisConnection.

func (*RedisConnection) DeepCopyInto

func (in *RedisConnection) DeepCopyInto(out *RedisConnection)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RedisConnection) GetDSN

func (c *RedisConnection) GetDSN(password string) *url.URL

func (*RedisConnection) GetDSNNoCredentials

func (c *RedisConnection) GetDSNNoCredentials() *url.URL

func (*RedisConnection) GetDSNStringWithRawPassword

func (c *RedisConnection) GetDSNStringWithRawPassword(password string) string

type RedisCredentials

type RedisCredentials struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Pattern="[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*"
	// Secret containing the password to use when connecting to the server.
	PasswordRef string `json:"passwordRef,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Pattern="[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*"
	// Secret containing the client certificate to authenticate with.
	CertificateRef string `json:"certificateRef,omitempty"`
}

func (*RedisCredentials) DeepCopy

func (in *RedisCredentials) DeepCopy() *RedisCredentials

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisCredentials.

func (*RedisCredentials) DeepCopyInto

func (in *RedisCredentials) DeepCopyInto(out *RedisCredentials)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RedisHostSpec

type RedisHostSpec struct {
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// Server hostname.
	Host string `json:"host"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:ExclusiveMinimum=true
	// Server port.
	Port int32 `json:"port,omitempty"`

	// +kubebuilder:validation:Optional
	// for Sentinel MasterSet.
	SentinelMasterSet string `json:"sentinelMasterSet,omitempty"`
}

func (*RedisHostSpec) DeepCopy

func (in *RedisHostSpec) DeepCopy() *RedisHostSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisHostSpec.

func (*RedisHostSpec) DeepCopyInto

func (in *RedisHostSpec) DeepCopyInto(out *RedisHostSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RegistryCtlLogLevel

type RegistryCtlLogLevel string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"debug","info","warning","error","fatal"} RegistryCtlLogLevel is the log level for RegistryController.

const (
	RegistryCtlDebug   RegistryCtlLogLevel = "debug"
	RegistryCtlInfo    RegistryCtlLogLevel = "info"
	RegistryCtlWarning RegistryCtlLogLevel = "warning"
	RegistryCtlError   RegistryCtlLogLevel = "error"
	RegistryCtlFatal   RegistryCtlLogLevel = "fatal"
)

type RegistryLogFormatter

type RegistryLogFormatter string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"text","json","logstash"} RegistryLogFormatter is the log formatter for Registry.

const (
	RegistryTextFormatter     RegistryLogFormatter = "text"
	RegistryJSONFormatter     RegistryLogFormatter = "json"
	RegistryLogstashFormatter RegistryLogFormatter = "logstash"
)

type RegistryLogLevel

type RegistryLogLevel string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"debug","info","warning","error"} RegistryLogLevel is the log level for Registry.

const (
	RegistryDebug   RegistryLogLevel = "debug"
	RegistryInfo    RegistryLogLevel = "info"
	RegistryWarning RegistryLogLevel = "warning"
	RegistryError   RegistryLogLevel = "error"
)

type TraceProviderSpec added in v1.2.0

type TraceProviderSpec struct {
	// +kubebuilder:validation:Optional
	Jaeger *JaegerSpec `json:"jaeger,omitempty"`

	// +kubebuilder:validation:Optional
	Otel *OtelSpec `json:"otel,omitempty"`
}

func (*TraceProviderSpec) DeepCopy added in v1.2.0

func (in *TraceProviderSpec) DeepCopy() *TraceProviderSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraceProviderSpec.

func (*TraceProviderSpec) DeepCopyInto added in v1.2.0

func (in *TraceProviderSpec) DeepCopyInto(out *TraceProviderSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TraceProviderType added in v1.2.0

type TraceProviderType string

+kubebuilder:validation:Enum={"jaeger", "otel"} +kubebuilder:validation:Type="string" The tracing provider: 'jaeger' or 'otel'.

const (
	TraceJaegerProvider TraceProviderType = "jaeger"
	TraceOtelProvider   TraceProviderType = "otel"
)

type TraceSpec added in v1.2.0

type TraceSpec struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=false
	// Enable tracing or not.
	Enabled bool `json:"enabled,omitempty"`

	// +kubebuilder:validation:Optional
	// Namespace used to differentiate different harbor services.
	Namespace string `json:"namespace,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default=1
	// Set `sampleRate` to 1 if you wanna sampling 100% of trace data; set 0.5 if you wanna sampling 50% of trace data, and so forth.
	SampleRate int `json:"sampleRate,omitempty"`

	// +kubebuilder:validation:Optional
	// A key value dict contains user defined attributes used to initialize trace provider.
	Attributes map[string]string `json:"attributes,omitempty"`

	// +kubebuilder:validation:Required
	Provder TraceProviderType `json:"provider"`

	TraceProviderSpec `json:",inline"`
}

func (*TraceSpec) AddEnvVars added in v1.2.0

func (spec *TraceSpec) AddEnvVars(component string, envs []corev1.EnvVar) ([]corev1.EnvVar, error)

func (*TraceSpec) DeepCopy added in v1.2.0

func (in *TraceSpec) DeepCopy() *TraceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraceSpec.

func (*TraceSpec) DeepCopyInto added in v1.2.0

func (in *TraceSpec) DeepCopyInto(out *TraceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TraceSpec) GetEnvVars added in v1.2.0

func (spec *TraceSpec) GetEnvVars(component string) ([]corev1.EnvVar, error)

func (*TraceSpec) IsEnabled added in v1.2.0

func (spec *TraceSpec) IsEnabled() bool

func (*TraceSpec) Validate added in v1.2.0

func (spec *TraceSpec) Validate(rootPath *field.Path) *field.Error

type TrivyLogLevel

type TrivyLogLevel string

+kubebuilder:validation:Type=string +kubebuilder:validation:Enum={"debug","info","warning","error","fatal","panic"} TrivyLogLevel is the log level for Trivy.

const (
	TrivyDebug   TrivyLogLevel = "debug"
	TrivyInfo    TrivyLogLevel = "info"
	TrivyWarning TrivyLogLevel = "warning"
	TrivyError   TrivyLogLevel = "error"
	TrivyFatal   TrivyLogLevel = "fatal"
	TrivyPanic   TrivyLogLevel = "panic"
)

type TrivySeverityType

type TrivySeverityType string

+kubebuilder:validation:Enum={"UNKNOWN","LOW","MEDIUM","HIGH","CRITICAL"} +kubebuilder:validation:Type="string" TrivyServerSeverityType represents a CVE severity type for trivy.

const (
	TrivyUnknownSeverity  TrivySeverityType = "UNKNOWN"
	TrivyLowSeverity      TrivySeverityType = "LOW"
	TrivyMediumSeverity   TrivySeverityType = "MEDIUM"
	TrivyHighSeverity     TrivySeverityType = "HIGH"
	TrivyCriticalSeverity TrivySeverityType = "CRITICAL"
)

type TrivySeverityTypes

type TrivySeverityTypes struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default={"UNKNOWN","LOW","MEDIUM","HIGH","CRITICAL"}
	// List of severities to be displayed
	Severities *[]TrivySeverityType `json:"severities,omitempty"`
}

func (*TrivySeverityTypes) DeepCopy

func (in *TrivySeverityTypes) DeepCopy() *TrivySeverityTypes

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrivySeverityTypes.

func (*TrivySeverityTypes) DeepCopyInto

func (in *TrivySeverityTypes) DeepCopyInto(out *TrivySeverityTypes)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TrivySeverityTypes) GetValue

func (s *TrivySeverityTypes) GetValue() string

GetSeverities joins array of severities type into a string separated by commas.

type TrivyVulnerabilityType

type TrivyVulnerabilityType string

+kubebuilder:validation:Enum={"os","library"} +kubebuilder:validation:Type="string" TrivyServerVulnerabilityType represents a CVE vulnerability type for trivy.

const (
	TrivyOSVulnerability      TrivyVulnerabilityType = "os"
	TrivyLibraryVulnerability TrivyVulnerabilityType = "library"
)

type TrivyVulnerabilityTypes

type TrivyVulnerabilityTypes struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default={"os","library"}
	// Comma-separated list of vulnerability types.
	VulnerabilityTypes *[]TrivyVulnerabilityType `json:"vulnerabilityTypes,omitempty"`
}

func (*TrivyVulnerabilityTypes) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrivyVulnerabilityTypes.

func (*TrivyVulnerabilityTypes) DeepCopyInto

func (in *TrivyVulnerabilityTypes) DeepCopyInto(out *TrivyVulnerabilityTypes)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TrivyVulnerabilityTypes) GetValue

func (v *TrivyVulnerabilityTypes) GetValue() string

GetVulnerabilities joins array of vulnerabilities type into a string separated by commas.

Jump to

Keyboard shortcuts

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