v1alpha1

package
v0.0.0-...-d0a58c1 Latest Latest
Warning

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

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

Documentation

Overview

+k8s:deepcopy-gen=package +groupName=sources.vaikas.dev

Index

Constants

View Source
const (
	// PostgresConditionReady has status True when the PostgresSource is ready to send events.
	PostgresConditionReady = apis.ConditionReady

	// PostgresConditionSinkProvided has status True when the PostgresSource has been configured with a sink target.
	PostgresConditionSinkProvided apis.ConditionType = "SinkProvided"

	// PostgresConditionDeployed has status True when the PostgresSource has had it's deployment created.
	PostgresConditionDeployed apis.ConditionType = "Deployed"

	// PostgresFunctionCreated has status True when Function has been created
	PostgresFunctionCreated apis.ConditionType = "FunctionCreated"

	// PostgresTriggersCreated has status True when triggers have been created
	PostgresTriggersCreated apis.ConditionType = "TriggersCreated"

	// PostgresAdapterBindingReady has status True when the proper SQL binding for RA has been created
	PostgresAdapterBindingReady apis.ConditionType = "SQLBindingCreated"
)
View Source
const (
	// PostgresSourceConditionReady is set when the revision is starting to materialize
	// runtime resources, and becomes true when those resources are ready.
	PostgresSourceConditionReady = apis.ConditionReady
)
View Source
const (
	// PostgresSourceEventType is the PostgresSource CloudEvent type.
	PostgresSourceEventType = "dev.vaikas.sources.postgressource"
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: sources.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back 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 PostgresSource

type PostgresSource struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the desired state of the PostgresSource (from the client).
	Spec PostgresSourceSpec `json:"spec"`

	// Status communicates the observed state of the PostgresSource (from the controller).
	// +optional
	Status PostgresSourceStatus `json:"status,omitempty"`
}

+genclient +genreconciler +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +k8s:openapi-gen=true

func (*PostgresSource) DeepCopy

func (in *PostgresSource) DeepCopy() *PostgresSource

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

func (*PostgresSource) DeepCopyInto

func (in *PostgresSource) DeepCopyInto(out *PostgresSource)

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

func (*PostgresSource) DeepCopyObject

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

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

func (*PostgresSource) GetConditionSet

func (*PostgresSource) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*PostgresSource) GetGroupVersionKind

func (s *PostgresSource) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind returns the GroupVersionKind.

func (*PostgresSource) GetStatus

func (t *PostgresSource) GetStatus() *duckv1.Status

GetStatus retrieves the status of the PostgresSource. Implements the KRShaped interface.

func (*PostgresSource) Validate

func (ps *PostgresSource) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type PostgresSourceList

type PostgresSourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []PostgresSource `json:"items"`
}

PostgresSourceList is a list of PostgresSource resources

func (*PostgresSourceList) DeepCopy

func (in *PostgresSourceList) DeepCopy() *PostgresSourceList

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

func (*PostgresSourceList) DeepCopyInto

func (in *PostgresSourceList) DeepCopyInto(out *PostgresSourceList)

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

func (*PostgresSourceList) DeepCopyObject

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

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

type PostgresSourceSpec

type PostgresSourceSpec struct {
	// inherits duck/v1 SourceSpec, which currently provides:
	// * Sink - a reference to an object that will resolve to a domain name or
	//   a URI directly to use as the sink.
	// * CloudEventOverrides - defines overrides to control the output format
	//   and modifications of the event sent to the sink.
	duckv1.SourceSpec `json:",inline"`

	// Tables to subscribe to
	// TODO: more granularity?
	Tables []TableSpec `json:"tables,omitempty"`

	// ServiceAccountName holds the name of the Kubernetes service account
	// as which the underlying K8s resources should be run. If unspecified
	// the controller will create a service account owned by this Source.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// Secret to use when creating functions/triggers on the database.
	// You can use this to override the secret that's typically a
	// a binding for the entire controller.
	// The secret must have a field 'connectionstr' in the data
	// section, for example:
	// apiVersion: v1
	// kind: Secret
	// data:
	//  connectionstr: <base64 encoded connection string>
	// type: Opaque
	//
	Secret corev1.LocalObjectReference `json:"secret"`
}

