Documentation
¶
Overview ¶
package v1alpha4 contains API Schema definitions for the databases v1alpha4 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/schemahero/schemahero/pkg/apis/databases +k8s:defaulter-gen=TypeMeta +groupName=databases.schemahero.io
package v1alpha4 contains API Schema definitions for the databases v1alpha4 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/schemahero/schemahero/pkg/apis/databases +k8s:defaulter-gen=TypeMeta +groupName=databases.schemahero.io
Index ¶
- Variables
- func Resource(resource string) schema.GroupResource
- type CassandraConnection
- type CockroachDBConnection
- type Database
- func (in *Database) DeepCopy() *Database
- func (in *Database) DeepCopyInto(out *Database)
- func (in *Database) DeepCopyObject() runtime.Object
- func (d Database) GetConnection(ctx context.Context) (string, string, error)
- func (d *Database) GetVaultAnnotations() (map[string]string, error)
- func (d Database) UsingVault() bool
- type DatabaseConnection
- type DatabaseList
- type DatabaseSpec
- type DatabaseStatus
- type DatabaseTemplate
- type MysqlConnection
- type PostgresConnection
- type SSM
- type SchemaHero
- type SecretKeyRef
- type SqliteConnection
- type ValueFrom
- type ValueFromSecret
- type ValueOrSecretRef
- type ValueOrValueFrom
- type Vault
Constants ¶
This section is empty.
Variables ¶
var ( // SchemeGroupVersion is group version used to register these objects SchemeGroupVersion = schema.GroupVersion{Group: "databases.schemahero.io", Version: "v1alpha4"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} // AddToScheme is required by pkg/client/... AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource is required by pkg/client/listers/...
Types ¶
type CassandraConnection ¶ added in v0.12.0
type CassandraConnection struct { Hosts []string `json:"hosts"` Keyspace ValueOrValueFrom `json:"keyspace"` Username ValueOrValueFrom `json:"username,omitempty"` Password ValueOrValueFrom `json:"password,omitempty"` }
func (*CassandraConnection) DeepCopy ¶ added in v0.12.0
func (in *CassandraConnection) DeepCopy() *CassandraConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CassandraConnection.
func (*CassandraConnection) DeepCopyInto ¶ added in v0.12.0
func (in *CassandraConnection) DeepCopyInto(out *CassandraConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CockroachDBConnection ¶
type CockroachDBConnection struct { URI ValueOrValueFrom `json:"uri,omitempty"` Host ValueOrValueFrom `json:"host,omitempty"` Port ValueOrValueFrom `json:"port,omitempty"` User ValueOrValueFrom `json:"user,omitempty"` Password ValueOrValueFrom `json:"password,omitempty"` DBName ValueOrValueFrom `json:"dbname,omitempty"` SSLMode ValueOrValueFrom `json:"sslmode,omitempty"` CurrentSchema ValueOrValueFrom `json:"schema,omitempty"` }
func (*CockroachDBConnection) DeepCopy ¶
func (in *CockroachDBConnection) DeepCopy() *CockroachDBConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CockroachDBConnection.
func (*CockroachDBConnection) DeepCopyInto ¶
func (in *CockroachDBConnection) DeepCopyInto(out *CockroachDBConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Database ¶
type Database struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec DatabaseSpec `json:"spec"` Status DatabaseStatus `json:"status,omitempty"` }
Database is the Schema for the databases API +k8s:openapi-gen=true +kubebuilder:subresource:status
func (*Database) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Database.
func (*Database) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Database) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (Database) GetConnection ¶ added in v0.10.0
GetConnection returns driver name, uri, and any error
func (*Database) GetVaultAnnotations ¶
GetVaultAnnotations configures the required Vault annotations to work with Vault secret injection, or returns an error if the Database is misconfigured for Vault. If there is a connection template specified it will be used otherwise a default is provided for the supported database types.
func (Database) UsingVault ¶
UsingVault determines whether the specific Database connection is configured using a Vault secret
type DatabaseConnection ¶
type DatabaseConnection struct { Postgres *PostgresConnection `json:"postgres,omitempty"` Mysql *MysqlConnection `json:"mysql,omitempty"` CockroachDB *CockroachDBConnection `json:"cockroachdb,omitempty"` Cassandra *CassandraConnection `json:"cassandra,omitempty"` SQLite *SqliteConnection `json:"sqlite,omitempty"` }
DatabaseConnection defines connection parameters for the database driver
func (*DatabaseConnection) DeepCopy ¶
func (in *DatabaseConnection) DeepCopy() *DatabaseConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseConnection.
func (*DatabaseConnection) DeepCopyInto ¶
func (in *DatabaseConnection) DeepCopyInto(out *DatabaseConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseList ¶
type DatabaseList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Database `json:"items"` }
DatabaseList contains a list of Database
func (*DatabaseList) DeepCopy ¶
func (in *DatabaseList) DeepCopy() *DatabaseList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseList.
func (*DatabaseList) DeepCopyInto ¶
func (in *DatabaseList) DeepCopyInto(out *DatabaseList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DatabaseList) DeepCopyObject ¶
func (in *DatabaseList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DatabaseSpec ¶
type DatabaseSpec struct { Connection DatabaseConnection `json:"connection,omitempty"` EnableShellCommand bool `json:"enableShellCommand,omitempty"` ImmediateDeploy bool `json:"immediateDeploy,omitempty"` SchemaHero *SchemaHero `json:"schemahero,omitempty"` Template *DatabaseTemplate `json:"template,omitempty"` }
func (*DatabaseSpec) DeepCopy ¶
func (in *DatabaseSpec) DeepCopy() *DatabaseSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseSpec.
func (*DatabaseSpec) DeepCopyInto ¶
func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseStatus ¶
type DatabaseStatus struct { IsConnected bool `json:"isConnected"` LastPing string `json:"lastPing"` }
DatabaseStatus defines the observed state of Database
func (*DatabaseStatus) DeepCopy ¶
func (in *DatabaseStatus) DeepCopy() *DatabaseStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus.
func (*DatabaseStatus) DeepCopyInto ¶
func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseTemplate ¶ added in v0.12.3
type DatabaseTemplate struct {
metav1.ObjectMeta `json:"metadata,omitempty"`
}
func (*DatabaseTemplate) DeepCopy ¶ added in v0.12.3
func (in *DatabaseTemplate) DeepCopy() *DatabaseTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseTemplate.
func (*DatabaseTemplate) DeepCopyInto ¶ added in v0.12.3
func (in *DatabaseTemplate) DeepCopyInto(out *DatabaseTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MysqlConnection ¶
type MysqlConnection struct { URI ValueOrValueFrom `json:"uri,omitempty"` Host ValueOrValueFrom `json:"host,omitempty"` Port ValueOrValueFrom `json:"port,omitempty"` User ValueOrValueFrom `json:"user,omitempty"` Password ValueOrValueFrom `json:"password,omitempty"` DBName ValueOrValueFrom `json:"dbname,omitempty"` // +kubebuilder:validation:Optional DisableTLS bool `json:"disableTLS"` DefaultCharset string `json:"defaultCharset,omitempty"` Collation string `json:"collation,omitempty"` }
func (*MysqlConnection) DeepCopy ¶
func (in *MysqlConnection) DeepCopy() *MysqlConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MysqlConnection.
func (*MysqlConnection) DeepCopyInto ¶
func (in *MysqlConnection) DeepCopyInto(out *MysqlConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgresConnection ¶
type PostgresConnection struct { URI ValueOrValueFrom `json:"uri,omitempty"` Host ValueOrValueFrom `json:"host,omitempty"` Port ValueOrValueFrom `json:"port,omitempty"` User ValueOrValueFrom `json:"user,omitempty"` Password ValueOrValueFrom `json:"password,omitempty"` DBName ValueOrValueFrom `json:"dbname,omitempty"` SSLMode ValueOrValueFrom `json:"sslmode,omitempty"` CurrentSchema ValueOrValueFrom `json:"schema,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.
type SSM ¶ added in v0.10.0
type SSM struct { Name string `json:"name" yaml:"name"` WithDecryption bool `json:"withDecryption,omitempty" yaml:"withDecryption,omitempty"` Region string `json:"region,omitempty" yaml:"region,omitempty"` AccessKeyID *ValueOrSecretRef `json:"accessKeyId,omitempty" yaml:"accessKeyId,omitempty"` SecretAccessKey *ValueOrSecretRef `json:"secretAccessKey,omitempty" yaml:"secretAccessKey,omitempty"` }
func (*SSM) DeepCopy ¶ added in v0.10.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSM.
func (*SSM) DeepCopyInto ¶ added in v0.10.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SchemaHero ¶
type SchemaHero struct { Image string `json:"image,omitempty"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` }
func (*SchemaHero) DeepCopy ¶
func (in *SchemaHero) DeepCopy() *SchemaHero
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaHero.
func (*SchemaHero) DeepCopyInto ¶
func (in *SchemaHero) DeepCopyInto(out *SchemaHero)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SecretKeyRef ¶
type SecretKeyRef struct { Name string `json:"name" yaml:"name"` Key string `json:"key" yaml:"key"` }
func (*SecretKeyRef) DeepCopy ¶
func (in *SecretKeyRef) DeepCopy() *SecretKeyRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeyRef.
func (*SecretKeyRef) DeepCopyInto ¶
func (in *SecretKeyRef) DeepCopyInto(out *SecretKeyRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SqliteConnection ¶ added in v0.12.0
type SqliteConnection struct {
DSN string `json:"dsn"`
}
func (*SqliteConnection) DeepCopy ¶ added in v0.12.0
func (in *SqliteConnection) DeepCopy() *SqliteConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqliteConnection.
func (*SqliteConnection) DeepCopyInto ¶ added in v0.12.0
func (in *SqliteConnection) DeepCopyInto(out *SqliteConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ValueFrom ¶
type ValueFrom struct { SecretKeyRef *SecretKeyRef `json:"secretKeyRef,omitempty" yaml:"secretKeyRef,omitempty"` Vault *Vault `json:"vault,omitempty" yaml:"vault,omitempty"` SSM *SSM `json:"ssm,omitempty" yaml:"ssm,omitempty"` }
func (*ValueFrom) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueFrom.
func (*ValueFrom) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ValueFromSecret ¶ added in v0.10.0
type ValueFromSecret struct {
SecretKeyRef *SecretKeyRef `json:"secretKeyRef,omitempty" yaml:"secretKeyRef,omitempty"`
}
func (*ValueFromSecret) DeepCopy ¶ added in v0.10.0
func (in *ValueFromSecret) DeepCopy() *ValueFromSecret
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueFromSecret.
func (*ValueFromSecret) DeepCopyInto ¶ added in v0.10.0
func (in *ValueFromSecret) DeepCopyInto(out *ValueFromSecret)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ValueOrSecretRef ¶ added in v0.10.0
type ValueOrSecretRef struct { Value string `json:"value" yaml:"value"` ValueFrom *ValueFromSecret `json:"valueFrom,omitempty" yaml:"valueFrom,omitempty"` }
func (*ValueOrSecretRef) DeepCopy ¶ added in v0.10.0
func (in *ValueOrSecretRef) DeepCopy() *ValueOrSecretRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueOrSecretRef.
func (*ValueOrSecretRef) DeepCopyInto ¶ added in v0.10.0
func (in *ValueOrSecretRef) DeepCopyInto(out *ValueOrSecretRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ValueOrValueFrom ¶
type ValueOrValueFrom struct { Value string `json:"value,omitempty" yaml:"value,omitempty"` ValueFrom *ValueFrom `json:"valueFrom,omitempty" yaml:"valueFrom,omitempty"` }
func (*ValueOrValueFrom) DeepCopy ¶
func (in *ValueOrValueFrom) DeepCopy() *ValueOrValueFrom
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueOrValueFrom.
func (*ValueOrValueFrom) DeepCopyInto ¶
func (in *ValueOrValueFrom) DeepCopyInto(out *ValueOrValueFrom)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ValueOrValueFrom) GetVaultDetails ¶
func (v *ValueOrValueFrom) GetVaultDetails() (*Vault, error)
GetVaultDetails returns the configured Vault details for the ValueOrValueFrom, or returns error if Vault stanza is missing
func (*ValueOrValueFrom) HasVaultSecret ¶
func (v *ValueOrValueFrom) HasVaultSecret() bool
HasVaultSecret returns true if the ValueOrValueFrom contains a Vault stanza
func (*ValueOrValueFrom) IsEmpty ¶ added in v0.10.2
func (v *ValueOrValueFrom) IsEmpty() bool
IsEmpty returns true if there is not a value in value and valuefrom
type Vault ¶
type Vault struct { AgentInject bool `json:"agentInject,omitempty" yaml:"agentInject,omitempty"` Secret string `json:"secret" yaml:"secret"` Role string `json:"role" yaml:"role"` Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` ServiceAccount string `json:"serviceAccount,omitempty" yaml:"serviceAccount,omitempty"` ServiceAccountNamespace string `json:"serviceAccountNamespace,omitempty" yaml:"serviceAccountNamespace,omitempty"` ConnectionTemplate string `json:"connectionTemplate,omitempty" yaml:"connectionTemplate,omitempty"` KubernetesAuthEndpoint string `json:"kubernetesAuthEndpoint,omitempty" yaml:"kubernetesAuthEndpoint,omitempty"` }
func (*Vault) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Vault.
func (*Vault) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.