v1alpha1

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the db v1alpha1 API group +kubebuilder:object:generate=true +groupName=db.atlasgo.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "db.atlasgo.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type AtlasMigration added in v0.1.7

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

	Spec   AtlasMigrationSpec   `json:"spec,omitempty"`
	Status AtlasMigrationStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status

AtlasMigration is the Schema for the atlasmigrations API +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` +kubebuilder:printcolumn:name="Reason",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason`

func (*AtlasMigration) DeepCopy added in v0.1.7

func (in *AtlasMigration) DeepCopy() *AtlasMigration

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

func (*AtlasMigration) DeepCopyInto added in v0.1.7

func (in *AtlasMigration) DeepCopyInto(out *AtlasMigration)

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

func (*AtlasMigration) DeepCopyObject added in v0.1.7

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

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

func (*AtlasMigration) IsHashModified added in v0.1.8

func (m *AtlasMigration) IsHashModified(hash string) bool

IsHashModified returns true if the hash is different from the observed hash.

func (*AtlasMigration) IsReady added in v0.1.8

func (m *AtlasMigration) IsReady() bool

IsReady returns true if the ready condition is true.

func (*AtlasMigration) NamespacedName added in v0.1.7

func (m *AtlasMigration) NamespacedName() types.NamespacedName

NamespacedName returns the namespaced name of the object.

func (*AtlasMigration) SetNotReady added in v0.1.8

func (m *AtlasMigration) SetNotReady(reason, message string)

SetNotReady sets the ready condition to false.

func (*AtlasMigration) SetReady added in v0.1.8

func (m *AtlasMigration) SetReady(status AtlasMigrationStatus)

SetReady sets the ready condition to true.

type AtlasMigrationList added in v0.1.7

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

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

+kubebuilder:object:root=true

AtlasMigrationList contains a list of AtlasMigration

func (*AtlasMigrationList) DeepCopy added in v0.1.7

func (in *AtlasMigrationList) DeepCopy() *AtlasMigrationList

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

func (*AtlasMigrationList) DeepCopyInto added in v0.1.7

func (in *AtlasMigrationList) DeepCopyInto(out *AtlasMigrationList)

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

func (*AtlasMigrationList) DeepCopyObject added in v0.1.7

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

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

type AtlasMigrationSpec added in v0.1.7

type AtlasMigrationSpec struct {
	TargetSpec `json:",inline"`
	// EnvName sets the environment name used for reporting runs to Atlas Cloud.
	EnvName string `json:"envName,omitempty"`
	// Cloud defines the Atlas Cloud configuration.
	Cloud Cloud `json:"cloud,omitempty"`
	// Dir defines the directory to use for migrations as a configmap key reference.
	Dir Dir `json:"dir"`
	// RevisionsSchema defines the schema that revisions table resides in
	RevisionsSchema string `json:"revisionsSchema,omitempty"`
	// BaselineVersion defines the baseline version of the database on the first migration.
	Baseline string `json:"baseline,omitempty"`
}

AtlasMigrationSpec defines the desired state of AtlasMigration

func (*AtlasMigrationSpec) DeepCopy added in v0.1.7

func (in *AtlasMigrationSpec) DeepCopy() *AtlasMigrationSpec

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

func (*AtlasMigrationSpec) DeepCopyInto added in v0.1.7

func (in *AtlasMigrationSpec) DeepCopyInto(out *AtlasMigrationSpec)

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

type AtlasMigrationStatus added in v0.1.7

type AtlasMigrationStatus struct {
	// Conditions represent the latest available observations of an object's state.
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// LastAppliedVersion is the version of the most recent successful versioned migration.
	LastAppliedVersion string `json:"lastAppliedVersion,omitempty"`
	//LastDeploymentURL is the Deployment URL of the most recent successful versioned migration.
	LastDeploymentURL string `json:"lastDeploymentUrl,omitempty"`
	// ObservedHash is the hash of the most recent successful versioned migration.
	ObservedHash string `json:"observed_hash"`
	// LastApplied is the unix timestamp of the most recent successful versioned migration.
	LastApplied int64 `json:"lastApplied"`
}

AtlasMigrationStatus defines the observed state of AtlasMigration