PostgresSourceSpec holds the desired state of the PostgresSource (from the client).

func (*PostgresSourceSpec) DeepCopy

func (in *PostgresSourceSpec) DeepCopy() *PostgresSourceSpec

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

func (*PostgresSourceSpec) DeepCopyInto

func (in *PostgresSourceSpec) DeepCopyInto(out *PostgresSourceSpec)

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

func (*PostgresSourceSpec) Validate

func (pss *PostgresSourceSpec) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type PostgresSourceStatus

type PostgresSourceStatus struct {
	// inherits duck/v1 SourceStatus, which currently provides:
	// * ObservedGeneration - the 'Generation' of the Service that was last
	//   processed by the controller.
	// * Conditions - the latest available observations of a resource's current
	//   state.
	// * SinkURI - the current active sink URI that has been configured for the
	//   Source.
	duckv1.SourceStatus `json:",inline"`

	// Holds 1:1 status for the ones specified in the Spec.Tables
	TableStatuses []TableStatus `json:"tableStatuses,omitempty"`
}

PostgresSourceStatus communicates the observed state of the PostgresSource (from the controller).

func (*PostgresSourceStatus) DeepCopy

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

func (*PostgresSourceStatus) DeepCopyInto

func (in *PostgresSourceStatus) DeepCopyInto(out *PostgresSourceStatus)

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

func (*PostgresSourceStatus) GetCondition

GetCondition returns the condition currently associated with the given type, or nil.

func (*PostgresSourceStatus) InitializeConditions

func (s *PostgresSourceStatus) InitializeConditions()

InitializeConditions sets relevant unset conditions to Unknown state.

func (*PostgresSourceStatus) IsReady

func (s *PostgresSourceStatus) IsReady() bool

IsReady returns true if the resource is ready overall.

func (*PostgresSourceStatus) MarkNoSink

func (s *PostgresSourceStatus) MarkNoSink(reason, messageFormat string, messageA ...interface{})

MarkNoSink sets the condition that the source does not have a sink configured.

func (*PostgresSourceStatus) MarkSink

func (s *PostgresSourceStatus) MarkSink(uri *apis.URL)

MarkSink sets the condition that the source has a sink configured.

func (*PostgresSourceStatus) PropagateAuthStatus

func (s *PostgresSourceStatus) PropagateAuthStatus(status duckv1.Status)

func (*PostgresSourceStatus) PropagateDeploymentAvailability

func (s *PostgresSourceStatus) PropagateDeploymentAvailability(d *appsv1.Deployment)

PropagateDeploymentAvailability uses the availability of the provided Deployment to determine if PostgresConditionDeployed should be marked as true or false.

func (*PostgresSourceStatus) PropagateFunctionCreated

func (s *PostgresSourceStatus) PropagateFunctionCreated(exists bool, err error)

PropagateFunctionCreated propagates the status of the postgres function

func (*PostgresSourceStatus) PropagateTriggersCreated

func (s *PostgresSourceStatus) PropagateTriggersCreated(exists bool, err error)

PropagateTriggersCreated propagates the status of the postgres triggers

type TableSpec

type TableSpec struct {
	// TODO: make this more granular, like which operations, etc.
	Name string `json:"name"`
}

func (*TableSpec) DeepCopy

func (in *TableSpec) DeepCopy() *TableSpec

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

func (*TableSpec) DeepCopyInto

func (in *TableSpec) DeepCopyInto(out *TableSpec)

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

type TableStatus

type TableStatus struct {
	Subscribed bool `json:"subscribed"`
}

func (*TableStatus) DeepCopy

func (in *TableStatus) DeepCopy() *TableStatus

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

func (*TableStatus) DeepCopyInto

func (in *TableStatus) DeepCopyInto(out *TableStatus)

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

Jump to

Keyboard shortcuts

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