v1alpha1

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package,register +k8s:openapi-gen=true +k8s:defaulter-gen=TypeMeta +groupName=postgres.kubedb.com

Index

Constants

View Source
const (
	ResourceKindPublisher = "Publisher"
	ResourcePublisher     = "publisher"
	ResourcePublishers    = "publishers"
)
View Source
const (
	DMLOpInsert   = "insert"
	DMLOpUpdate   = "update"
	DMLOpDelete   = "delete"
	DMLOpTruncate = "truncate"
)
View Source
const (
	PublisherConditionTypeDBServerReady  PublisherConditionType = "DatabaseServerReady"
	PublisherMessageDBServerNotCreated   PublisherMessage       = "Database Server is not created yet"
	PublisherMessageDBServerProvisioning PublisherMessage       = "Database Server is provisioning"
	PublisherMessageDBServerNotReady     PublisherMessage       = "Database Server is not ready"
	PublisherMessageDBServerCritical     PublisherMessage       = "Database Server is critical"
	PublisherMessageDBServerReady        PublisherMessage       = "Database Server is Ready"

	PublisherConditionTypeDatabaseIsFound PublisherConditionType = "DatabaseIsFound"
	PublisherMessageDatabaseIsFound       PublisherMessage       = "Database is found"
	PublisherMessageDatabaseIsNotFound    PublisherMessage       = "Database is not found"

	PublisherConditionTypeAllTablesFound PublisherConditionType = "AllTablesFound"
	PublisherMessageAllTablesNotFound    PublisherMessage       = "All tables are not found"
	PublisherMessageAllTablesFound       PublisherMessage       = "All tables are found"

	PublisherConditionTypePublicationSuccessful PublisherConditionType = "PublicationSuccessful"
	PublisherMessagePublicationIsSuccessful     PublisherMessage       = "Publication is successful"
	PublisherMessagePublicationIsNotSuccessful  PublisherMessage       = "Publication is not successful"
)
View Source
const (
	ResourceKindSubscriber = "Subscriber"
	ResourceSubscriber     = "subscriber"
	ResourceSubscribers    = "subscribers"
)
View Source
const (
	TableCreationPolicyDefault            = ""
	TableCreationPolicyCreateIfNotPresent = "IfNotPresent"
)
View Source
const (
	SubscriberConditionTypeDBServerReady  SubscriberConditionType = "DatabaseServerReady"
	SubscriberMessageDBServerNotCreated   SubscriberMessage       = "Database Server is not created yet"
	SubscriberMessageDBServerProvisioning SubscriberMessage       = "Database Server is provisioning"
	SubscriberMessageDBServerNotReady     SubscriberMessage       = "Database Server is not ready"
	SubscriberMessageDBServerCritical     SubscriberMessage       = "Database Server is critical"
	SubscriberMessageDBServerReady        SubscriberMessage       = "Database Server is Ready"

	SubscriberConditionTypeDatabaseIsFound SubscriberConditionType = "DatabaseIsFound"
	SubscriberMessageDatabaseIsFound       SubscriberMessage       = "Database is found"
	SubscriberMessageDatabaseIsNotFound    SubscriberMessage       = "Database is not found"

	SubscriberConditionTypeAllPublisherReady SubscriberConditionType = "AllPublisherReady"
	SubscriberMessageAllPublisherAreReady    SubscriberMessage       = "All Publisher are ready"
	SubscriberMessageAllPublisherAreNotReady SubscriberMessage       = "All Publisher are not ready"

	SubscriberConditionTypeSubscriberIsAllowed SubscriberConditionType = "SubscriberIsAllowed"
	SubscriberMessageSubscriberIsAllowed       SubscriberMessage       = "Subscriber is allowed"
	SubscriberMessageSubscriberIsNotAllowed    SubscriberMessage       = "Subscriber is not allowed"

	SubscriberConditionTypeAllTablesFound SubscriberConditionType = "AllTablesFound"
	SubscriberMessageAllTablesNotFound    SubscriberMessage       = "All tables are not found"
	SubscriberMessageAllTablesFound       SubscriberMessage       = "All tables are found"

	SubscriberConditionTypeSubscriptionIsSuccessful SubscriberConditionType = "SubscriptionIsSuccessful"
	SubscriberMessageSubscriptionIsSuccessful       SubscriberMessage       = "Subscription is successful"
	SubscriberMessageSubscriptionIsNotSuccessful    SubscriberMessage       = "Subscription is not successful"

	SubscriberConditionTypeSubscriptionIsDisabled SubscriberConditionType = "SubscriptionIsDisabled"
	SubscriberMessageSubscriptionIsDisabled       SubscriberMessage       = "Subsription is disabled"
	SubscriberMessageSubscriptionIsNotDisabled    SubscriberMessage       = "Subsription is not disabled"

	SubscriberConditionTypeSubscriptionIsEnabled SubscriberConditionType = "SubscriptionIsEnabled"
	SubscriberMessageSubscriptionIsEnabled       SubscriberMessage       = "Subsription is enabled"
	SubscriberMessageSubscriptionIsNotEnabled    SubscriberMessage       = "Subsription is not enabled"
)