func (*AtlasMigrationStatus) DeepCopy added in v0.1.7

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

func (*AtlasMigrationStatus) DeepCopyInto added in v0.1.7

func (in *AtlasMigrationStatus) DeepCopyInto(out *AtlasMigrationStatus)

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

type AtlasSchema

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

	Spec   AtlasSchemaSpec   `json:"spec,omitempty"`
	Status AtlasSchemaStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status

AtlasSchema is the Schema for the atlasschemas API +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` +kubebuilder:printcolumn:name="Reason",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason`

func (*AtlasSchema) DeepCopy

func (in *AtlasSchema) DeepCopy() *AtlasSchema

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

func (*AtlasSchema) DeepCopyInto

func (in *AtlasSchema) DeepCopyInto(out *AtlasSchema)

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

func (*AtlasSchema) DeepCopyObject

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

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

func (*AtlasSchema) IsHashModified added in v0.3.1

func (sc *AtlasSchema) IsHashModified(hash string) bool

IsHashModified returns true if the hash is different from the observed hash.

func (*AtlasSchema) IsReady added in v0.3.1

func (m *AtlasSchema) IsReady() bool

IsReady returns true if the ready condition is true.

func (*AtlasSchema) NamespacedName added in v0.1.7

func (s *AtlasSchema) NamespacedName() types.NamespacedName

NamespacedName returns the namespaced name of the object.

func (*AtlasSchema) SetNotReady added in v0.3.1

func (sc *AtlasSchema) SetNotReady(reason, msg string)

SetNotReady sets the Ready condition to false with the given reason and message.

func (*AtlasSchema) SetReady added in v0.3.1

func (sc *AtlasSchema) SetReady(status AtlasSchemaStatus, report any)

SetReady sets the Ready condition to true

type AtlasSchemaList

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

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

+kubebuilder:object:root=true

AtlasSchemaList contains a list of AtlasSchema

func (*AtlasSchemaList) DeepCopy

func (in *AtlasSchemaList) DeepCopy() *AtlasSchemaList

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

func (*AtlasSchemaList) DeepCopyInto

func (in *AtlasSchemaList) DeepCopyInto(out *AtlasSchemaList)

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

func (*AtlasSchemaList) DeepCopyObject

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

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

type AtlasSchemaSpec

type AtlasSchemaSpec struct {
	TargetSpec `json:",inline"`
	// Desired Schema of the target.
	Schema Schema `json:"schema,omitempty"`
	// +optional
	// DevURL is the URL of the database to use for normalization and calculations.
	// If not specified, the operator will spin up a temporary database container to use for these operations.
	DevURL string `json:"devURL"`
	// DevURLFrom is a reference to a secret containing the URL of the database to use for normalization and calculations.
	// +optional
	DevURLFrom Secret `json:"devURLFrom,omitempty"`
	// Exclude a list of glob patterns used to filter existing resources being taken into account.
	Exclude []string `json:"exclude,omitempty"`
	// Policy defines the policies to apply when managing the schema change lifecycle.
	Policy Policy `json:"policy,omitempty"`
	// The names of the schemas (named databases) on the target database to be managed.
	Schemas []string `json:"schemas,omitempty"`
}

AtlasSchemaSpec defines the desired state of AtlasSchema

func (*AtlasSchemaSpec) DeepCopy

func (in *AtlasSchemaSpec) DeepCopy() *AtlasSchemaSpec

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

func (*AtlasSchemaSpec) DeepCopyInto

func (in *AtlasSchemaSpec) DeepCopyInto(out *AtlasSchemaSpec)

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

type AtlasSchemaStatus

type AtlasSchemaStatus struct {
	// Conditions represent the latest available observations of an object's state.
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// ObservedHash is the hash of the most recently applied schema.
	ObservedHash string `json:"observed_hash"`
	// LastApplied is the unix timestamp of the most recent successful schema apply operation.
	LastApplied int64 `json:"last_applied"`
}

AtlasSchemaStatus defines the observed state of AtlasSchema

func (*AtlasSchemaStatus) DeepCopy

func (in *AtlasSchemaStatus) DeepCopy() *AtlasSchemaStatus

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

func (*AtlasSchemaStatus) DeepCopyInto

