resource

package
v0.0.0-...-acac327 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DbContainerName = "db"
)

Variables

This section is empty.

Functions

func ClusterPlaceholder

func ClusterPlaceholder(name string) *api.CrdbCluster

Types

type Builder

type Builder interface {
	Build(runtime.Object) error
	Placeholder() runtime.Object
}

type Cluster

type Cluster struct {
	Fetcher
	// contains filtered or unexported fields
}

func NewCluster

func NewCluster(original *api.CrdbCluster) Cluster

func (Cluster) ClientTLSSecretName

func (cluster Cluster) ClientTLSSecretName() string

func (Cluster) DiscoveryServiceName

func (cluster Cluster) DiscoveryServiceName() string

func (Cluster) Domain

func (cluster Cluster) Domain() string

func (Cluster) InitTime

func (cluster Cluster) InitTime() metav1.Time

func (Cluster) IsFresh

func (cluster Cluster) IsFresh(fetcher Fetcher) (bool, error)

func (Cluster) Name

func (cluster Cluster) Name() string

func (Cluster) Namespace

func (cluster Cluster) Namespace() string

func (Cluster) NodeTLSSecretName

func (cluster Cluster) NodeTLSSecretName() string

func (Cluster) ObjectKey

func (cluster Cluster) ObjectKey() types.NamespacedName

func (Cluster) PublicServiceName

func (cluster Cluster) PublicServiceName() string

func (Cluster) SecureMode

func (cluster Cluster) SecureMode() string

func (Cluster) SetFalse

func (cluster Cluster) SetFalse(ctype api.ClusterConditionType)

func (Cluster) SetTrue

func (cluster Cluster) SetTrue(ctype api.ClusterConditionType)

func (Cluster) Spec

func (cluster Cluster) Spec() *api.CrdbClusterSpec

func (Cluster) StatefulSetName

func (cluster Cluster) StatefulSetName() string

func (Cluster) Status

func (cluster Cluster) Status() *api.CrdbClusterStatus

func (Cluster) Unwrap

func (cluster Cluster) Unwrap() *api.CrdbCluster

type DiscoveryServiceBuilder

type DiscoveryServiceBuilder struct {
	*Cluster

	Selector map[string]string
}

This service only exists to create DNS entries for each pod in the StatefulSet such that they can resolve each other's IP addresses. It does not create a load-balanced ClusterIP and should not be used directly by clients in most circumstances.

func (DiscoveryServiceBuilder) Build

func (DiscoveryServiceBuilder) Placeholder

func (b DiscoveryServiceBuilder) Placeholder() runtime.Object

type Fetcher

type Fetcher interface {
	Fetch(obj runtime.Object) error
}

type KubeFetcher

type KubeFetcher struct {
	client.Reader
	// contains filtered or unexported fields
}

func NewKubeFetcher

func NewKubeFetcher(ctx context.Context, namespace string, reader client.Reader) *KubeFetcher

func (KubeFetcher) Fetch

func (f KubeFetcher) Fetch(o runtime.Object) error

type KubePersister

type KubePersister struct {
	client.Client
	// contains filtered or unexported fields
}

func NewKubePersister

func NewKubePersister(ctx context.Context, namespace string, client client.Client, persistFn kube.PersistFn) *KubePersister

func (KubePersister) Persist

func (p KubePersister) Persist(obj runtime.Object, mutateFn func() error) (upserted bool, err error)

type ManagedResource

type ManagedResource struct {
	Resource

	labels.Labels
}

func NewManagedKubeResource

func NewManagedKubeResource(ctx context.Context, client client.Client, cluster *Cluster, persistFn kube.PersistFn) ManagedResource

type Persister

type Persister interface {
	Persist(obj runtime.Object, mutateFn func() error) (upserted bool, err error)
}

type PublicServiceBuilder

type PublicServiceBuilder struct {
	*Cluster

	Selector map[string]string
}

func (PublicServiceBuilder) Build

func (PublicServiceBuilder) Placeholder

func (b PublicServiceBuilder) Placeholder() runtime.Object

type Reconciler

type Reconciler struct {
	ManagedResource

	Builder
	Owner  metav1.Object
	Scheme *runtime.Scheme
}

func (Reconciler) Reconcile

func (r Reconciler) Reconcile() (upserted bool, err error)

type Resource

type Resource struct {
	Fetcher
	Persister
}

func NewKubeResource

func NewKubeResource(ctx context.Context, client client.Client, namespace string, persistFn kube.PersistFn) Resource

type StatefulSetBuilder

type StatefulSetBuilder struct {
	*Cluster

	Selector labels.Labels
}

func (StatefulSetBuilder) Build

func (b StatefulSetBuilder) Build(obj runtime.Object) error

func (StatefulSetBuilder) Placeholder

func (b StatefulSetBuilder) Placeholder() runtime.Object

type TLSSecret

type TLSSecret struct {
	Resource
	// contains filtered or unexported fields
}

func LoadTLSSecret

func LoadTLSSecret(name string, r Resource) (*TLSSecret, error)

func (*TLSSecret) Key

func (s *TLSSecret) Key() []byte

func (*TLSSecret) Ready

func (s *TLSSecret) Ready() bool

func (*TLSSecret) UpdateCertAndCA

func (s *TLSSecret) UpdateCertAndCA(cert, ca []byte, log logr.Logger) error

func (*TLSSecret) UpdateKey

func (s *TLSSecret) UpdateKey(key []byte) error

Jump to

Keyboard shortcuts

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