Variables

View Source
var (
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: postgres.GroupName, Version: "v1alpha1"}

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AllowedSubscribers

type AllowedSubscribers struct {
	// Namespaces indicates namespaces from which Subscribers may be attached to
	//
	// +optional
	// +kubebuilder:default={from: Same}
	Namespaces *SubscriberNamespaces `json:"namespaces,omitempty"`

	// Selector specifies a selector for consumers that are allowed to bind
	// to this database instance.
	//
	// +optional
	Selector *metav1.LabelSelector `json:"selector,omitempty"`
}

AllowedSubscribers defines which consumers may refer to a database instance.

func (*AllowedSubscribers) DeepCopy

func (in *AllowedSubscribers) DeepCopy() *AllowedSubscribers

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

func (*AllowedSubscribers) DeepCopyInto

func (in *AllowedSubscribers) DeepCopyInto(out *AllowedSubscribers)

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

type DMLOperation

type DMLOperation string

+kubebuilder:validation:Enum=insert;update;delete;truncate

type DeletionPolicy

type DeletionPolicy string

+kubebuilder:validation:Enum=Delete;Retain

const (
	// Deletes database pods, service, pvcs but leave the snapshot data intact. This will not create a DormantDatabase.
	DeletionPolicyDelete DeletionPolicy = "Delete"
	// Pauses database into a DormantDatabase
	DeletionPolicyRetain DeletionPolicy = "Retain"
)

type ExternalPublisherInfo

type ExternalPublisherInfo struct {
	// ServerRef specifies the database appbinding reference in any namespace.
	ServerRef kmapi.ObjectReference `json:"serverRef"`
	// DatabaseName is the name of the target database inside a Postgres instance.
	DatabaseName string `json:"databaseName"`

	Publications []string `json:"publications"`
}

func (*ExternalPublisherInfo) DeepCopy

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

func (*ExternalPublisherInfo) DeepCopyInto

func (in *ExternalPublisherInfo) DeepCopyInto(out *ExternalPublisherInfo)

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

type FromNamespaces

type FromNamespaces string

FromNamespaces specifies namespace from which Consumers may be attached to a database instance.

+kubebuilder:validation:Enum=All;Selector;Same

const (
	// Consumers in all namespaces may be attached to the database instance.
	NamespacesFromAll FromNamespaces = "All"
	// Only Consumers in namespaces selected by the selector may be attached to the database instance.
	NamespacesFromSelector FromNamespaces = "Selector"
	// Only Consumers in the same namespace as the database instance may be attached to it.
	NamespacesFromSame FromNamespaces = "Same"
)

type ManagedPublisherInfo

type ManagedPublisherInfo struct {
	// Namespace of the referent.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
	// +optional
	Namespace string `json:"namespace,omitempty"`
	// publication crd ref
	Refs []core.LocalObjectReference `json:"refs"`
}

func (*ManagedPublisherInfo) DeepCopy

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

func (*ManagedPublisherInfo) DeepCopyInto

func (in *ManagedPublisherInfo) DeepCopyInto(out *ManagedPublisherInfo)

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

type Publisher

type Publisher struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PublisherSpec   `json:"spec,omitempty"`
	Status PublisherStatus `json:"status,omitempty"`
}

Publisher is the Schema for the publishers API

func (Publisher) CustomResourceDefinition

func (_ Publisher) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*Publisher) DeepCopy

func (in *Publisher) DeepCopy() *Publisher

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

func (*Publisher) DeepCopyInto

func (in *Publisher) DeepCopyInto(out *Publisher)

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

func (*Publisher) DeepCopyObject

func (in *Publisher) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PublisherConditionType

type PublisherConditionType string

type PublisherInfo

type PublisherInfo struct {
	Managed  *ManagedPublisherInfo  `json:"managed,omitempty"`
	External *ExternalPublisherInfo `json:"external,omitempty"`
}

func (*PublisherInfo) DeepCopy

func (in *PublisherInfo) DeepCopy() *PublisherInfo

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

func (*PublisherInfo) DeepCopyInto

func (in *PublisherInfo) DeepCopyInto(out *PublisherInfo)

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

type PublisherList