func (in *AtlasSchemaStatus) DeepCopyInto(out *AtlasSchemaStatus)

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

type CheckConfig

type CheckConfig struct {
	Error bool `json:"error,omitempty"`
}

CheckConfig defines the configuration of a linting check.

func (*CheckConfig) DeepCopy

func (in *CheckConfig) DeepCopy() *CheckConfig

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

func (*CheckConfig) DeepCopyInto

func (in *CheckConfig) DeepCopyInto(out *CheckConfig)

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

type Cloud added in v0.1.7

type Cloud struct {
	URL       string    `json:"url,omitempty"`
	TokenFrom TokenFrom `json:"tokenFrom,omitempty"`
	Project   string    `json:"project,omitempty"`
}

Cloud defines the Atlas Cloud configuration.

func (*Cloud) DeepCopy added in v0.1.7

func (in *Cloud) DeepCopy() *Cloud

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

func (*Cloud) DeepCopyInto added in v0.1.7

func (in *Cloud) DeepCopyInto(out *Cloud)

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

type Credentials added in v0.2.2

type Credentials struct {
	Scheme       string            `json:"scheme,omitempty"`
	User         string            `json:"user,omitempty"`
	UserFrom     Secret            `json:"userFrom,omitempty"`
	Password     string            `json:"password,omitempty"`
	PasswordFrom Secret            `json:"passwordFrom,omitempty"`
	Host         string            `json:"host,omitempty"`
	HostFrom     Secret            `json:"hostFrom,omitempty"`
	Port         int               `json:"port,omitempty"`
	Database     string            `json:"database,omitempty"`
	Parameters   map[string]string `json:"parameters,omitempty"`
}

Credentials defines the credentials to use when connecting to the database.

func (*Credentials) DeepCopy added in v0.2.2

func (in *Credentials) DeepCopy() *Credentials

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

func (*Credentials) DeepCopyInto added in v0.2.2

func (in *Credentials) DeepCopyInto(out *Credentials)

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

func (*Credentials) URL added in v0.2.2

func (c *Credentials) URL() *url.URL

URL returns the URL for the database.

type Diff

type Diff struct {
	Skip SkipChanges `json:"skip,omitempty"`
}

Diff defines the diff policies to apply when planning schema changes.

func (*Diff) DeepCopy

func (in *Diff) DeepCopy() *Diff

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

func (*Diff) DeepCopyInto

func (in *Diff) DeepCopyInto(out *Diff)

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

type Dir added in v0.1.7

type Dir struct {
	// ConfigMapRef defines the configmap to use for migrations
	ConfigMapRef *corev1.LocalObjectReference `json:"configMapRef,omitempty"`
	// Remote defines the Atlas Cloud migration directory.
	Remote Remote `json:"remote,omitempty"`
	// Local defines the local migration directory.
	Local map[string]string `json:"local,omitempty"`
}

Dir defines the place where migrations are stored.

func (*Dir) DeepCopy added in v0.1.7

func (in *Dir) DeepCopy() *Dir

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

func (*Dir) DeepCopyInto added in v0.1.7

func (in *Dir) DeepCopyInto(out *Dir)

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

type Lint

type Lint struct {
	Destructive CheckConfig `json:"destructive,omitempty"`
}

Lint defines the linting policies to apply before applying the schema.

func (*Lint) DeepCopy

func (in *Lint) DeepCopy() *Lint

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

func (*Lint) DeepCopyInto

func (in *Lint) DeepCopyInto(out *Lint)

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

type Policy

type Policy struct {
	Lint Lint `json:"lint,omitempty"`
	Diff Diff `json:"diff,omitempty"`
}

Policy defines the policies to apply when managing the schema change lifecycle.

func (*Policy) DeepCopy

func (in *Policy) DeepCopy() *Policy

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

func (*Policy) DeepCopyInto

func (in *Policy) DeepCopyInto(out *Policy)

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

type Remote added in v0.1.7

type Remote struct {
	Name string `json:"name,omitempty"`
	Tag  string `json:"tag,omitempty"`
}

Remote defines the Atlas Cloud directory migration.

func (*Remote) DeepCopy added in v0.1.7

func (in *Remote) DeepCopy() *Remote

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

