server

package
v0.0.0-...-f3301ad Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 20 Imported by: 3

Documentation

Index

Constants

View Source
const (
	UsernameSecretKey                 = "username"
	PasswordSecretKey                 = "password"
	FullyQualifiedServerNameSecretKey = "fullyQualifiedServerName"
	MySQLServerNameSecretKey          = "mySqlServerName"
	FullyQualifiedUsernameSecretKey   = "fullyQualifiedUsername"
)

Variables

This section is empty.

Functions

func MakeMySQLCheckNameAvailabilityAzureClient

func MakeMySQLCheckNameAvailabilityAzureClient(creds config.Credentials) mysql.CheckNameAvailabilityClient

func MakeMySQLServerAzureClient

func MakeMySQLServerAzureClient(creds config.Credentials) mysql.ServersClient

Types

type MySQLCredentials

type MySQLCredentials struct {
	// contains filtered or unexported fields
}

MySQLCredentials is a username/password pair for a MySQL account

type MySQLServerClient

type MySQLServerClient struct {
	Creds        config.Credentials
	SecretClient secrets.SecretClient
	Scheme       *runtime.Scheme
	// KubeReader is used to read secrets in the case the customer has specified a secret containing their
	// MySQLServer admin username/password
	KubeReader client.Reader
}

func NewMySQLServerClient

func NewMySQLServerClient(creds config.Credentials, secretClient secrets.SecretClient, scheme *runtime.Scheme, kubeReader client.Reader) *MySQLServerClient

func (*MySQLServerClient) CreateServerIfValid

func (m *MySQLServerClient) CreateServerIfValid(
	ctx context.Context,
	instance v1alpha2.MySQLServer,
	tags map[string]*string,
	skuInfo mysql.Sku,
	adminUser string,
	adminPassword string,
	createMode mysql.CreateMode) (pollingURL string, server mysql.Server, err error)

func (*MySQLServerClient) Delete

Delete idempotently ensures the server is gone from Azure

func (*MySQLServerClient) DeleteServer

func (m *MySQLServerClient) DeleteServer(ctx context.Context, resourcegroup string, servername string) (status string, err error)

func (*MySQLServerClient) Ensure

Ensure idempotently instantiates the requested server (if possible) in Azure

func (*MySQLServerClient) GetOrPrepareSecret

func (m *MySQLServerClient) GetOrPrepareSecret(
	ctx context.Context,
	secretClient secrets.SecretClient,
	instance *azurev1alpha2.MySQLServer,
	adminCredentials *MySQLCredentials) (map[string][]byte, error)

GetOrPrepareSecret gets the admin credentials if they are stored or generates some if not

func (*MySQLServerClient) GetParents

GetParents returns all the potential kube parents of the server

func (*MySQLServerClient) GetServer

func (m *MySQLServerClient) GetServer(ctx context.Context, resourcegroup string, servername string) (server mysql.Server, err error)

func (*MySQLServerClient) GetStatus

func (m *MySQLServerClient) GetStatus(obj runtime.Object) (*v1alpha1.ASOStatus, error)

GetStatus returns a pointer to the server resources' status sub-resource

func (*MySQLServerClient) GetUserProvidedAdminCredentials

func (m *MySQLServerClient) GetUserProvidedAdminCredentials(
	ctx context.Context,
	instance *azurev1alpha2.MySQLServer) (*MySQLCredentials, error)

GetUserProvidedAdminCredentials gets the user provided MySQLCredentials, or nil if none was specified by the user.

func (*MySQLServerClient) UpdateServerNameInSecret

func (m *MySQLServerClient) UpdateServerNameInSecret(ctx context.Context, secretClient secrets.SecretClient, data map[string][]byte, fullservername string, instance *azurev1alpha2.MySQLServer) error

UpdateSecretWithFullServerName updates the secret with the fully qualified server name

func (*MySQLServerClient) UpsertSecrets

func (m *MySQLServerClient) UpsertSecrets(ctx context.Context, secretClient secrets.SecretClient, data map[string][]byte, instance *azurev1alpha2.MySQLServer) error

UpsertSecrets saves the server's admin credentials in the secret store

type MySQLServerManager

type MySQLServerManager interface {
	CreateServerIfValid(ctx context.Context, servername string, resourcegroup string, location string, tags map[string]*string, serverversion mysql.ServerVersion, sslenforcement mysql.SslEnforcementEnum, skuInfo mysql.Sku, adminlogin string, adminpassword string, createmode string, sourceserver string) (pollingURL string, server mysql.Server, err error)
	DeleteServer(ctx context.Context, resourcegroup string, servername string) (string, error)
	GetServer(ctx context.Context, resourcegroup string, servername string) (mysql.Server, error)

	// also embed async client methods
	resourcemanager.ARMClient
}

Jump to

Keyboard shortcuts

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