type PublisherList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Publisher `json:"items"`
}

PublisherList contains a list of Publisher

func (*PublisherList) DeepCopy

func (in *PublisherList) DeepCopy() *PublisherList

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

func (*PublisherList) DeepCopyInto

func (in *PublisherList) DeepCopyInto(out *PublisherList)

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

func (*PublisherList) DeepCopyObject

func (in *PublisherList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PublisherMessage

type PublisherMessage string

type PublisherParameters

type PublisherParameters struct {
	// Publish parameters determines which DML operations will be published by the new publication to the subscribers.
	// The allowed operations are insert, update, delete, and truncate.
	// The default is to publish all actions, and so the default value for this option is 'insert, update, delete, truncate'.
	// +optional
	Operations []DMLOperation `json:"operations,omitempty"`
	// PublishViaPartitionRoot parameter determines whether changes in a partitioned table (or on its partitions)
	// contained in the publication will be published using the identity
	// and schema of the partitioned table rather than that of the individual partitions that are actually changed; the latter is the default.
	// Enabling this allows the changes to be replicated into a non-partitioned table
	// or a partitioned table consisting of a different set of partitions.
	// +optional
	PublishViaPartitionRoot *bool `json:"publishViaPartitionRoot,omitempty"`
}

func (*PublisherParameters) DeepCopy

func (in *PublisherParameters) DeepCopy() *PublisherParameters

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

func (*PublisherParameters) DeepCopyInto

func (in *PublisherParameters) DeepCopyInto(out *PublisherParameters)

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

type PublisherSpec

type PublisherSpec struct {
	// Name of the publisher
	Name string `json:"name"`
	// ServerRef specifies the database appbinding reference in any namespace.
	ServerRef core.LocalObjectReference `json:"serverRef"`
	// DatabaseName is the name of the target database inside a Postgres instance.
	DatabaseName string `json:"databaseName"`
	// PublishAllTables is the option to publish all tables in the database
	// +optional
	PublishAllTables bool `json:"publishAllTables"`
	// Tables is the list of table to publish
	// +optional
	Tables []string `json:"tables,omitempty"`
	// Parameters to set while creating publisher
	// +optional
	Parameters *PublisherParameters `json:"parameters,omitempty"`

	// AllowedSubscribers defines the types of database schemas that MAY refer to
	// a database instance and the trusted namespaces where those schema resources MAY be
	// present.
	//
	// +kubebuilder:default={namespaces:{from: Same}}
	// +optional
	AllowedSubscribers *AllowedSubscribers `json:"allowedSubscribers,omitempty"`

	// +optional
	Disable bool `json:"disable,omitempty"`

	// DeletionPolicy controls the delete operation for database
	// +optional
	// +kubebuilder:default=Delete
	DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"`
}

PublisherSpec defines the desired state of Publisher

func (*PublisherSpec) DeepCopy

func (in *PublisherSpec) DeepCopy() *PublisherSpec

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

func (*PublisherSpec) DeepCopyInto

func (in *PublisherSpec) DeepCopyInto(out *PublisherSpec)

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

type PublisherStatus

type PublisherStatus struct {
	// Specifies the current phase of the database
	// +optional
	Phase ReplicationConfigurationPhase `json:"phase,omitempty"`
	// observedGeneration is the most recent generation observed for this resource. It corresponds to the
	// resource's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// Conditions applied to the database, such as approval or denial.
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
	// Database authentication secret
	// +optional
	Subscribers []kmapi.ObjectReference `json:"subscribers,omitempty"`
}

PublisherStatus defines the observed state of Publisher

func (*PublisherStatus) DeepCopy

func (in *PublisherStatus) DeepCopy() *PublisherStatus

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

func (*PublisherStatus) DeepCopyInto

func (in *PublisherStatus) DeepCopyInto(out *PublisherStatus)

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

type ReplicationConfigurationPhase

type ReplicationConfigurationPhase string

+kubebuilder:validation:Enum=Pending;InProgress;Current;Failed

const (
	ReplicationConfigurationPhasePending    ReplicationConfigurationPhase = "Pending"
	ReplicationConfigurationPhaseInProgress ReplicationConfigurationPhase = "InProgress"
	ReplicationConfigurationPhaseCurrent    ReplicationConfigurationPhase = "Current"
	ReplicationConfigurationPhaseFailed     ReplicationConfigurationPhase = "Failed"
)

type Subscriber

type Subscriber struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   SubscriberSpec   `json:"spec,omitempty"`
	Status SubscriberStatus `json:"status,omitempty"`
}

Subscriber is the Schema for the subscribers API

func (Subscriber) CustomResourceDefinition