func (*Remote) DeepCopyInto added in v0.1.7

func (in *Remote) DeepCopyInto(out *Remote)

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

type Schema

type Schema struct {
	SQL             string                       `json:"sql,omitempty"`
	HCL             string                       `json:"hcl,omitempty"`
	ConfigMapKeyRef *corev1.ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
}

Schema defines the desired state of the target database schema in plain SQL or HCL.

func (Schema) Content added in v0.3.1

func (s Schema) Content(ctx context.Context, r client.Reader, ns string) ([]byte, string, error)

Content returns the desired schema of the AtlasSchema.

func (*Schema) DeepCopy

func (in *Schema) DeepCopy() *Schema

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

func (*Schema) DeepCopyInto

func (in *Schema) DeepCopyInto(out *Schema)

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

type Secret added in v0.3.3

type Secret struct {
	// SecretKeyRef defines the secret key reference to use for the user.
	SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}

Secret defines a secret key reference.

func (*Secret) DeepCopy added in v0.3.3

func (in *Secret) DeepCopy() *Secret

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

func (*Secret) DeepCopyInto added in v0.3.3

func (in *Secret) DeepCopyInto(out *Secret)

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

type SkipChanges

type SkipChanges struct {
	// +optional
	AddSchema bool `json:"add_schema,omitempty"`
	// +optional
	DropSchema bool `json:"drop_schema,omitempty"`
	// +optional
	ModifySchema bool `json:"modify_schema,omitempty"`
	// +optional
	AddTable bool `json:"add_table,omitempty"`
	// +optional
	DropTable bool `json:"drop_table,omitempty"`
	// +optional
	ModifyTable bool `json:"modify_table,omitempty"`
	// +optional
	AddColumn bool `json:"add_column,omitempty"`
	// +optional
	DropColumn bool `json:"drop_column,omitempty"`
	// +optional
	ModifyColumn bool `json:"modify_column,omitempty"`
	// +optional
	AddIndex bool `json:"add_index,omitempty"`
	// +optional
	DropIndex bool `json:"drop_index,omitempty"`
	// +optional
	ModifyIndex bool `json:"modify_index,omitempty"`
	// +optional
	AddForeignKey bool `json:"add_foreign_key,omitempty"`
	// +optional
	DropForeignKey bool `json:"drop_foreign_key,omitempty"`
	// +optional
	ModifyForeignKey bool `json:"modify_foreign_key,omitempty"`
}

SkipChanges represents the skip changes policy.

func (*SkipChanges) DeepCopy

func (in *SkipChanges) DeepCopy() *SkipChanges

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

func (*SkipChanges) DeepCopyInto

func (in *SkipChanges) DeepCopyInto(out *SkipChanges)

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

type TargetSpec added in v0.3.1

type TargetSpec struct {
	// URL of the target database schema.
	URL string `json:"url,omitempty"`
	// URLs may be defined as a secret key reference.
	URLFrom Secret `json:"urlFrom,omitempty"`
	// Credentials defines the credentials to use when connecting to the database.
	// Used instead of URL or URLFrom.
	Credentials Credentials `json:"credentials,omitempty"`
}

TargetSpec defines the target database to manage.

func (TargetSpec) DatabaseURL added in v0.3.1

func (s TargetSpec) DatabaseURL(ctx context.Context, r client.Reader, ns string) (*url.URL, error)

DatabaseURL returns the database url.

func (*TargetSpec) DeepCopy added in v0.3.1

func (in *TargetSpec) DeepCopy() *TargetSpec

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

func (*TargetSpec) DeepCopyInto added in v0.3.1

func (in *TargetSpec) DeepCopyInto(out *TargetSpec)

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

type TokenFrom added in v0.1.7

type TokenFrom struct {
	// SecretKeyRef references to the key of a secret in the same namespace.
	SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}

TokenFrom defines a reference to a secret key that contains the Atlas Cloud Token

func (*TokenFrom) DeepCopy added in v0.1.7

func (in *TokenFrom) DeepCopy() *TokenFrom

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

func (*TokenFrom) DeepCopyInto added in v0.1.7

func (in *TokenFrom) DeepCopyInto(out *TokenFrom)

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