func (_ Subscriber) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*Subscriber) DeepCopy

func (in *Subscriber) DeepCopy() *Subscriber

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

func (*Subscriber) DeepCopyInto

func (in *Subscriber) DeepCopyInto(out *Subscriber)

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

func (*Subscriber) DeepCopyObject

func (in *Subscriber) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SubscriberConditionType

type SubscriberConditionType string

type SubscriberList

type SubscriberList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Subscriber `json:"items"`
}

SubscriberList contains a list of Subscriber

func (*SubscriberList) DeepCopy

func (in *SubscriberList) DeepCopy() *SubscriberList

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

func (*SubscriberList) DeepCopyInto

func (in *SubscriberList) DeepCopyInto(out *SubscriberList)

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

func (*SubscriberList) DeepCopyObject

func (in *SubscriberList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SubscriberMessage

type SubscriberMessage string

type SubscriberNamespaces

type SubscriberNamespaces struct {
	// From indicates where Subscribers will be selected for the database instance. Possible
	// values are:
	// * All: Subscribers in all namespaces.
	// * Selector: Subscribers in namespaces selected by the selector
	// * Same: Only Subscribers in the same namespace
	//
	// +optional
	// +kubebuilder:default=Same
	From *FromNamespaces `json:"from,omitempty"`

	// Selector must be specified when From is set to "Selector". In that case,
	// only Subscribers in Namespaces matching this Selector will be selected by the
	// database instance. This field is ignored for other values of "From".
	//
	// +optional
	Selector *metav1.LabelSelector `json:"selector,omitempty"`
}

SubscriberNamespaces indicate which namespaces Subscribers should be selected from.

func (*SubscriberNamespaces) DeepCopy

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

func (*SubscriberNamespaces) DeepCopyInto

func (in *SubscriberNamespaces) DeepCopyInto(out *SubscriberNamespaces)

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

type SubscriberParameters

type SubscriberParameters struct {
	// +optional
	TableCreationPolicy TableCreationPolicy `json:"tableCreationPolicy,omitempty"`
	// +optional
	CopyData *bool `json:"copyData,omitempty"`
	// +optional
	CreateSlot *bool `json:"createSlot,omitempty"`
	// +optional
	Enabled *bool `json:"enabled,omitempty"`
	// +optional
	SlotName *string `json:"slotName,omitempty"`
	// +optional
	SynchronousCommit *string `json:"synchronousCommit,omitempty"`
	// +optional
	Connect *bool `json:"connect,omitempty"`
	// +optional
	Streaming *bool `json:"streaming,omitempty"`
	// +optional
	Binary *bool `json:"binary,omitempty"`
}

func (*SubscriberParameters) DeepCopy

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

func (*SubscriberParameters) DeepCopyInto

func (in *SubscriberParameters) DeepCopyInto(out *SubscriberParameters)

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

type SubscriberSpec

type SubscriberSpec struct {
	// Name of the publisher
	Name string `json:"name"`
	// ServerRef specifies the database appbinding reference in any namespace.
	ServerRef core.LocalObjectReference `json:"serverRef"`
	// DatabaseName is the name of the target database inside a Postgres instance.
	DatabaseName string `json:"databaseName"`
	// Parameters to set while creating subscriber
	// +optional
	Parameters *SubscriberParameters `json:"parameters,omitempty"`

	Publisher PublisherInfo `json:"publisher"`

	// +optional
	Disable bool `json:"disable,omitempty"`

	// DeletionPolicy controls the delete operation for database
	// +optional
	// +kubebuilder:default=Delete
	DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"`
}

SubscriberSpec defines the desired state of Subscriber

func (*SubscriberSpec) DeepCopy

func (in *SubscriberSpec) DeepCopy() *SubscriberSpec

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

func (*SubscriberSpec) DeepCopyInto

func (in *SubscriberSpec) DeepCopyInto(out *SubscriberSpec)

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

type SubscriberStatus

type SubscriberStatus struct {
	// Specifies the current phase of the database
	// +optional
	Phase ReplicationConfigurationPhase `json:"phase,omitempty"`
	// observedGeneration is the most recent generation observed for this resource. It corresponds to the
	// resource's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// Conditions applied to the database, such as approval or denial.
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

SubscriberStatus defines the observed state of Subscriber

func (*SubscriberStatus) DeepCopy

func (in *SubscriberStatus) DeepCopy() *SubscriberStatus

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

func (*SubscriberStatus) DeepCopyInto

func (in *SubscriberStatus) DeepCopyInto(out *SubscriberStatus)

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

type TableCreationPolicy

type TableCreationPolicy string

Jump to

Keyboard shortcuts

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