model

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 24 Imported by: 14

Documentation

Index

Constants

View Source
const (
	// InstallationAffinityIsolated means that no peer installations are allowed in the same cluster.
	InstallationAffinityIsolated = "isolated"
	// InstallationAffinityMultiTenant means peer installations are allowed in the same cluster.
	InstallationAffinityMultiTenant = "multitenant"
)
View Source
const (
	// OperationTypeMigration is used for CIs migration from source to target cluster.
	OperationTypeMigration = "MigratingClusterInstallation"
	// OperationTypeDNS is used for DNS Switch from source to target cluster.
	OperationTypeDNS = "DNSSwitch"
	// OperationTypeSwitchClusterRoles is used for Switching the tags between source & target clusters.
	OperationTypeSwitchClusterRoles = "SwitchClusterRoles"
	// OperationTypeDeletingInActiveCIs is used for Deleting InActive ClusterInstallations from source clusters.
	OperationTypeDeletingInActiveCIs = "DeletingInActiveClusterInstallations"
)
View Source
const (
	// DatabaseMigrationStatusSetupIP indicates that database migration setup is still running.
	DatabaseMigrationStatusSetupIP = "setup-in-progress"
	// DatabaseMigrationStatusSetupComplete indicates that database migration setup is completed.
	DatabaseMigrationStatusSetupComplete = "setup-complete"
	// DatabaseMigrationStatusTeardownIP indicates that database migration teardown is still running.
	DatabaseMigrationStatusTeardownIP = "teardown-in-progress"
	// DatabaseMigrationStatusTeardownComplete indicates that database migration teardown is completed.
	DatabaseMigrationStatusTeardownComplete = "teardown-complete"
	// DatabaseMigrationStatusReplicationIP indicates that database migration replication process is still running.
	DatabaseMigrationStatusReplicationIP = "replication-in-progress"
	// DatabaseMigrationStatusReplicationComplete indicates that database migration process is completed.
	DatabaseMigrationStatusReplicationComplete = "replication-complete"
)
View Source
const (
	// ClusterInstallationStateCreationRequested is a cluster installation in the process of being created.
	ClusterInstallationStateCreationRequested = "creation-requested"
	// ClusterInstallationStateCreationFailed is a cluster installation that failed creation.
	ClusterInstallationStateCreationFailed = "creation-failed"
	// ClusterInstallationStateDeletionRequested is a cluster installation in the process of being deleted.
	ClusterInstallationStateDeletionRequested = "deletion-requested"
	// ClusterInstallationStateDeletionFailed is a cluster installation that failed deletion.
	ClusterInstallationStateDeletionFailed = "deletion-failed"
	// ClusterInstallationStateDeleted is a cluster installation that has been deleted
	ClusterInstallationStateDeleted = "deleted"
	// ClusterInstallationStateReconciling is a cluster installation that in undergoing changes and is not yet stable.
	ClusterInstallationStateReconciling = "reconciling"
	// ClusterInstallationStateReady is a cluster installation in a ready state where it is nearly stable.
	ClusterInstallationStateReady = "ready"
	// ClusterInstallationStateStable is a cluster installation in a stable state and undergoing no changes.
	ClusterInstallationStateStable = "stable"
)
View Source
const (
	// NetworkingCalico is Calico networking plugin.
	NetworkingCalico = "calico"
	// NetworkingAmazon is Amazon networking plugin.
	NetworkingAmazon = "amazon-vpc-routed-eni"
	// NetworkingVpcCni is Amazon VPC CNI networking plugin.
	NetworkingVpcCni = "amazon-vpc-cni"
)
View Source
const (
	// ClusterStateStable is a cluster in a stable state and undergoing no changes.
	ClusterStateStable = "stable"
	// ClusterStateCreationRequested is a cluster in the process of being created.
	ClusterStateCreationRequested = "creation-requested"
	// ClusterStateCreationInProgress is a cluster that is being actively created.
	ClusterStateCreationInProgress = "creation-in-progress"
	// ClusterStateWaitingForNodes is a cluster that is waiting for nodes to be ready
	ClusterStateWaitingForNodes = "waiting-for-nodes"
	// ClusterStateProvisionInProgress is a cluster in the process of being provisioned.
	ClusterStateProvisionInProgress = "provision-in-progress"
	// ClusterStateCreationFailed is a cluster that failed creation.
	ClusterStateCreationFailed = "creation-failed"
	// ClusterStateProvisioningRequested is a cluster in the process of being
	// provisioned with operators.
	ClusterStateProvisioningRequested = "provisioning-requested"
	// ClusterStateRefreshMetadata is a cluster that will have metadata refreshed.
	ClusterStateRefreshMetadata = "refresh-metadata"
	// ClusterStateProvisioningFailed is a cluster that failed provisioning.
	ClusterStateProvisioningFailed = "provisioning-failed"
	// ClusterStateUpgradeRequested is a cluster in the process of upgrading.
	ClusterStateUpgradeRequested = "upgrade-requested"
	// ClusterStateUpgradeFailed is a cluster that failed to upgrade.
	ClusterStateUpgradeFailed = "upgrade-failed"
	// ClusterStateResizeRequested is a cluster in the process of resizing.
	ClusterStateResizeRequested = "resize-requested"
	// ClusterStateResizeFailed is a cluster that failed to resize.
	ClusterStateResizeFailed = "resize-failed"
	// ClusterStateNodegroupsCreationRequested is a cluster in the process of creating nodegroups.
	ClusterStateNodegroupsCreationRequested = "nodegroups-creation-requested"
	// ClusterStateNodegroupsCreationFailed is a cluster that failed to create nodegroups.
	ClusterStateNodegroupsCreationFailed = "nodegroups-creation-failed"
	// ClusterStateDeletionRequested is a cluster in the process of being deleted.
	ClusterStateDeletionRequested = "deletion-requested"
	// ClusterStateDeletionFailed is a cluster that failed deletion.
	ClusterStateDeletionFailed = "deletion-failed"
	// ClusterStateDeleted is a cluster that has been deleted
	ClusterStateDeleted = "deleted"
)
View Source
const (
	// PrometheusOperatorCanonicalName is the canonical string representation of prometheus operator
	PrometheusOperatorCanonicalName = "prometheus-operator"
	// ThanosCanonicalName is the canonical string representation of thanos
	ThanosCanonicalName = "thanos"
	// NginxCanonicalName is the canonical string representation of nginx
	NginxCanonicalName = "nginx"
	// NginxInternalCanonicalName is the canonical string representation of nginx internal
	NginxInternalCanonicalName = "nginx-internal"
	// FluentbitCanonicalName is the canonical string representation of fluentbit
	FluentbitCanonicalName = "fluentbit"
	// TeleportCanonicalName is the canonical string representation of teleport
	TeleportCanonicalName = "teleport-kube-agent"
	// PgbouncerCanonicalName is the canonical string representation of pgbouncer
	PgbouncerCanonicalName = "pgbouncer"
	// PromtailCanonicalName is the canonical string representation of promtail
	PromtailCanonicalName = "promtail"
	// RtcdCanonicalName is the canonical string representation of RTCD
	RtcdCanonicalName = "rtcd"
	// NodeProblemDetectorCanonicalName is the canonical string representation of node problem detector
	NodeProblemDetectorCanonicalName = "node-problem-detector"
	// MetricsServerCanonicalName is the canonical string representation of metrics server
	MetricsServerCanonicalName = "metrics-server"
	// VeleroCanonicalName is the canonical string representation of velero
	VeleroCanonicalName = "velero"
	// CloudproberCanonicalName is the canonical string representation of Cloudprber
	CloudproberCanonicalName = "cloudprober"
	// GitlabOAuthTokenKey is the name of the Environment Variable which
	// may contain an OAuth token for accessing GitLab repositories over
	// HTTPS, used for fetching values files
	GitlabOAuthTokenKey = "GITLAB_OAUTH_TOKEN"
)
View Source
const (
	ProvisionerEKS  = "eks"
	NodeGroupWorker = "worker"
)
View Source
const (
	// AllPerPage signals the store to return all results, avoid pagination of any kind.
	AllPerPage = -1

	// NoInstallationsLimit signals the store to return all multitenant database instances independently
	// of the number of installations using each instance.
	NoInstallationsLimit = -1

	// NonApplicableState represents constant use for StateChangeEvents when resource did not have a previous state.
	NonApplicableState = "n/a"
)
View Source
const (
	// V1betaCRVersion is a Mattermost CR beta version.
	V1betaCRVersion = "installation.mattermost.com/v1beta1"
	// DefaultCRVersion is a default CR version used for new installations.
	DefaultCRVersion = V1betaCRVersion
	// DefaultDatabaseWeight is the default weight of a small or average-sized
	// installation that isn't hibernating.
	DefaultDatabaseWeight float64 = 1
	// HibernatingDatabaseWeight is the weight of a hibernating installation.
	HibernatingDatabaseWeight float64 = .75
)
View Source
const (
	// InstallationDatabaseMysqlOperator is a database hosted in kubernetes via the operator.
	InstallationDatabaseMysqlOperator = "mysql-operator"
	// InstallationDatabaseSingleTenantRDSMySQL is a MySQL database hosted via
	// Amazon RDS.
	// TODO: update name value to aws-rds-mysql
	InstallationDatabaseSingleTenantRDSMySQL = "aws-rds"
	// InstallationDatabaseSingleTenantRDSPostgres is a PostgreSQL database hosted
	// via Amazon RDS.
	InstallationDatabaseSingleTenantRDSPostgres = "aws-rds-postgres"
	// InstallationDatabaseMultiTenantRDSMySQL is a MySQL multitenant database
	// hosted via Amazon RDS.
	// TODO: update name value to aws-multitenant-rds-mysql
	InstallationDatabaseMultiTenantRDSMySQL = "aws-multitenant-rds"
	// InstallationDatabaseMultiTenantRDSPostgres is a PostgreSQL multitenant
	// database hosted via Amazon RDS.
	InstallationDatabaseMultiTenantRDSPostgres = "aws-multitenant-rds-postgres"
	// InstallationDatabaseMultiTenantRDSPostgresPGBouncer is a PostgreSQL
	// multitenant database hosted via Amazon RDS that has pooled connections
	// through PGBouncer.
	InstallationDatabaseMultiTenantRDSPostgresPGBouncer = "aws-multitenant-rds-postgres-pgbouncer"
	// InstallationDatabasePerseus is a PostgreSQL multitenant database hosted
	// via Amazon RDS that has pooled connections through Perseus.
	InstallationDatabasePerseus = "perseus"
	// InstallationDatabaseExternal is a database that is created and managed
	// outside of the cloud provisioner. No provisioning or teardown is performed
	// on this database type. An AWS secret with connection strings and
	// credentials must be specified on installation creation when using this
	// database type.
	InstallationDatabaseExternal = "external"

	// DatabaseEngineTypeMySQL is a MySQL database.
	DatabaseEngineTypeMySQL = "mysql"
	// DatabaseEngineTypePostgres is a PostgreSQL database.
	DatabaseEngineTypePostgres = "postgres"
	// DatabaseEngineTypePostgresProxy is a PostgreSQL database that is
	// configured for proxied connections.
	DatabaseEngineTypePostgresProxy = "postgres-proxy"
	// DatabaseEngineTypePostgresProxyPerseus is a PostgreSQL database that is
	// configured for proxied connections from Perseus.
	DatabaseEngineTypePostgresProxyPerseus = "postgres-proxy-perseus"
)
View Source
const (
	// InstallationFilestoreMinioOperator is a filestore hosted in kubernetes
	// via the operator.
	InstallationFilestoreMinioOperator = "minio-operator"
	// InstallationFilestoreAwsS3 is a filestore hosted via Amazon S3.
	InstallationFilestoreAwsS3 = "aws-s3"
	// InstallationFilestoreMultiTenantAwsS3 is a filestore hosted via a shared
	// Amazon S3 bucket.
	InstallationFilestoreMultiTenantAwsS3 = "aws-multitenant-s3"
	// InstallationFilestoreBifrost is a filestore hosted via a shared Amazon S3
	// bucket using the bifrost gateway.
	InstallationFilestoreBifrost = "bifrost"
)
View Source
const (
	// InstallationStateStable is an installation in a stable state and undergoing no changes.
	InstallationStateStable = "stable"
	// InstallationStateCreationRequested is an installation waiting to be created.
	InstallationStateCreationRequested = "creation-requested"
	// InstallationStateCreationPreProvisioning in an installation in the process
	// of having managed services created along with any other preparation.
	InstallationStateCreationPreProvisioning = "creation-pre-provisioning"
	// InstallationStateCreationInProgress is an installation in the process of
	// being created.
	InstallationStateCreationInProgress = "creation-in-progress"
	// InstallationStateCreationDNS is an installation in the process having configuring DNS.
	InstallationStateCreationDNS = "creation-configuring-dns"
	// InstallationStateCreationFailed is an installation that failed creation.
	InstallationStateCreationFailed = "creation-failed"
	// InstallationStateCreationNoCompatibleClusters is an installation that
	// can't be fully created because there are no compatible clusters.
	InstallationStateCreationNoCompatibleClusters = "creation-no-compatible-clusters"
	// InstallationStateCreationFinalTasks is the final step of the installation creation.
	InstallationStateCreationFinalTasks = "creation-final-tasks"
	// InstallationStateHibernationRequested is an installation that is about
	// to be put into hibernation.
	InstallationStateHibernationRequested = "hibernation-requested"
	// InstallationStateHibernationInProgress is an installation that is
	// transitioning to hibernation.
	InstallationStateHibernationInProgress = "hibernation-in-progress"
	// InstallationStateHibernating is an installation that is hibernating.
	InstallationStateHibernating = "hibernating"
	// InstallationStateWakeUpRequested is an installation that is about to be
	// woken up from hibernation.
	InstallationStateWakeUpRequested = "wake-up-requested"
	// InstallationStateUpdateRequested is an installation that is about to undergo an update.
	InstallationStateUpdateRequested = "update-requested"
	// InstallationStateUpdateInProgress is an installation that is being updated.
	InstallationStateUpdateInProgress = "update-in-progress"
	// InstallationStateUpdateFailed is an installation that failed to update.
	InstallationStateUpdateFailed = "update-failed"
	// InstallationStateImportInProgress is an installation into which a
	// Workspace archive is being imported from another service or
	// on-premise
	InstallationStateImportInProgress = "import-in-progress"
	// InstallationStateImportComplete is an installation whose import
	// is complete but whose completion has not yet been noted by the
	// AWAT. It is otherwise the same as a stable state.
	InstallationStateImportComplete = "import-complete"
	// InstallationStateDeletionPendingRequested is an installation that is marked
	// to be moved to the deletion-pending state.
	InstallationStateDeletionPendingRequested = "deletion-pending-requested"
	// InstallationStateDeletionPendingInProgress is an installation that is being
	// placed into a deletion-pending state.
	InstallationStateDeletionPendingInProgress = "deletion-pending-in-progress"
	// InstallationStateDeletionPending is an installation that is pending
	// deletion.
	InstallationStateDeletionPending = "deletion-pending"
	// InstallationStateDeletionCancellationRequested is an installation that is
	// requested to have its pending deletion cancelled.
	InstallationStateDeletionCancellationRequested = "deletion-cancellation-requested"
	// InstallationStateDeletionRequested is an installation that deletion has
	// been requested on.
	InstallationStateDeletionRequested = "deletion-requested"
	// InstallationStateDeletionInProgress is an installation being deleted.
	InstallationStateDeletionInProgress = "deletion-in-progress"
	// InstallationStateDeletionFinalCleanup is the final step of installation deletion.
	InstallationStateDeletionFinalCleanup = "deletion-final-cleanup"
	// InstallationStateDeletionFailed is an installation that failed deletion.
	InstallationStateDeletionFailed = "deletion-failed"
	// InstallationStateDeleted is an installation that has been deleted
	InstallationStateDeleted = "deleted"
	// InstallationStateDBRestorationInProgress is an installation that is being restored from backup.
	InstallationStateDBRestorationInProgress = "db-restoration-in-progress"
	// InstallationStateDBMigrationInProgress is an installation that is being migrated to different database.
	InstallationStateDBMigrationInProgress = "db-migration-in-progress"
	// InstallationStateDBMigrationRollbackInProgress is an installation that is being migrated back to original database.
	InstallationStateDBMigrationRollbackInProgress = "db-migration-rollback-in-progress"
	// InstallationStateDBRestorationFailed is an installation for which database restoration failed.
	InstallationStateDBRestorationFailed = "db-restoration-failed"
	// InstallationStateDBMigrationFailed is an installation for which database migration failed.
	InstallationStateDBMigrationFailed = "db-migration-failed"
	// InstallationStateDNSMigrationHibernating is an hibernated installation that is being migrated to different cluster.
	InstallationStateDNSMigrationHibernating = "dns-migration-hibernated"
)
View Source
const (
	// DatabaseStateStable is an database in a stable state.
	DatabaseStateStable = "stable"
	// DatabaseStateProvisioningRequested is an database that requires provisioning.
	DatabaseStateProvisioningRequested = "provisioning-requested"
)
View Source
const DefaultMattermostDatabaseUsername = "mmcloud"

DefaultMattermostDatabaseUsername the default database username for an installation

View Source
const (

	// DefaultPasswordLength the default password length used when calling the below function,
	// mainly used on database creation.
	DefaultPasswordLength = 40
)
View Source
const (
	// InstallationDefaultSize is the default size for an installation.
	InstallationDefaultSize = mmv1alpha1.Size100String
)
View Source
const (
	// ProviderAWS is the cloud provider AWS.
	ProviderAWS = "aws"
)
View Source
const (
	ProvisionerKops = "kops"
)
View Source
const ProvisionerSizePrefix = "provisioner"

ProvisionerSizePrefix is a provisioner specific Installation size prefix.

View Source
const (

	// ShowInstallationCountQueryParameter the query parameter name for GET /groups in order to enable
	// or disable the installation count on the output.
	ShowInstallationCountQueryParameter = "show_installation_count"
)
View Source
const SizeProvisionerXL = "provisionerXL"

SizeProvisionerXL specifies custom Installation size.

Variables

AllClusterInstallationStates is a list of all states a cluster installation can be in. Warning: When creating a new cluster installation state, it must be added to this list.

AllClusterInstallationStatesPendingWork is a list of all cluster installation states that the supervisor will attempt to transition towards stable on the next "tick". Warning: When creating a new cluster installation state, it must be added to this list if the cloud installation supervisor should perform some action on its next work cycle.

AllClusterRequestStates is a list of all states that a cluster can be put in via the API. Warning: When creating a new cluster state, it must be added to this list if an API endpoint should put the cluster in this state.

AllClusterStates is a list of all states a cluster can be in. Warning: When creating a new cluster state, it must be added to this list.

AllClusterStatesPendingWork is a list of all cluster states that the supervisor will attempt to transition towards stable on the next "tick". Warning: When creating a new cluster state, it must be added to this list if the cloud cluster supervisor should perform some action on its next work cycle.

AllInstallationBackupStatesPendingWork is a list of all backup states that the supervisor will attempt to transition towards stable on the next "tick".

AllInstallationBackupsStatesRunning is a list of all backup states that are currently running.

AllInstallationDBMigrationOperationsStatesPendingWork is a list of all db migration operations states that the supervisor will attempt to transition towards stable on the next "tick".

AllInstallationDBRestorationStatesPendingWork is a list of all installation restoration operation states that the supervisor will attempt to transition towards succeeded on the next "tick".

AllInstallationRequestStates is a list of all states that an installation can be put in via the API. Warning: When creating a new installation state, it must be added to this list if an API endpoint should put the installation in this state.

AllInstallationStates is a list of all states an installation can be in. Warning: When creating a new installation state, it must be added to this list.

AllInstallationStatesPendingWork is a list of all installation states that the supervisor will attempt to transition towards stable on the next "tick". Warning: When creating a new installation state, it must be added to this list if the cloud installation supervisor should perform some action on its next work cycle.

View Source
var BuildHash string

BuildHash holds the git commit hash when we build the server

ClusterInstallationStateWorkPriority is a map of states to their priority. Default priority is 0. States with higher priority will be processed first.

ClusterStateWorkPriority is a map of states to their priority. Default priority is 0. States with higher priority will be processed first.

View Source
var DefaultUtilityVersions map[string]*HelmUtilityVersion = map[string]*HelmUtilityVersion{

	PrometheusOperatorCanonicalName: {Chart: "40.5.0", ValuesPath: ""},

	ThanosCanonicalName: {Chart: "11.5.4", ValuesPath: ""},

	NginxCanonicalName: {Chart: "4.5.2", ValuesPath: ""},

	NginxInternalCanonicalName: {Chart: "4.5.2", ValuesPath: ""},

	FluentbitCanonicalName: {Chart: "0.20.1", ValuesPath: ""},

	TeleportCanonicalName: {Chart: "7.3.26", ValuesPath: ""},

	PgbouncerCanonicalName: {Chart: "1.2.0", ValuesPath: ""},

	PromtailCanonicalName: {Chart: "6.2.2", ValuesPath: ""},

	RtcdCanonicalName: {Chart: "1.1.0", ValuesPath: ""},

	NodeProblemDetectorCanonicalName: {Chart: "2.3.2", ValuesPath: ""},

	MetricsServerCanonicalName: {Chart: "3.8.3", ValuesPath: ""},

	VeleroCanonicalName: {Chart: "3.1.2", ValuesPath: ""},

	CloudproberCanonicalName: {Chart: "0.1.1", ValuesPath: ""},
}

DefaultUtilityVersions holds the default values for all the HelmUtilityVersions

InstallationStateWorkPriority is a map of states to their priority. Default priority is 0. States with higher priority will be processed first.

SizeProvisionerXLResources specifies resources for Installation size.

Functions

func CheckProvider

func CheckProvider(provider string) (string, error)

CheckProvider normalizes the given provider, returning an error if invalid.

func ClusterInstallationConfigFromReader

func ClusterInstallationConfigFromReader(reader io.Reader) (map[string]interface{}, error)

ClusterInstallationConfigFromReader decodes a json-encoded config from the config io.Reader.

func ClusterNewID added in v0.46.1

func ClusterNewID() string

ClusterNewID is a globally unique identifier for cluster ID which start with a letter. It is a [a-z0-9] string 26

func ContainsAnnotation added in v0.31.0

func ContainsAnnotation(annotations []*Annotation, annotation *Annotation) bool

ContainsAnnotation determines whether slice of Annotations contains a specific annotation.

func DNSNamesFromRecords added in v0.54.1

func DNSNamesFromRecords(dnsRecords []*InstallationDNS) []string

DNSNamesFromRecords extract slice of domain names from slice of DNSRecords.

func DTOFromReader added in v0.71.0

func DTOFromReader[T any](reader io.Reader) (*T, error)

func DTOsFromReader added in v0.71.0

func DTOsFromReader[T any](reader io.Reader) ([]*T, error)

func DateStringFromMillis added in v0.70.0

func DateStringFromMillis(millis int64) string

DateStringFromMillis returns a standard date string from millis.

func DateTimeStringFromMillis added in v0.70.0

func DateTimeStringFromMillis(millis int64) string

DateTimeStringFromMillis returns a standard complete time string from millis.

func DetermineAfterRestorationState added in v0.45.0

func DetermineAfterRestorationState(installation *Installation) (string, error)

DetermineAfterRestorationState returns installation state that should be set after successful restoration.

func ElapsedTimeInSeconds added in v0.53.0

func ElapsedTimeInSeconds(millis int64) float64

ElapsedTimeInSeconds returns time in seconds since the provided millis.

func EnsureBackupRestoreCompatible added in v0.45.0

func EnsureBackupRestoreCompatible(installation *Installation) error

EnsureBackupRestoreCompatible check if installation is compatible with backup-restore functionality.

func EnsureInstallationReadyForBackup added in v0.45.0

func EnsureInstallationReadyForBackup(installation *Installation) error

EnsureInstallationReadyForBackup ensures that installation can be backed up.

func EnsureInstallationReadyForDBRestoration added in v0.45.0

func EnsureInstallationReadyForDBRestoration(installation *Installation, backup *InstallationBackup) error

EnsureInstallationReadyForDBRestoration ensures that installation can be restored.

func GetAnnotationsIDs added in v0.55.0

func GetAnnotationsIDs(annotations []*Annotation) []string

GetAnnotationsIDs gets IDs of annotations.

func GetDefaultProxyDatabaseMaxInstallationsPerLogicalDatabase added in v0.47.0

func GetDefaultProxyDatabaseMaxInstallationsPerLogicalDatabase() int64

GetDefaultProxyDatabaseMaxInstallationsPerLogicalDatabase returns the value of defaultProxyDatabaseMaxInstallationsPerLogicalDatabase.

func GetGitlabToken added in v0.47.0

func GetGitlabToken() string

GetGitlabToken returns the value of gitlabToken.

func GetIDs added in v0.47.1

func GetIDs(resources []Resource) []string

GetIDs returns IDs of all resources in the collection.

func GetInstallationSize added in v0.59.0

func GetInstallationSize(size string) (v1alpha1.ClusterInstallationSize, error)

GetInstallationSize returns Installation size based on its name.

func GetMillis added in v0.46.1

func GetMillis() int64

GetMillis is a convenience method to get milliseconds since epoch.

func GetMillisAtTime added in v0.70.0

func GetMillisAtTime(t time.Time) int64

GetMillisAtTime returns millis for a given time.

func GetSupportedCniList added in v0.44.0

func GetSupportedCniList() []string

GetSupportedCniList starting with three supported CNI networking options, we can add more as required

func InstallationsCountFromReader added in v0.26.0

func InstallationsCountFromReader(reader io.Reader) (int64, error)

InstallationsCountFromReader decodes a json-encoded installations count data from the given io.Reader

func IsMultiTenantRDS added in v0.46.1

func IsMultiTenantRDS(database string) bool

IsMultiTenantRDS returns true if the given database is multitenant RDS db.

func IsSingleTenantRDS added in v0.35.0

func IsSingleTenantRDS(database string) bool

IsSingleTenantRDS returns true if the given database is single tenant RDS db.

func IsSupportedAffinity

func IsSupportedAffinity(affinity string) bool

IsSupportedAffinity returns true if the given affinity string is supported.

func IsSupportedDatabase added in v0.7.0

func IsSupportedDatabase(database string) bool

IsSupportedDatabase returns true if the given database string is supported.

func IsSupportedFilestore added in v0.7.0

func IsSupportedFilestore(filestore string) bool

IsSupportedFilestore returns true if the given filestore string is supported.

func IsValidExecCommand added in v0.27.0

func IsValidExecCommand(command string) bool

IsValidExecCommand returns wheather the provided command is valid or not.

func NewID

func NewID() string

NewID is a globally unique identifier. It is a [A-Z0-9] string 26 characters long. It is a UUID version 4 Guid that is zbased32 encoded with the padding stripped off.

func NewNodeGroupSuffix added in v0.71.0

func NewNodeGroupSuffix() string

NewNodeGroupSuffix is a globally unique identifier for nodegroup ID which start with a letter. It is a [a-z0-9] string 6

func NewRandomPassword added in v0.67.0

func NewRandomPassword(length int) string

NewRandomPassword generates a random password of the provided length

func ParseProvisionerSize added in v0.59.0

func ParseProvisionerSize(size string) (v1alpha1.ClusterInstallationSize, error)

ParseProvisionerSize parses Provisioner specific Installation size with configurable replicas count. The size should be specified in form: [SIZE_NAME]-[NUMBER_OF_REPLICAS] If number of replicas is not specified the default value for the size will be used.

func SetDefaultProxyDatabaseMaxInstallationsPerLogicalDatabase added in v0.47.0

func SetDefaultProxyDatabaseMaxInstallationsPerLogicalDatabase(val int64) error

SetDefaultProxyDatabaseMaxInstallationsPerLogicalDatabase is used to define a new value for defaultProxyDatabaseMaxInstallationsPerLogicalDatabase.

func SetDeployOperators added in v0.46.1

func SetDeployOperators(mysql, minio bool)

SetDeployOperators is called with a value based on a CLI flag.

func SetGitlabToken added in v0.47.0

func SetGitlabToken(val string)

SetGitlabToken is used to define the gitlab token that will be used for remote helm charts.

func SetRequireAnnotatedInstallations added in v0.33.0

func SetRequireAnnotatedInstallations(val bool)

SetRequireAnnotatedInstallations is called with a value based on a CLI flag.

func SetUtilityDefaults added in v0.46.1

func SetUtilityDefaults(url string)

SetUtilityDefaults is used to set Utility default version and values.

func TimeFromMillis added in v0.46.1

func TimeFromMillis(millis int64) time.Time

TimeFromMillis converts time in milliseconds to time.Time.

func ValidClusterVersion added in v0.9.0

func ValidClusterVersion(name string) bool

ValidClusterVersion returns true if the provided version is either "latest" or a valid k8s version number.

Types

type AWSMetadata

type AWSMetadata struct {
	Zones []string
}

AWSMetadata is the provider metadata stored in a model.Cluster.

func NewAWSMetadata

func NewAWSMetadata(metadataBytes []byte) (*AWSMetadata, error)

NewAWSMetadata creates an instance of AWSMetadata given the raw provider metadata.

type AddAnnotationsRequest added in v0.31.0

type AddAnnotationsRequest struct {
	Annotations []string `json:"annotations"`
}

AddAnnotationsRequest represent parameters passed to add set of annotations to the Cluster or Installation.

func NewAddAnnotationsRequestFromReader added in v0.31.0

func NewAddAnnotationsRequestFromReader(reader io.Reader) (*AddAnnotationsRequest, error)

NewAddAnnotationsRequestFromReader will create a AddAnnotationsRequest from an io.Reader with JSON data.

type AddDNSRecordRequest added in v0.54.1

type AddDNSRecordRequest struct {
	DNS string
}

AddDNSRecordRequest represents request body for adding domain name to Installation.

func NewAddDNSRecordRequestFromReader added in v0.54.1

func NewAddDNSRecordRequestFromReader(reader io.Reader) (*AddDNSRecordRequest, error)

NewAddDNSRecordRequestFromReader will create a AddDNSRecordRequest from an io.Reader with JSON data.

func (*AddDNSRecordRequest) Validate added in v0.54.1

func (request *AddDNSRecordRequest) Validate(installationName string) error

Validate validates AddDNSRecordRequest.

type Annotation added in v0.31.0

type Annotation struct {
	ID   string
	Name string
}

Annotation represents an annotation.

func AnnotationsFromStringSlice added in v0.31.0

func AnnotationsFromStringSlice(names []string) ([]*Annotation, error)

AnnotationsFromStringSlice converts list of strings to list of annotations.

func SortAnnotations added in v0.31.0

func SortAnnotations(annotations []*Annotation) []*Annotation

SortAnnotations sorts annotations by name alphabetically.

type AnnotationsFilter added in v0.31.0

type AnnotationsFilter struct {
	// MatchAllIDs contains all Annotation IDs which need to be set on a Cluster for it to be included in the result.
	MatchAllIDs []string
}

AnnotationsFilter describes filter based on Annotations.

type AssignInstallationGroupRequest added in v0.57.0

type AssignInstallationGroupRequest struct {
	GroupSelectionAnnotations []string
}

AssignInstallationGroupRequest specifies request body for installation group assignment.

func NewAssignInstallationGroupRequestFromReader added in v0.57.0

func NewAssignInstallationGroupRequestFromReader(reader io.Reader) (*AssignInstallationGroupRequest, error)

NewAssignInstallationGroupRequestFromReader will create a AssignInstallationGroupRequest from an io.Reader with JSON data.

type CIMigrationDatabase added in v0.18.0

type CIMigrationDatabase interface {
	Setup(logger log.FieldLogger) (string, error)
	Teardown(logger log.FieldLogger) (string, error)
	Replicate(logger log.FieldLogger) (string, error)
}

CIMigrationDatabase is the interface for managing Mattermost databases migration process.

type Certificate added in v0.67.0

type Certificate struct {
	ARN *string
}

Certificate represents an AWS ACM certificate

type Client

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

Client is the programmatic interface to the provisioning server API.

func NewClient

func NewClient(address string) *Client

NewClient creates a client to the provisioning server at the given address.

func NewClientWithHeaders added in v0.7.0

func NewClientWithHeaders(address string, headers map[string]string) *Client

NewClientWithHeaders creates a client to the provisioning server at the given address and uses the provided headers.

func (*Client) AddClusterAnnotations added in v0.31.0

func (c *Client) AddClusterAnnotations(clusterID string, annotationsRequest *AddAnnotationsRequest) (*ClusterDTO, error)

AddClusterAnnotations adds annotations to the given cluster.

func (*Client) AddGroupAnnotations added in v0.55.0

func (c *Client) AddGroupAnnotations(groupID string, annotationsRequest *AddAnnotationsRequest) (*GroupDTO, error)

AddGroupAnnotations adds annotations to the given group.

func (*Client) AddInstallationAnnotations added in v0.31.0

func (c *Client) AddInstallationAnnotations(installationID string, annotationsRequest *AddAnnotationsRequest) (*InstallationDTO, error)

AddInstallationAnnotations adds annotations to the given installation.

func (*Client) AddInstallationDNS added in v0.57.0

func (c *Client) AddInstallationDNS(installationID string, request *AddDNSRecordRequest) (*InstallationDTO, error)

AddInstallationDNS creates new DNS record for installation.

func (*Client) AssignGroup added in v0.57.0

func (c *Client) AssignGroup(installationID string, assignRequest AssignInstallationGroupRequest) error

AssignGroup joins an installation to the group selected by annotations, leaving any existing group.

func (*Client) CancelInstallationDeletion added in v0.60.0

func (c *Client) CancelInstallationDeletion(installationID string) error

CancelInstallationDeletion cancels the deletion of an installation that is still pending deletion.

func (*Client) CommitInstallationDBMigration added in v0.46.1

func (c *Client) CommitInstallationDBMigration(id string) (*InstallationDBMigrationOperation, error)

CommitInstallationDBMigration commits installation db migration from the configured provisioning server.

func (*Client) CreateCluster

func (c *Client) CreateCluster(request *CreateClusterRequest) (*ClusterDTO, error)

CreateCluster requests the creation of a cluster from the configured provisioning server.

func (*Client) CreateGroup

func (c *Client) CreateGroup(request *CreateGroupRequest) (*GroupDTO, error)

CreateGroup requests the creation of a group from the configured provisioning server.

func (*Client) CreateInstallation

func (c *Client) CreateInstallation(request *CreateInstallationRequest) (*InstallationDTO, error)

CreateInstallation requests the creation of a installation from the configured provisioning server.

func (*Client) CreateInstallationBackup added in v0.44.0

func (c *Client) CreateInstallationBackup(installationID string) (*InstallationBackup, error)

CreateInstallationBackup triggers backup for the given installation.

func (*Client) CreateNodegroups added in v0.71.0

func (c *Client) CreateNodegroups(clusterID string, request *CreateNodegroupsRequest) (*ClusterDTO, error)

CreateNodegroups requests the creation of new nodegroups in the given cluster.

func (*Client) CreateSubscription added in v0.50.0

func (c *Client) CreateSubscription(request *CreateSubscriptionRequest) (*Subscription, error)

CreateSubscription requests the creation of a subscription from the configured provisioning server.

func (*Client) CreateWebhook added in v0.3.0

func (c *Client) CreateWebhook(request *CreateWebhookRequest) (*Webhook, error)

CreateWebhook requests the creation of a webhook from the configured provisioning server.

func (*Client) DeleteCluster

func (c *Client) DeleteCluster(clusterID string) error

DeleteCluster deletes the given cluster and all resources contained therein.

func (*Client) DeleteClusterAnnotation added in v0.31.0

func (c *Client) DeleteClusterAnnotation(clusterID string, annotationName string) error

DeleteClusterAnnotation deletes annotation from the given cluster.

func (*Client) DeleteGroup

func (c *Client) DeleteGroup(groupID string) error

DeleteGroup deletes the given group and all resources contained therein.

func (*Client) DeleteGroupAnnotation added in v0.55.0

func (c *Client) DeleteGroupAnnotation(groupID string, annotationName string) error

DeleteGroupAnnotation deletes annotation from the given group.

func (*Client) DeleteInActiveClusterInstallationByID added in v0.46.1

func (c *Client) DeleteInActiveClusterInstallationByID(clusterInstallationID string) (*ClusterInstallation, error)

DeleteInActiveClusterInstallationByID requests the deletion of specific inactive cluster installation from the configured provisioning server.

func (*Client) DeleteInActiveClusterInstallationsByCluster added in v0.46.1

func (c *Client) DeleteInActiveClusterInstallationsByCluster(clusterID string) (*MigrateClusterInstallationResponse, error)

DeleteInActiveClusterInstallationsByCluster requests the deletion of inactive cluster installation(s) from the configured provisioning server.

func (*Client) DeleteInstallation

func (c *Client) DeleteInstallation(installationID string) error

DeleteInstallation deletes the given installation and all resources contained therein.

func (*Client) DeleteInstallationAnnotation added in v0.31.0

func (c *Client) DeleteInstallationAnnotation(installationID string, annotationName string) error

DeleteInstallationAnnotation deletes annotation from the given installation.

func (*Client) DeleteInstallationBackup added in v0.44.0

func (c *Client) DeleteInstallationBackup(backupID string) error

DeleteInstallationBackup deletes given installation backup.

func (*Client) DeleteMultitenantDatabase added in v0.54.0

func (c *Client) DeleteMultitenantDatabase(databaseID string, force bool) error

DeleteMultitenantDatabase marks multitenant database as deleted.

func (*Client) DeleteSubscription added in v0.50.0

func (c *Client) DeleteSubscription(subID string) error

DeleteSubscription deletes the given subscription.

func (*Client) DeleteWebhook added in v0.3.0

func (c *Client) DeleteWebhook(webhookID string) error

DeleteWebhook deletes the given webhook.

func (*Client) ExecClusterInstallationCLI added in v0.27.0

func (c *Client) ExecClusterInstallationCLI(clusterInstallationID, command string, subcommand []string) ([]byte, error)

ExecClusterInstallationCLI runs a valid exec command against a cluster installation.

func (*Client) GetCluster

func (c *Client) GetCluster(clusterID string) (*ClusterDTO, error)

GetCluster fetches the specified cluster from the configured provisioning server.

func (*Client) GetClusterInstallation

func (c *Client) GetClusterInstallation(clusterInstallationID string) (*ClusterInstallation, error)

GetClusterInstallation fetches the specified cluster installation from the configured provisioning server.

func (*Client) GetClusterInstallationConfig

func (c *Client) GetClusterInstallationConfig(clusterInstallationID string) (map[string]interface{}, error)

GetClusterInstallationConfig fetches the specified cluster installation's Mattermost config.

func (*Client) GetClusterInstallationStatus added in v0.71.0

func (c *Client) GetClusterInstallationStatus(clusterInstallationID string) (*ClusterInstallationStatus, error)

func (*Client) GetClusterInstallations

func (c *Client) GetClusterInstallations(request *GetClusterInstallationsRequest) ([]*ClusterInstallation, error)

GetClusterInstallations fetches the list of cluster installations from the configured provisioning server.

func (*Client) GetClusterUtilities added in v0.14.0

func (c *Client) GetClusterUtilities(clusterID string) (*UtilityMetadata, error)

GetClusterUtilities returns the metadata for all utilities running in the given cluster.

func (*Client) GetClusters

func (c *Client) GetClusters(request *GetClustersRequest) ([]*ClusterDTO, error)

GetClusters fetches the list of clusters from the configured provisioning server.

func (*Client) GetDatabaseSchema added in v0.47.0

func (c *Client) GetDatabaseSchema(multitenantDatabaseID string) (*DatabaseSchema, error)

GetDatabaseSchema fetches the database schema from the configured provisioning server.

func (*Client) GetDatabaseSchemas added in v0.47.0

func (c *Client) GetDatabaseSchemas(request *GetDatabaseSchemaRequest) ([]*DatabaseSchema, error)

GetDatabaseSchemas fetches the list of database schemas from the configured provisioning server.

func (*Client) GetGroup

func (c *Client) GetGroup(groupID string) (*GroupDTO, error)

GetGroup fetches the specified group from the configured provisioning server.

func (*Client) GetGroupStatus added in v0.30.0

func (c *Client) GetGroupStatus(groupID string) (*GroupStatus, error)

GetGroupStatus fetches the status for specified group from the configured provisioning server.

func (*Client) GetGroups

func (c *Client) GetGroups(request *GetGroupsRequest) ([]*GroupDTO, error)

GetGroups fetches the list of groups from the configured provisioning server.

func (*Client) GetGroupsStatus added in v0.35.0

func (c *Client) GetGroupsStatus() ([]*GroupsStatus, error)

GetGroupsStatus fetches the status for all groups.

func (*Client) GetInstallation

func (c *Client) GetInstallation(installationID string, request *GetInstallationRequest) (*InstallationDTO, error)

GetInstallation fetches the specified installation from the configured provisioning server.

func (*Client) GetInstallationBackup added in v0.44.0

func (c *Client) GetInstallationBackup(backupID string) (*InstallationBackup, error)

GetInstallationBackup returns given installation backup.

func (*Client) GetInstallationBackups added in v0.44.0

func (c *Client) GetInstallationBackups(request *GetInstallationBackupsRequest) ([]*InstallationBackup, error)

GetInstallationBackups returns list of installation backups.

func (*Client) GetInstallationByDNS added in v0.23.0

func (c *Client) GetInstallationByDNS(DNS string, request *GetInstallationRequest) (*InstallationDTO, error)

GetInstallationByDNS finds an installation with the given FQDN.

func (*Client) GetInstallationDBMigrationOperation added in v0.46.1

func (c *Client) GetInstallationDBMigrationOperation(id string) (*InstallationDBMigrationOperation, error)

GetInstallationDBMigrationOperation fetches the specified installation db migration operation from the configured provisioning server.

func (*Client) GetInstallationDBMigrationOperations added in v0.46.1

func (c *Client) GetInstallationDBMigrationOperations(request *GetInstallationDBMigrationOperationsRequest) ([]*InstallationDBMigrationOperation, error)

GetInstallationDBMigrationOperations fetches the list of installation db migration operations from the configured provisioning server.

func (*Client) GetInstallationDBRestoration added in v0.45.0

func (c *Client) GetInstallationDBRestoration(id string) (*InstallationDBRestorationOperation, error)

GetInstallationDBRestoration fetches the specified installation db restoration operation from the configured provisioning server.

func (*Client) GetInstallationDBRestorationOperations added in v0.45.0

func (c *Client) GetInstallationDBRestorationOperations(request *GetInstallationDBRestorationOperationsRequest) ([]*InstallationDBRestorationOperation, error)

GetInstallationDBRestorationOperations fetches the list of installation db restoration operations from the configured provisioning server.

func (*Client) GetInstallations

func (c *Client) GetInstallations(request *GetInstallationsRequest) ([]*InstallationDTO, error)

GetInstallations fetches the list of installations from the configured provisioning server.

func (*Client) GetInstallationsCount added in v0.26.0

func (c *Client) GetInstallationsCount(includeDeleted bool) (int64, error)

GetInstallationsCount returns then number of installations filtered by deleted field

func (*Client) GetInstallationsStatus added in v0.42.0

func (c *Client) GetInstallationsStatus() (*InstallationsStatus, error)

GetInstallationsStatus fetches the status for all installations.

func (*Client) GetLogicalDatabase added in v0.47.0

func (c *Client) GetLogicalDatabase(logicalDatabaseID string) (*LogicalDatabase, error)

GetLogicalDatabase fetches the logical database from the configured provisioning server.

func (*Client) GetLogicalDatabases added in v0.47.0

func (c *Client) GetLogicalDatabases(request *GetLogicalDatabasesRequest) ([]*LogicalDatabase, error)

GetLogicalDatabases fetches the list of logical databases from the configured provisioning server.

func (*Client) GetMultitenantDatabase added in v0.47.0

func (c *Client) GetMultitenantDatabase(multitenantDatabaseID string) (*MultitenantDatabase, error)

GetMultitenantDatabase fetches the multitenant database from the configured provisioning server.

func (*Client) GetMultitenantDatabases added in v0.25.0

func (c *Client) GetMultitenantDatabases(request *GetMultitenantDatabasesRequest) ([]*MultitenantDatabase, error)

GetMultitenantDatabases fetches the list of multitenant databases from the configured provisioning server.

func (*Client) GetSubscription added in v0.50.0

func (c *Client) GetSubscription(subID string) (*Subscription, error)

GetSubscription fetches the subscription from the configured provisioning server.

func (*Client) GetWebhook added in v0.3.0

func (c *Client) GetWebhook(webhookID string) (*Webhook, error)

GetWebhook fetches the webhook from the configured provisioning server.

func (*Client) GetWebhooks added in v0.3.0

func (c *Client) GetWebhooks(request *GetWebhooksRequest) ([]*Webhook, error)

GetWebhooks fetches the list of webhooks from the configured provisioning server.

func (*Client) HibernateInstallation added in v0.21.0

func (c *Client) HibernateInstallation(installationID string) (*InstallationDTO, error)

HibernateInstallation puts an installation into hibernation.

func (*Client) JoinGroup

func (c *Client) JoinGroup(groupID, installationID string) error

JoinGroup joins an installation to the given group, leaving any existing group.

func (*Client) LeaveGroup

func (c *Client) LeaveGroup(installationID string, request *LeaveGroupRequest) error

LeaveGroup removes an installation from its group, if any.

func (*Client) ListStateChangeEvents added in v0.50.0

func (c *Client) ListStateChangeEvents(request *ListStateChangeEventsRequest) ([]*StateChangeEventData, error)

ListStateChangeEvents request events lists from the configured provisioning server.

func (*Client) ListSubscriptions added in v0.50.0

func (c *Client) ListSubscriptions(request *ListSubscriptionsRequest) ([]*Subscription, error)

ListSubscriptions requests list of subscriptions from the configured provisioning server.

func (*Client) LockAPIForBackup added in v0.44.0

func (c *Client) LockAPIForBackup(backupID string) error

LockAPIForBackup locks API changes for a given backup.

func (*Client) LockAPIForCluster added in v0.25.0

func (c *Client) LockAPIForCluster(clusterID string) error

LockAPIForCluster locks API changes for a given cluster.

func (*Client) LockAPIForClusterInstallation added in v0.25.0

func (c *Client) LockAPIForClusterInstallation(clusterID string) error

LockAPIForClusterInstallation locks API changes for a given cluster installation.

func (*Client) LockAPIForGroup added in v0.25.0

func (c *Client) LockAPIForGroup(groupID string) error

LockAPIForGroup locks API changes for a given group.

func (*Client) LockAPIForInstallation added in v0.25.0

func (c *Client) LockAPIForInstallation(installationID string) error

LockAPIForInstallation locks API changes for a given installation.

func (*Client) MigrateClusterInstallation added in v0.46.1

func (c *Client) MigrateClusterInstallation(request *MigrateClusterInstallationRequest) (*MigrateClusterInstallationResponse, error)

MigrateClusterInstallation requests the migration of cluster installation(s) from the configured provisioning server.

func (*Client) MigrateDNS added in v0.46.1

MigrateDNS requests the migration of cluster installation(s) from the configured provisioning server.

func (*Client) MigrateInstallationDatabase added in v0.46.1

func (c *Client) MigrateInstallationDatabase(request *InstallationDBMigrationRequest) (*InstallationDBMigrationOperation, error)

MigrateInstallationDatabase requests installation db migration from the configured provisioning server.

func (*Client) ProvisionCluster

func (c *Client) ProvisionCluster(clusterID string, request *ProvisionClusterRequest) (*ClusterDTO, error)

ProvisionCluster provisions k8s operators and Helm charts on a cluster from the configured provisioning server.

func (*Client) ResizeCluster added in v0.19.0

func (c *Client) ResizeCluster(clusterID string, request *PatchClusterSizeRequest) (*ClusterDTO, error)

ResizeCluster resizes a cluster with a new size value.

func (*Client) RestoreInstallationDatabase added in v0.45.0

func (c *Client) RestoreInstallationDatabase(installationID, backupID string) (*InstallationDBRestorationOperation, error)

RestoreInstallationDatabase requests installation db restoration from the configured provisioning server.

func (*Client) RetryCreateCluster

func (c *Client) RetryCreateCluster(clusterID string) error

RetryCreateCluster retries the creation of a cluster from the configured provisioning server.

func (*Client) RetryCreateInstallation

func (c *Client) RetryCreateInstallation(installationID string) error

RetryCreateInstallation retries the creation of a installation from the configured provisioning server.

func (*Client) RollbackInstallationDBMigration added in v0.46.1

func (c *Client) RollbackInstallationDBMigration(id string) (*InstallationDBMigrationOperation, error)

RollbackInstallationDBMigration triggers installation db migration rollback from the configured provisioning server.

func (*Client) RunMattermostCLICommandOnClusterInstallation added in v0.3.0

func (c *Client) RunMattermostCLICommandOnClusterInstallation(clusterInstallationID string, subcommand []string) ([]byte, error)

RunMattermostCLICommandOnClusterInstallation runs a Mattermost CLI command against a cluster installation.

func (*Client) SetClusterInstallationConfig

func (c *Client) SetClusterInstallationConfig(clusterInstallationID string, config map[string]interface{}) error

SetClusterInstallationConfig modifies an cluster installation's Mattermost configuration.

The operation is applied as a patch, preserving existing values if they are not specified.

func (*Client) SetInstallationDomainPrimary added in v0.57.0

func (c *Client) SetInstallationDomainPrimary(installationID, installationDNSID string) (*InstallationDTO, error)

SetInstallationDomainPrimary sets Installation domain as primary.

func (*Client) SwitchClusterRoles added in v0.46.1

SwitchClusterRoles requests the migration of cluster installation(s) from the configured provisioning server.

func (*Client) UnlockAPIForBackup added in v0.44.0

func (c *Client) UnlockAPIForBackup(backupID string) error

UnlockAPIForBackup unlocks API changes for a given backup.

func (*Client) UnlockAPIForCluster added in v0.25.0

func (c *Client) UnlockAPIForCluster(clusterID string) error

UnlockAPIForCluster unlocks API changes for a given cluster.

func (*Client) UnlockAPIForClusterInstallation added in v0.25.0

func (c *Client) UnlockAPIForClusterInstallation(clusterID string) error

UnlockAPIForClusterInstallation unlocks API changes for a given cluster installation.

func (*Client) UnlockAPIForGroup added in v0.25.0

func (c *Client) UnlockAPIForGroup(groupID string) error

UnlockAPIForGroup unlocks API changes for a given group.

func (*Client) UnlockAPIForInstallation added in v0.25.0

func (c *Client) UnlockAPIForInstallation(installationID string) error

UnlockAPIForInstallation unlocks API changes for a given installation.

func (*Client) UpdateCluster added in v0.8.0

func (c *Client) UpdateCluster(clusterID string, request *UpdateClusterRequest) (*ClusterDTO, error)

UpdateCluster updates a cluster's configuration.

func (*Client) UpdateGroup

func (c *Client) UpdateGroup(request *PatchGroupRequest) (*GroupDTO, error)

UpdateGroup updates the installation group.

func (*Client) UpdateInstallation added in v0.19.0

func (c *Client) UpdateInstallation(installationID string, request *PatchInstallationRequest) (*InstallationDTO, error)

UpdateInstallation updates an installation.

func (*Client) UpdateInstallationDeletion added in v0.70.0

func (c *Client) UpdateInstallationDeletion(installationID string, request *PatchInstallationDeletionRequest) (*InstallationDTO, error)

UpdateInstallationDeletion updates the deletion parameters of an installation that is still pending deletion.

func (*Client) UpdateMultitenantDatabase added in v0.46.1

func (c *Client) UpdateMultitenantDatabase(databaseID string, request *PatchMultitenantDatabaseRequest) (*MultitenantDatabase, error)

UpdateMultitenantDatabase updates a multitenant database.

func (*Client) UpgradeCluster

func (c *Client) UpgradeCluster(clusterID string, request *PatchUpgradeClusterRequest) (*ClusterDTO, error)

UpgradeCluster upgrades a cluster to the latest recommended production ready k8s version.

func (*Client) WakeupInstallation added in v0.21.0

func (c *Client) WakeupInstallation(installationID string, request *PatchInstallationRequest) (*InstallationDTO, error)

WakeupInstallation wakes an installation from hibernation.

type Cluster

type Cluster struct {
	ID                      string
	State                   string
	Provider                string
	ProviderMetadataAWS     *AWSMetadata
	Provisioner             string
	ProvisionerMetadataKops *KopsMetadata
	ProvisionerMetadataEKS  *EKSMetadata
	UtilityMetadata         *UtilityMetadata
	AllowInstallations      bool
	CreateAt                int64
	DeleteAt                int64
	APISecurityLock         bool
	LockAcquiredBy          *string
	LockAcquiredAt          int64
	Networking              string
}

Cluster represents a Kubernetes cluster.

func ClusterFromReader

func ClusterFromReader(reader io.Reader) (*Cluster, error)

ClusterFromReader decodes a json-encoded cluster from the given io.Reader.

func ClustersFromReader

func ClustersFromReader(reader io.Reader) ([]*Cluster, error)

ClustersFromReader decodes a json-encoded list of clusters from the given io.Reader.

func (*Cluster) ActualUtilityVersion added in v0.14.0

func (c *Cluster) ActualUtilityVersion(utility string) *HelmUtilityVersion

ActualUtilityVersion fetches the desired version of a utility from the Cluster object

func (*Cluster) Clone

func (c *Cluster) Clone() *Cluster

Clone returns a deep copy the cluster.

func (*Cluster) DesiredUtilityVersion added in v0.14.0

func (c *Cluster) DesiredUtilityVersion(utility string) *HelmUtilityVersion

DesiredUtilityVersion fetches the desired version of a utility from the Cluster object

func (*Cluster) GetID added in v0.47.1

func (c *Cluster) GetID() string

GetID returns ID of the resource.

func (*Cluster) GetState added in v0.47.1

func (c *Cluster) GetState() string

GetState returns State of the resource.

func (*Cluster) IsDeleted added in v0.47.1

func (c *Cluster) IsDeleted() bool

IsDeleted determines whether the resource is deleted.

func (*Cluster) SetUtilityActualVersion added in v0.14.0

func (c *Cluster) SetUtilityActualVersion(utility string, version *HelmUtilityVersion) error

SetUtilityActualVersion stores the provided version for the provided utility in the UtilityMetadata JSON []byte in this Cluster

func (*Cluster) SetUtilityDesiredVersions added in v0.14.0

func (c *Cluster) SetUtilityDesiredVersions(desiredVersions map[string]*HelmUtilityVersion)

SetUtilityDesiredVersions takes a map of string to string representing any metadata related to the utility group and stores it as a []byte in Cluster so that it can be inserted into the database

func (*Cluster) ToDTO added in v0.31.0

func (c *Cluster) ToDTO(annotations []*Annotation) *ClusterDTO

ToDTO expands cluster to ClusterDTO.

func (*Cluster) ValidTransitionState added in v0.8.0

func (c *Cluster) ValidTransitionState(newState string) bool

ValidTransitionState returns whether a cluster can be transitioned into the new state or not based on its current state.

type ClusterDTO added in v0.31.0

type ClusterDTO struct {
	*Cluster
	Annotations []*Annotation `json:"Annotations,omitempty"`
}

ClusterDTO represents cluster entity with connected data. DTO stands for Data Transfer Object.

type ClusterFilter

type ClusterFilter struct {
	Paging
	Annotations *AnnotationsFilter
}

ClusterFilter describes the parameters used to constrain a set of clusters.

type ClusterInstallation

type ClusterInstallation struct {
	ID              string
	ClusterID       string
	InstallationID  string
	Namespace       string
	State           string
	CreateAt        int64
	DeleteAt        int64
	APISecurityLock bool
	LockAcquiredBy  *string
	LockAcquiredAt  int64
	IsActive        bool
}

ClusterInstallation is a single namespace within a cluster composing a potentially larger installation.

func ClusterInstallationFromReader

func ClusterInstallationFromReader(reader io.Reader) (*ClusterInstallation, error)

ClusterInstallationFromReader decodes a json-encoded cluster installation from the given io.Reader.

func ClusterInstallationsFromReader

func ClusterInstallationsFromReader(reader io.Reader) ([]*ClusterInstallation, error)

ClusterInstallationsFromReader decodes a json-encoded list of cluster installations from the given io.Reader.

func (*ClusterInstallation) Clone

Clone returns a deep copy the cluster installation.

func (*ClusterInstallation) IsDeleted added in v0.4.0

func (c *ClusterInstallation) IsDeleted() bool

IsDeleted returns whether the cluster installation was marked as deleted or not.

type ClusterInstallationConfigRequest

type ClusterInstallationConfigRequest map[string]interface{}

ClusterInstallationConfigRequest describes the payload for updating an cluster installation's configuration.

func NewClusterInstallationConfigRequestFromReader

func NewClusterInstallationConfigRequestFromReader(reader io.Reader) (ClusterInstallationConfigRequest, error)

NewClusterInstallationConfigRequestFromReader will create a ClusterInstallationConfigRequest from an io.Reader with JSON data.

type ClusterInstallationExecSubcommand added in v0.27.0

type ClusterInstallationExecSubcommand []string

ClusterInstallationExecSubcommand describes the payload necessary to run container exec commands on a cluster installation.

func NewClusterInstallationExecSubcommandFromReader added in v0.27.0

func NewClusterInstallationExecSubcommandFromReader(reader io.Reader) (ClusterInstallationExecSubcommand, error)

NewClusterInstallationExecSubcommandFromReader will create a ClusterInstallationExecSubcommand from an io.Reader.

type ClusterInstallationFilter

type ClusterInstallationFilter struct {
	Paging
	IDs            []string
	InstallationID string
	ClusterID      string
	IsActive       *bool
}

ClusterInstallationFilter describes the parameters used to constrain a set of cluster installations.

type ClusterInstallationMattermostCLISubcommand added in v0.3.0

type ClusterInstallationMattermostCLISubcommand []string

ClusterInstallationMattermostCLISubcommand describes the payload necessary to run Mattermost CLI on a cluster installation.

func NewClusterInstallationMattermostCLISubcommandFromReader added in v0.3.0

func NewClusterInstallationMattermostCLISubcommandFromReader(reader io.Reader) (ClusterInstallationMattermostCLISubcommand, error)

NewClusterInstallationMattermostCLISubcommandFromReader will create a ClusterInstallationMattermostCLISubcommand from an io.Reader.

type ClusterInstallationStatus added in v0.71.0

type ClusterInstallationStatus struct {
	InstallationFound bool   `json:"InstallationFound,omitempty"`
	Replicas          *int32 `json:"Replicas,omitempty"`
	TotalPod          *int32 `json:"TotalPod,omitempty"`
	RunningPod        *int32 `json:"RunningPod,omitempty"`
	ReadyPod          *int32 `json:"ReadyPod,omitempty"`
	StartedPod        *int32 `json:"StartedPod,omitempty"`
	ReadyLocalServer  *int32 `json:"ReadyLocalServer,omitempty"`
}

func NewClusterInstallationStatusFromReader added in v0.71.0

func NewClusterInstallationStatusFromReader(reader io.Reader) (*ClusterInstallationStatus, error)

type ClusterStateReport added in v0.8.0

type ClusterStateReport []StateReportEntry

ClusterStateReport is a report of all cluster requests states.

func GetClusterRequestStateReport added in v0.8.0

func GetClusterRequestStateReport() ClusterStateReport

GetClusterRequestStateReport returns a ClusterStateReport based on the current model of cluster states.

type ClusterUtilityDatabaseStoreInterface added in v0.46.1

type ClusterUtilityDatabaseStoreInterface interface {
	GetMultitenantDatabases(filter *MultitenantDatabaseFilter) ([]*MultitenantDatabase, error)
	GetLogicalDatabases(filter *LogicalDatabaseFilter) ([]*LogicalDatabase, error)
}

ClusterUtilityDatabaseStoreInterface is the interface necessary for SQLStore functionality to update cluster utilities as needed.

type CreateClusterRequest

type CreateClusterRequest struct {
	Provider                   string                         `json:"provider,omitempty"`
	Zones                      []string                       `json:"zones,omitempty"`
	Version                    string                         `json:"version,omitempty"`
	AMI                        string                         `json:"ami,omitempty"`
	MasterInstanceType         string                         `json:"master-instance-type,omitempty"`
	MasterCount                int64                          `json:"master-count,omitempty"`
	NodeInstanceType           string                         `json:"node-instance-type,omitempty"`
	NodeMinCount               int64                          `json:"node-min-count,omitempty"`
	NodeMaxCount               int64                          `json:"node-max-count,omitempty"`
	AllowInstallations         bool                           `json:"allow-installations,omitempty"`
	APISecurityLock            bool                           `json:"api-security-lock,omitempty"`
	DesiredUtilityVersions     map[string]*HelmUtilityVersion `json:"utility-versions,omitempty"`
	Annotations                []string                       `json:"annotations,omitempty"`
	Networking                 string                         `json:"networking,omitempty"`
	VPC                        string                         `json:"vpc,omitempty"`
	MaxPodsPerNode             int64                          `json:"max-pods-per-node,omitempty"`
	ClusterRoleARN             string                         `json:"cluster-role-arn,omitempty"`
	NodeRoleARN                string                         `json:"node-role-arn,omitempty"`
	Provisioner                string                         `json:"provisioner,omitempty"`
	AdditionalNodeGroups       map[string]NodeGroupMetadata   `json:"additional-node-groups,omitempty"`
	NodeGroupWithPublicSubnet  []string                       `json:"nodegroup-with-public-subnet,omitempty"`
	NodeGroupWithSecurityGroup []string                       `json:"nodegroup-with-sg,omitempty"`
}

CreateClusterRequest specifies the parameters for a new cluster.

func NewCreateClusterRequestFromReader

func NewCreateClusterRequestFromReader(reader io.Reader) (*CreateClusterRequest, error)

NewCreateClusterRequestFromReader will create a CreateClusterRequest from an io.Reader with JSON data.

func (*CreateClusterRequest) SetDefaults added in v0.10.0

func (request *CreateClusterRequest) SetDefaults()

SetDefaults sets the default values for a cluster create request.

func (*CreateClusterRequest) Validate added in v0.10.0

func (request *CreateClusterRequest) Validate() error

Validate validates the values of a cluster create request.

type CreateGroupRequest

type CreateGroupRequest struct {
	Name            string
	Description     string
	Version         string
	Image           string
	MaxRolling      int64
	APISecurityLock bool
	MattermostEnv   EnvVarMap
	Annotations     []string
}

CreateGroupRequest specifies the parameters for a new group.

func NewCreateGroupRequestFromReader

func NewCreateGroupRequestFromReader(reader io.Reader) (*CreateGroupRequest, error)

NewCreateGroupRequestFromReader will create a CreateGroupRequest from an io.Reader with JSON data.

func (*CreateGroupRequest) Validate added in v0.17.0

func (request *CreateGroupRequest) Validate() error

Validate validates the values of a group create request.

type CreateInstallationRequest

type CreateInstallationRequest struct {
	Name    string
	OwnerID string
	GroupID string
	Version string
	Image   string
	// Deprecated: Use DNSNames instead.
	DNS                       string
	DNSNames                  []string
	License                   string
	Size                      string
	Affinity                  string
	Database                  string
	Filestore                 string
	APISecurityLock           bool
	MattermostEnv             EnvVarMap
	PriorityEnv               EnvVarMap
	Annotations               []string
	GroupSelectionAnnotations []string
	// SingleTenantDatabaseConfig is ignored if Database is not single tenant mysql or postgres.
	SingleTenantDatabaseConfig SingleTenantDatabaseRequest
	// ExternalDatabaseConfig is ignored if Database is not single external.
	ExternalDatabaseConfig ExternalDatabaseRequest
}

CreateInstallationRequest specifies the parameters for a new installation.

func NewCreateInstallationRequestFromReader

func NewCreateInstallationRequestFromReader(reader io.Reader) (*CreateInstallationRequest, error)

NewCreateInstallationRequestFromReader will create a CreateInstallationRequest from an io.Reader with JSON data.

func (*CreateInstallationRequest) SetDefaults added in v0.7.0

func (request *CreateInstallationRequest) SetDefaults()

SetDefaults sets the default values for an installation create request.

func (*CreateInstallationRequest) Validate added in v0.7.0

func (request *CreateInstallationRequest) Validate() error

Validate validates the values of an installation create request.

type CreateNodegroupsRequest added in v0.71.0

type CreateNodegroupsRequest struct {
	Nodegroups                 map[string]NodeGroupMetadata `json:"nodegroups"`
	NodeGroupWithPublicSubnet  []string                     `json:"nodegroup-with-public-subnet,omitempty"`
	NodeGroupWithSecurityGroup []string                     `json:"nodegroup-with-sg,omitempty"`
}

func NewCreateNodegroupsRequestFromReader added in v0.71.0

func NewCreateNodegroupsRequestFromReader(reader io.Reader) (*CreateNodegroupsRequest, error)

NewCreateNodegroupsRequestFromReader will create an CreateNodegroupsRequest from an io.Reader with JSON data.

func (*CreateNodegroupsRequest) SetDefaults added in v0.71.0

func (request *CreateNodegroupsRequest) SetDefaults()

SetDefaults sets default values for nodegroups.

func (*CreateNodegroupsRequest) Validate added in v0.71.0

func (request *CreateNodegroupsRequest) Validate() error

Validate validates the values of a nodegroup creation request.

type CreateSubscriptionRequest added in v0.50.0

type CreateSubscriptionRequest struct {
	Name             string
	URL              string
	OwnerID          string
	EventType        EventType
	FailureThreshold time.Duration
	Headers          Headers
}

CreateSubscriptionRequest represents a request to create Subscription.

func NewCreateSubscriptionRequestFromReader added in v0.50.0

func NewCreateSubscriptionRequestFromReader(reader io.Reader) (*CreateSubscriptionRequest, error)

NewCreateSubscriptionRequestFromReader will create a CreateSubscriptionRequest from an io.Reader with JSON data.

func (CreateSubscriptionRequest) ToSubscription added in v0.50.0

func (r CreateSubscriptionRequest) ToSubscription() (Subscription, error)

ToSubscription validates request and converts it to subscription

type CreateWebhookRequest added in v0.3.0

type CreateWebhookRequest struct {
	OwnerID string
	URL     string
	Headers Headers
}

CreateWebhookRequest specifies the parameters for a new webhook.

func NewCreateWebhookRequestFromReader added in v0.3.0

func NewCreateWebhookRequestFromReader(reader io.Reader) (*CreateWebhookRequest, error)

NewCreateWebhookRequestFromReader will create a CreateWebhookRequest from an io.Reader with JSON data.

type Database added in v0.8.0

Database is the interface for managing Mattermost databases.

type DatabaseResourceGrouping added in v0.47.0

type DatabaseResourceGrouping struct {
	MultitenantDatabase *MultitenantDatabase
	LogicalDatabase     *LogicalDatabase
	DatabaseSchema      *DatabaseSchema
}

DatabaseResourceGrouping represents the complete set of database resources that comprise proxy database information.

type DatabaseSchema added in v0.47.0

type DatabaseSchema struct {
	ID                string
	LogicalDatabaseID string
	InstallationID    string
	Name              string
	CreateAt          int64
	DeleteAt          int64
	LockAcquiredBy    *string
	LockAcquiredAt    int64
}

DatabaseSchema represents a database schema inside a LogicalDatabase.

func DatababseSchemaFromReader added in v0.47.0

func DatababseSchemaFromReader(reader io.Reader) (*DatabaseSchema, error)

DatababseSchemaFromReader decodes a json-encoded database schema from the given io.Reader.

func DatababseSchemasFromReader added in v0.47.0

func DatababseSchemasFromReader(reader io.Reader) ([]*DatabaseSchema, error)

DatababseSchemasFromReader decodes a json-encoded list of database schemas from the given io.Reader.

type DatabaseSchemaFilter added in v0.47.0

type DatabaseSchemaFilter struct {
	Paging
	LogicalDatabaseID string
	InstallationID    string
}

DatabaseSchemaFilter describes the parameters used to constrain a set of DatabaseSchema.

type EKSMetadata added in v0.63.0

type EKSMetadata struct {
	Name           string
	Version        string
	AMI            string
	VPC            string
	Networking     string
	ClusterRoleARN string
	NodeRoleARN    string
	MaxPodsPerNode int64
	NodeGroups     map[string]NodeGroupMetadata
	ChangeRequest  *EKSMetadataRequestedState `json:"ChangeRequest,omitempty"`
	Warnings       []string                   `json:"Warnings,omitempty"`
}

EKSMetadata is metadata for EKS cluster and node groups.

func NewEKSMetadata added in v0.63.0

func NewEKSMetadata(metadataBytes []byte) (*EKSMetadata, error)

NewEKSMetadata creates an instance of EKSMetadata given the raw provisioner metadata.

func (*EKSMetadata) ApplyChangeRequest added in v0.71.0

func (em *EKSMetadata) ApplyChangeRequest()

ApplyChangeRequest applies change request values to the KopsMetadata that are not reflected by calling refreshKopsMetadata().

func (*EKSMetadata) ApplyClusterCreateRequest added in v0.71.0

func (em *EKSMetadata) ApplyClusterCreateRequest(createRequest *CreateClusterRequest) bool

func (*EKSMetadata) ApplyClusterSizePatch added in v0.71.0

func (em *EKSMetadata) ApplyClusterSizePatch(patchRequest *PatchClusterSizeRequest) bool

func (*EKSMetadata) ApplyNodegroupsCreateRequest added in v0.71.0

func (em *EKSMetadata) ApplyNodegroupsCreateRequest(request *CreateNodegroupsRequest)

ApplyNodegroupsCreateRequest applies the nodegroups to create to the KopsMetadata.

func (*EKSMetadata) ApplyUpgradePatch added in v0.71.0

func (em *EKSMetadata) ApplyUpgradePatch(patchRequest *PatchUpgradeClusterRequest) bool

ApplyUpgradePatch applies the patch to the given cluster's metadata.

func (*EKSMetadata) ClearChangeRequest added in v0.71.0

func (em *EKSMetadata) ClearChangeRequest()

ClearChangeRequest clears the kops metadata change request.

func (*EKSMetadata) ClearWarnings added in v0.71.0

func (em *EKSMetadata) ClearWarnings()

ClearWarnings clears the kops metadata warnings.

func (*EKSMetadata) GetCommonMetadata added in v0.71.0

func (em *EKSMetadata) GetCommonMetadata() ProvisionerMetadata

func (*EKSMetadata) ValidateChangeRequest added in v0.71.0

func (em *EKSMetadata) ValidateChangeRequest() error

ValidateChangeRequest ensures that the ChangeRequest has at least one actionable value.

func (*EKSMetadata) ValidateClusterSizePatch added in v0.71.0

func (em *EKSMetadata) ValidateClusterSizePatch(patchRequest *PatchClusterSizeRequest) error

func (*EKSMetadata) ValidateNodegroupsCreateRequest added in v0.71.0

func (em *EKSMetadata) ValidateNodegroupsCreateRequest(nodegroups map[string]NodeGroupMetadata) error

ValidateNodegroupsCreateRequest ensures that the nodegroups to create do not already exist.

type EKSMetadataRequestedState added in v0.71.0

type EKSMetadataRequestedState struct {
	Version        string                       `json:"Version,omitempty"`
	AMI            string                       `json:"AMI,omitempty"`
	MaxPodsPerNode int64                        `json:"MaxPodsPerNode,omitempty"`
	Networking     string                       `json:"Networking,omitempty"`
	VPC            string                       `json:"VPC,omitempty"`
	ClusterRoleARN string                       `json:"ClusterRoleARN,omitempty"`
	NodeRoleARN    string                       `json:"NodeRoleARN,omitempty"`
	NodeGroups     map[string]NodeGroupMetadata `json:"NodeGroups,omitempty"`
}

EKSMetadataRequestedState is the requested state for eks metadata.

type EnvVar added in v0.16.0

type EnvVar struct {
	Value     string               `json:"value,omitempty"`
	ValueFrom *corev1.EnvVarSource `json:"valueFrom,omitempty"`
}

EnvVar contains the value source for a given environment variable.

func (*EnvVar) HasValue added in v0.20.0

func (e *EnvVar) HasValue() bool

HasValue returns wheather the env var has any value configuration or not.

func (*EnvVar) Validate added in v0.16.0

func (e *EnvVar) Validate() error

Validate returns wheather the env var has valid value configuration.

type EnvVarMap added in v0.16.0

type EnvVarMap map[string]EnvVar

EnvVarMap is a map of multiple env var names to their values.

func EnvVarFromJSON added in v0.17.0

func EnvVarFromJSON(raw []byte) (*EnvVarMap, error)

EnvVarFromJSON creates a EnvVarMap from the JSON represented as a []byte.

func (*EnvVarMap) ClearOrPatch added in v0.20.0

func (em *EnvVarMap) ClearOrPatch(input *EnvVarMap) bool

ClearOrPatch takes a new EnvVarMap and patches changes into the existing EnvVarMap with the following logic:

  • If the new EnvVarMap is empty, clear the existing EnvVarMap completely.
  • If the new EnvVarMap is not empty, apply normal patch logic.

func (EnvVarMap) Patch added in v0.20.0

func (em EnvVarMap) Patch(input EnvVarMap) bool

Patch takes a new EnvVarMap and patches changes into the existing EnvVarMap with the following logic:

  • If the new EnvVar has the same key as an old EnvVar, update the value.
  • If the new EnvVar is a new key, add the EnvVar.
  • If the new EnvVar has no value(is blank), clear the old EnvVar if there was one.

func (*EnvVarMap) ToEnvList added in v0.16.0

func (em *EnvVarMap) ToEnvList() []corev1.EnvVar

ToEnvList returns a list of standard corev1.EnvVars.

func (*EnvVarMap) ToJSON added in v0.17.0

func (em *EnvVarMap) ToJSON() ([]byte, error)

ToJSON converts the EnvVarMap to a JSON object represented as a []byte.

func (*EnvVarMap) Validate added in v0.16.0

func (em *EnvVarMap) Validate() error

Validate returns wheather the env var map has valid value configuration.

type Event added in v0.50.0

type Event struct {
	ID        string
	EventType EventType
	Timestamp int64
	ExtraData EventExtraData
}

Event represent event produced by Provisioner.

type EventDelivery added in v0.50.0

type EventDelivery struct {
	ID             string
	Status         EventDeliveryStatus
	LastAttempt    int64
	Attempts       int
	EventID        string
	SubscriptionID string
}

EventDelivery represents delivery status of particular Event to particular Subscription.

func EventDeliveryForEvent added in v0.50.0

func EventDeliveryForEvent(eventID string, deliveries []*EventDelivery) (*EventDelivery, bool)

EventDeliveryForEvent finds first EventDelivery for a particular eventID in collection.

type EventDeliveryStatus added in v0.50.0

type EventDeliveryStatus string

EventDeliveryStatus represents status of EventDelivery

const (
	// EventDeliveryNotAttempted indicates that delivery was not yet tried.
	EventDeliveryNotAttempted EventDeliveryStatus = "not-attempted"
	// EventDeliveryDelivered indicates that delivery was successful.
	EventDeliveryDelivered EventDeliveryStatus = "delivered"
	// EventDeliveryRetrying indicates that delivery failed but will be retired.
	EventDeliveryRetrying EventDeliveryStatus = "retrying"
	// EventDeliveryFailed indicates that delivery failed and will not be retried.
	EventDeliveryFailed EventDeliveryStatus = "failed"
)

type EventExtraData added in v0.50.0

type EventExtraData struct {
	Fields map[string]string `json:"fields"`
}

EventExtraData represents extra data of an Event.

type EventType added in v0.50.0

type EventType string

EventType represents the Provisioners' event type.

const (
	// ResourceStateChangeEventType is event type representing resource state change.
	ResourceStateChangeEventType EventType = "resourceStateChange"
)

type ExternalDatabaseConfig added in v0.63.0

type ExternalDatabaseConfig struct {
	SecretName string
}

ExternalDatabaseConfig represents configuration for an externally managed database.

func (*ExternalDatabaseConfig) ToJSON added in v0.63.0

func (cfg *ExternalDatabaseConfig) ToJSON() ([]byte, error)

ToJSON marshals database configuration to JSON if it is not nil.

type ExternalDatabaseRequest added in v0.63.0

type ExternalDatabaseRequest struct {
	SecretName string
}

ExternalDatabaseRequest represents requested configuration of an external database.

func (*ExternalDatabaseRequest) ToDBConfig added in v0.63.0

func (request *ExternalDatabaseRequest) ToDBConfig(database string) *ExternalDatabaseConfig

ToDBConfig converts ExternalDatabaseRequest to ExternalDatabaseConfig if the database type is external.

func (*ExternalDatabaseRequest) Validate added in v0.63.0

func (request *ExternalDatabaseRequest) Validate() error

Validate validates an ExternalDatabaseRequest.

type Filestore added in v0.7.0

type Filestore interface {
	Provision(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error
	Teardown(keepData bool, store InstallationDatabaseStoreInterface, logger log.FieldLogger) error
	GenerateFilestoreSpecAndSecret(store InstallationDatabaseStoreInterface, logger log.FieldLogger) (*FilestoreConfig, *corev1.Secret, error)
}

Filestore is the interface for managing Mattermost filestores.

type FilestoreConfig added in v0.38.0

type FilestoreConfig struct {
	URL    string
	Bucket string
	Secret string
}

FilestoreConfig represent universal configuration of the File store.

type GetClusterInstallationsRequest

type GetClusterInstallationsRequest struct {
	Paging
	ClusterID      string
	InstallationID string
}

GetClusterInstallationsRequest describes the parameters to request a list of cluster installations.

func (*GetClusterInstallationsRequest) ApplyToURL

func (request *GetClusterInstallationsRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetClustersRequest

type GetClustersRequest struct {
	Paging
}

GetClustersRequest describes the parameters to request a list of clusters.

func (*GetClustersRequest) ApplyToURL

func (request *GetClustersRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetDatabaseSchemaRequest added in v0.47.0

type GetDatabaseSchemaRequest struct {
	Paging
	LogicalDatabaseID string
	InstallationID    string
}

GetDatabaseSchemaRequest describes the parameters to request a list of database schemas.

func (*GetDatabaseSchemaRequest) ApplyToURL added in v0.47.0

func (request *GetDatabaseSchemaRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetGroupsRequest

type GetGroupsRequest struct {
	Paging
	WithInstallationCount bool
}

GetGroupsRequest describes the parameters to request a list of groups.

func (*GetGroupsRequest) ApplyToURL

func (request *GetGroupsRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetInstallationBackupsRequest added in v0.43.0

type GetInstallationBackupsRequest struct {
	Paging
	InstallationID        string
	ClusterInstallationID string
	State                 string
}

GetInstallationBackupsRequest describes the parameters to request a list of installation backups.

func (*GetInstallationBackupsRequest) ApplyToURL added in v0.43.0

func (request *GetInstallationBackupsRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetInstallationDBMigrationOperationsRequest added in v0.45.0

type GetInstallationDBMigrationOperationsRequest struct {
	Paging
	InstallationID        string
	ClusterInstallationID string
	State                 string
}

GetInstallationDBMigrationOperationsRequest describes the parameters to request a list of installation db migration operations.

func (*GetInstallationDBMigrationOperationsRequest) ApplyToURL added in v0.45.0

func (request *GetInstallationDBMigrationOperationsRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetInstallationDBRestorationOperationsRequest added in v0.45.0

type GetInstallationDBRestorationOperationsRequest struct {
	Paging
	InstallationID        string
	ClusterInstallationID string
	State                 string
}

GetInstallationDBRestorationOperationsRequest describes the parameters to request a list of installation restoration operations.

func (*GetInstallationDBRestorationOperationsRequest) ApplyToURL added in v0.45.0

func (request *GetInstallationDBRestorationOperationsRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetInstallationRequest added in v0.17.0

type GetInstallationRequest struct {
	IncludeGroupConfig          bool
	IncludeGroupConfigOverrides bool
}

GetInstallationRequest describes the parameters to request an installation.

func (*GetInstallationRequest) ApplyToURL added in v0.17.0

func (request *GetInstallationRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetInstallationsRequest

type GetInstallationsRequest struct {
	Paging
	OwnerID                     string
	GroupID                     string
	State                       string
	DNS                         string
	Name                        string
	IncludeGroupConfig          bool
	IncludeGroupConfigOverrides bool
}

GetInstallationsRequest describes the parameters to request a list of installations.

func (*GetInstallationsRequest) ApplyToURL

func (request *GetInstallationsRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetLogicalDatabasesRequest added in v0.47.0

type GetLogicalDatabasesRequest struct {
	Paging
	MultitenantDatabaseID string
}

GetLogicalDatabasesRequest describes the parameters to request a list of logical databases.

func (*GetLogicalDatabasesRequest) ApplyToURL added in v0.47.0

func (request *GetLogicalDatabasesRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetMultitenantDatabasesRequest added in v0.47.0

type GetMultitenantDatabasesRequest struct {
	Paging
	VpcID        string
	DatabaseType string
}

GetMultitenantDatabasesRequest describes the parameters to request a list of multitenant databases.

func (*GetMultitenantDatabasesRequest) ApplyToURL added in v0.47.0

func (request *GetMultitenantDatabasesRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type GetWebhooksRequest added in v0.3.0

type GetWebhooksRequest struct {
	Paging
	OwnerID string
}

GetWebhooksRequest describes the parameters to request a list of webhooks.

func (*GetWebhooksRequest) ApplyToURL added in v0.3.0

func (request *GetWebhooksRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type Group

type Group struct {
	ID              string
	Sequence        int64
	Name            string
	Description     string
	Version         string
	Image           string
	MaxRolling      int64
	MattermostEnv   EnvVarMap
	CreateAt        int64
	DeleteAt        int64
	APISecurityLock bool
	LockAcquiredBy  *string
	LockAcquiredAt  int64
}

Group represents a group of Mattermost installations.

func GroupFromReader

func GroupFromReader(reader io.Reader) (*Group, error)

GroupFromReader decodes a json-encoded group from the given io.Reader.

func GroupsFromReader

func GroupsFromReader(reader io.Reader) ([]*Group, error)

GroupsFromReader decodes a json-encoded list of groups from the given io.Reader.

func (*Group) Clone

func (g *Group) Clone() *Group

Clone returns a deep copy the group.

func (*Group) IsDeleted added in v0.19.0

func (g *Group) IsDeleted() bool

IsDeleted returns whether the group is deleted or not.

func (*Group) ToDTO added in v0.55.0

func (g *Group) ToDTO(annotations []*Annotation) *GroupDTO

ToDTO returns Group joined with Annotations.

type GroupDTO added in v0.55.0

type GroupDTO struct {
	*Group
	Annotations       []*Annotation `json:"annotations"`
	InstallationCount *int64        `json:"installation_count,omitempty"`
}

GroupDTO is a group with Annotations.

func (GroupDTO) GetInstallationCount added in v0.66.0

func (g GroupDTO) GetInstallationCount() int64

GetInstallationCount retrieves the installation count dereferenced value

type GroupFilter

type GroupFilter struct {
	Paging
	Annotations *AnnotationsFilter

	// WithInstallationCount if the store should retrieve the count of non-deleted installations
	// for this group
	WithInstallationCount bool
}

GroupFilter describes the parameters used to constrain a set of groups.

type GroupStatus added in v0.30.0

type GroupStatus struct {
	InstallationsTotal           int64
	InstallationsUpdated         int64
	InstallationsUpdating        int64
	InstallationsHibernating     int64
	InstallationsPendingDeletion int64
	InstallationsAwaitingUpdate  int64
}

GroupStatus represents the status of a group.

func GroupStatusFromReader added in v0.30.0

func GroupStatusFromReader(reader io.Reader) (*GroupStatus, error)

GroupStatusFromReader decodes a json-encoded group status from the given io.Reader.

type GroupsStatus added in v0.35.0

type GroupsStatus struct {
	ID     string
	Status GroupStatus
}

GroupsStatus represents the status of a groups.

func GroupsStatusFromReader added in v0.35.0

func GroupsStatusFromReader(reader io.Reader) ([]*GroupsStatus, error)

GroupsStatusFromReader decodes a json-encoded groups status from the given io.Reader.

type Headers added in v0.71.0

type Headers []WebhookHeader

func (Headers) GetHeaders added in v0.71.0

func (wh Headers) GetHeaders() map[string]string

func (*Headers) Scan added in v0.71.0

func (wh *Headers) Scan(databaseValue interface{}) error

func (Headers) Validate added in v0.71.0

func (wh Headers) Validate() error

func (Headers) Value added in v0.71.0

func (wh Headers) Value() (driver.Value, error)

type HelmUtilityVersion added in v0.36.0

type HelmUtilityVersion struct {
	Chart      string
	ValuesPath string
}

HelmUtilityVersion holds the chart version and the version of the values file

func (*HelmUtilityVersion) IsEmpty added in v0.50.0

func (u *HelmUtilityVersion) IsEmpty() bool

IsEmpty returns true if the HelmUtilityVersion is nil or if either of the values inside are undefined

func (*HelmUtilityVersion) UnmarshalJSON added in v0.71.0

func (u *HelmUtilityVersion) UnmarshalJSON(bytes []byte) error

UnmarshalJSON tries to unmarshal the HelmUtilityVersion from JSON If it fails, it assumes that bytes is just the chart version in string

func (*HelmUtilityVersion) Values added in v0.36.0

func (u *HelmUtilityVersion) Values() string

Values returns the name of the branch on which to find the correct values file

func (*HelmUtilityVersion) Version added in v0.36.0

func (u *HelmUtilityVersion) Version() string

Version returns the Helm chart version

type Installation

type Installation struct {
	ID                         string
	OwnerID                    string
	GroupID                    *string
	GroupSequence              *int64 `json:"GroupSequence,omitempty"`
	Version                    string
	Image                      string
	Name                       string
	Database                   string
	SingleTenantDatabaseConfig *SingleTenantDatabaseConfig `json:"SingleTenantDatabaseConfig,omitempty"`
	ExternalDatabaseConfig     *ExternalDatabaseConfig     `json:"ExternalDatabaseConfig,omitempty"`
	Filestore                  string
	License                    string
	MattermostEnv              EnvVarMap
	PriorityEnv                EnvVarMap
	Size                       string
	Affinity                   string
	State                      string
	CRVersion                  string
	CreateAt                   int64
	DeleteAt                   int64
	DeletionPendingExpiry      int64 `json:"DeletionPendingExpiry,omitempty"`
	APISecurityLock            bool
	LockAcquiredBy             *string
	LockAcquiredAt             int64
	GroupOverrides             map[string]string `json:"GroupOverrides,omitempty"`
	// contains filtered or unexported fields
}

Installation represents a Mattermost installation.

func InstallationFromReader

func InstallationFromReader(reader io.Reader) (*Installation, error)

InstallationFromReader decodes a json-encoded installation from the given io.Reader.

func InstallationsFromReader

func InstallationsFromReader(reader io.Reader) ([]*Installation, error)

InstallationsFromReader decodes a json-encoded list of installations from the given io.Reader.

func (*Installation) Clone

func (i *Installation) Clone() *Installation

Clone returns a deep copy the installation.

func (*Installation) ConfigMergedWithGroup added in v0.17.0

func (i *Installation) ConfigMergedWithGroup() bool

ConfigMergedWithGroup returns if the installation currently has inherited group configuration values.

func (*Installation) CreationDateString added in v0.46.1

func (i *Installation) CreationDateString() string

CreationDateString returns a standardized date string for an installation's creation.

func (*Installation) DeletionDateString added in v0.46.1

func (i *Installation) DeletionDateString() string

DeletionDateString returns a standardized date string for an installation's deletion or 'n/a' if not deleted.

func (*Installation) DeletionPendingExpiryCompleteTimeString added in v0.70.0

func (i *Installation) DeletionPendingExpiryCompleteTimeString() string

DeletionPendingExpiryCompleteTimeString returns a standardized time string for an installation's deletion or 'n/a' if not pending deletion.

func (*Installation) GetDatabaseWeight added in v0.43.0

func (i *Installation) GetDatabaseWeight() float64

GetDatabaseWeight returns a value corresponding to the TODO: maybe consider installation size in the future as well?

func (Installation) GetEnvVars added in v0.54.0

func (i Installation) GetEnvVars() EnvVarMap

GetEnvVars returns Mattermost environment variables that will be applied to the installation. If the installation was not merged with group, group env vars may impact the actual result.

func (*Installation) GetID added in v0.47.1

func (i *Installation) GetID() string

GetID returns ID of the resource.

func (*Installation) GetState added in v0.47.1

func (i *Installation) GetState() string

GetState returns State of the resource.

func (*Installation) InstallationSequenceMatchesMergedGroupSequence added in v0.31.0

func (i *Installation) InstallationSequenceMatchesMergedGroupSequence() bool

InstallationSequenceMatchesMergedGroupSequence returns if the installation's group sequence number matches the sequence number of the merged group config or not.

func (*Installation) InternalDatabase added in v0.8.0

func (i *Installation) InternalDatabase() bool

InternalDatabase returns true if the installation's database is internal to the kubernetes cluster it is running on.

func (*Installation) InternalFilestore added in v0.7.0

func (i *Installation) InternalFilestore() bool

InternalFilestore returns true if the installation's filestore is internal to the kubernetes cluster it is running on.

func (*Installation) IsDeleted added in v0.47.0

func (i *Installation) IsDeleted() bool

IsDeleted determines whether the resource is deleted.

func (*Installation) IsInGroup added in v0.17.0

func (i *Installation) IsInGroup() bool

IsInGroup returns if the installation is in a group or not.

func (*Installation) MergeWithGroup added in v0.17.0

func (i *Installation) MergeWithGroup(group *Group, includeOverrides bool)

MergeWithGroup merges an installation's configuration with that of a group. An option can be provided to include a group override summary to the installation.

func (*Installation) SyncGroupAndInstallationSequence added in v0.18.0

func (i *Installation) SyncGroupAndInstallationSequence()

SyncGroupAndInstallationSequence updates the installation GroupSequence value to reflect the hidden group Sequence value from the time the configuration was origianlly merged.

func (*Installation) ToDTO added in v0.31.0

func (i *Installation) ToDTO(annotations []*Annotation, dnsRecords []*InstallationDNS) *InstallationDTO

ToDTO expands installation to InstallationDTO.

func (*Installation) ValidTransitionState added in v0.8.0

func (i *Installation) ValidTransitionState(newState string) bool

ValidTransitionState returns whether an installation can be transitioned into the new state or not based on its current state.

type InstallationBackup added in v0.43.0

type InstallationBackup struct {
	ID             string
	InstallationID string
	// ClusterInstallationID is set when backup is scheduled.
	ClusterInstallationID string
	BackedUpDatabaseType  string
	DataResidence         *S3DataResidence
	State                 InstallationBackupState
	RequestAt             int64
	// StartAt is a start time of job that successfully completed backup.
	StartAt         int64
	DeleteAt        int64
	APISecurityLock bool
	LockAcquiredBy  *string
	LockAcquiredAt  int64
}

InstallationBackup contains information about installation's backup.

func NewInstallationBackupFromReader added in v0.43.0

func NewInstallationBackupFromReader(reader io.Reader) (*InstallationBackup, error)

NewInstallationBackupFromReader will create a InstallationBackup from an io.Reader with JSON data.

func NewInstallationBackupsFromReader added in v0.43.0

func NewInstallationBackupsFromReader(reader io.Reader) ([]*InstallationBackup, error)

NewInstallationBackupsFromReader will create a slice of InstallationBackup from an io.Reader with JSON data.

func (*InstallationBackup) ValidTransitionState added in v0.44.0

func (b *InstallationBackup) ValidTransitionState(newState InstallationBackupState) bool

ValidTransitionState returns whether an installation backup can be transitioned into the new state or not based on its current state.

type InstallationBackupFilter added in v0.43.0

type InstallationBackupFilter struct {
	Paging
	IDs                   []string
	InstallationID        string
	ClusterInstallationID string
	States                []InstallationBackupState
}

InstallationBackupFilter describes the parameters used to constrain a set of backup.

type InstallationBackupRequest added in v0.43.0

type InstallationBackupRequest struct {
	InstallationID string
}

InstallationBackupRequest represents request for installation backup.

func NewInstallationBackupRequestFromReader added in v0.43.0

func NewInstallationBackupRequestFromReader(reader io.Reader) (*InstallationBackupRequest, error)

NewInstallationBackupRequestFromReader will create a InstallationBackup from an io.Reader with JSON data.

type InstallationBackupState added in v0.43.0

type InstallationBackupState string

InstallationBackupState represents the state of backup.

const (
	// InstallationBackupStateBackupRequested is a requested backup that was not yet triggered.
	InstallationBackupStateBackupRequested InstallationBackupState = "backup-requested"
	// InstallationBackupStateBackupInProgress is a backup that is currently running.
	InstallationBackupStateBackupInProgress InstallationBackupState = "backup-in-progress"
	// InstallationBackupStateBackupSucceeded is a backup that have finished with success.
	InstallationBackupStateBackupSucceeded InstallationBackupState = "backup-succeeded"
	// InstallationBackupStateBackupFailed if a backup that have failed.
	InstallationBackupStateBackupFailed InstallationBackupState = "backup-failed"
	// InstallationBackupStateDeletionRequested is a backup marked for deletion.
	InstallationBackupStateDeletionRequested InstallationBackupState = "deletion-requested"
	// InstallationBackupStateDeleted is a deleted backup.
	InstallationBackupStateDeleted InstallationBackupState = "deleted"
	// InstallationBackupStateDeletionFailed is a backup which deletion failed.
	InstallationBackupStateDeletionFailed InstallationBackupState = "deletion-failed"
)

type InstallationDBMigrationFilter added in v0.45.0

type InstallationDBMigrationFilter struct {
	Paging
	IDs            []string
	InstallationID string
	States         []InstallationDBMigrationOperationState
}

InstallationDBMigrationFilter describes the parameters used to constrain a set of installation db migration operations.

type InstallationDBMigrationOperation added in v0.45.0

type InstallationDBMigrationOperation struct {
	ID             string
	InstallationID string
	RequestAt      int64
	State          InstallationDBMigrationOperationState
	// SourceDatabase is current Installation database.
	SourceDatabase string
	// DestinationDatabase is database type to which migration will be performed.
	DestinationDatabase string
	// For now only supported migration is from multi-tenant DB to multi-tenant DB.
	SourceMultiTenant                    *MultiTenantDBMigrationData `json:"SourceMultiTenant,omitempty"`
	DestinationMultiTenant               *MultiTenantDBMigrationData `json:"DestinationMultiTenant,omitempty"`
	BackupID                             string
	InstallationDBRestorationOperationID string
	CompleteAt                           int64
	DeleteAt                             int64
	LockAcquiredBy                       *string
	LockAcquiredAt                       int64
}

InstallationDBMigrationOperation contains information about installation's database migration operation.

func NewDBMigrationOperationFromReader added in v0.45.0

func NewDBMigrationOperationFromReader(reader io.Reader) (*InstallationDBMigrationOperation, error)

NewDBMigrationOperationFromReader will create a InstallationDBMigrationOperation from an io.Reader with JSON data.

func NewDBMigrationOperationsFromReader added in v0.45.0

func NewDBMigrationOperationsFromReader(reader io.Reader) ([]*InstallationDBMigrationOperation, error)

NewDBMigrationOperationsFromReader will create a slice of DBMigrationOperations from an io.Reader with JSON data.

func (InstallationDBMigrationOperation) ValidTransitionState added in v0.46.1

ValidTransitionState returns whether an installation backup can be transitioned into the new state or not based on its current state.

type InstallationDBMigrationOperationState added in v0.45.0

type InstallationDBMigrationOperationState string

InstallationDBMigrationOperationState represents the state of db migration operation.

const (
	// InstallationDBMigrationStateRequested is requested DB migration operation.
	InstallationDBMigrationStateRequested InstallationDBMigrationOperationState = "installation-db-migration-requested"
	// InstallationDBMigrationStateBackupInProgress is DB migration operation waiting for backup to complete.
	InstallationDBMigrationStateBackupInProgress InstallationDBMigrationOperationState = "installation-db-migration-installation-backup-in-progress"
	// InstallationDBMigrationStateDatabaseSwitch is DB migration operation that is switching to new database.
	InstallationDBMigrationStateDatabaseSwitch InstallationDBMigrationOperationState = "installation-db-migration-database switch"
	// InstallationDBMigrationStateRefreshSecrets is DB migration operation that is refreshing secrets.
	InstallationDBMigrationStateRefreshSecrets InstallationDBMigrationOperationState = "installation-db-migration-refresh-secrets"
	// InstallationDBMigrationStateTriggerRestoration is DB migration operation that is triggering database restoration.
	InstallationDBMigrationStateTriggerRestoration InstallationDBMigrationOperationState = "installation-db-migration-trigger-restoration"
	// InstallationDBMigrationStateRestorationInProgress is DB migration operation that is waiting for restoration to complete.
	InstallationDBMigrationStateRestorationInProgress InstallationDBMigrationOperationState = "installation-db-migration-restoration-in-progress"
	// InstallationDBMigrationStateUpdatingInstallationConfig is DB migration operation that is updating Installation configuration.
	InstallationDBMigrationStateUpdatingInstallationConfig InstallationDBMigrationOperationState = "installation-db-migration-updating-installation-config"
	// InstallationDBMigrationStateFinalizing is DB migration operation that is finalizing the migration.
	InstallationDBMigrationStateFinalizing InstallationDBMigrationOperationState = "installation-db-migration-finalizing"
	// InstallationDBMigrationStateFailing is DB migration operation that is failing.
	InstallationDBMigrationStateFailing InstallationDBMigrationOperationState = "installation-db-migration-failing"
	// InstallationDBMigrationStateSucceeded is DB migration operation that finished with success.
	InstallationDBMigrationStateSucceeded InstallationDBMigrationOperationState = "installation-db-migration-succeeded"
	// InstallationDBMigrationStateFailed is DB migration operation that failed.
	InstallationDBMigrationStateFailed InstallationDBMigrationOperationState = "installation-db-migration-failed"
	// InstallationDBMigrationStateCommitted is DB migration that has been committed and can no longer be rolled back.
	InstallationDBMigrationStateCommitted InstallationDBMigrationOperationState = "installation-db-migration-committed"
	// InstallationDBMigrationStateRollbackRequested is DB migration scheduled for rollback.
	InstallationDBMigrationStateRollbackRequested InstallationDBMigrationOperationState = "installation-db-migration-rollback-requested"
	// InstallationDBMigrationStateRollbackFinished is DB migration that was successfully rolled back.
	InstallationDBMigrationStateRollbackFinished InstallationDBMigrationOperationState = "installation-db-migration-rollback-finished"
	// InstallationDBMigrationStateDeletionRequested is DB migration scheduled for deletion.
	InstallationDBMigrationStateDeletionRequested InstallationDBMigrationOperationState = "installation-db-migration-deletion-requested"
	// InstallationDBMigrationStateDeleted is DB migration that has been deleted.
	InstallationDBMigrationStateDeleted InstallationDBMigrationOperationState = "installation-db-migration-deleted"
)

type InstallationDBMigrationRequest added in v0.45.0

type InstallationDBMigrationRequest struct {
	InstallationID string

	DestinationDatabase string

	DestinationMultiTenant *MultiTenantDBMigrationData `json:"DestinationMultiTenant,omitempty"`
}

InstallationDBMigrationRequest represent request for installation database migration.

func NewInstallationDBMigrationRequestFromReader added in v0.45.0

func NewInstallationDBMigrationRequestFromReader(reader io.Reader) (*InstallationDBMigrationRequest, error)

NewInstallationDBMigrationRequestFromReader will create a InstallationDBMigrationRequest from an io.Reader with JSON data.

type InstallationDBRestorationFilter added in v0.45.0

type InstallationDBRestorationFilter struct {
	Paging
	IDs                   []string
	InstallationID        string
	ClusterInstallationID string
	States                []InstallationDBRestorationState
}

InstallationDBRestorationFilter describes the parameters used to constrain a set of installation-db-restoration.

type InstallationDBRestorationOperation added in v0.45.0

type InstallationDBRestorationOperation struct {
	ID             string
	InstallationID string
	BackupID       string
	RequestAt      int64
	State          InstallationDBRestorationState
	// TargetInstallationState is an installation State to which installation
	// will be transitioned when the restoration finishes successfully.
	TargetInstallationState string
	ClusterInstallationID   string
	CompleteAt              int64
	DeleteAt                int64
	LockAcquiredBy          *string
	LockAcquiredAt          int64
}

InstallationDBRestorationOperation contains information about installation's database restoration operation.

func NewInstallationDBRestorationOperationFromReader added in v0.45.0

func NewInstallationDBRestorationOperationFromReader(reader io.Reader) (*InstallationDBRestorationOperation, error)

NewInstallationDBRestorationOperationFromReader will create a InstallationDBRestorationOperation from an io.Reader with JSON data.

func NewInstallationDBRestorationOperationsFromReader added in v0.45.0

func NewInstallationDBRestorationOperationsFromReader(reader io.Reader) ([]*InstallationDBRestorationOperation, error)

NewInstallationDBRestorationOperationsFromReader will create a slice of InstallationDBRestorationOperations from an io.Reader with JSON data.

type InstallationDBRestorationRequest added in v0.45.0

type InstallationDBRestorationRequest struct {
	InstallationID string
	BackupID       string
}

InstallationDBRestorationRequest represents request for installation restoration.

func NewInstallationDBRestorationRequestFromReader added in v0.45.0

func NewInstallationDBRestorationRequestFromReader(reader io.Reader) (*InstallationDBRestorationRequest, error)

NewInstallationDBRestorationRequestFromReader will create a InstallationDBRestorationRequest from an io.Reader with JSON data.

type InstallationDBRestorationState added in v0.45.0

type InstallationDBRestorationState string

InstallationDBRestorationState represents the state of db restoration operation.

const (
	// InstallationDBRestorationStateRequested is a requested installation db restoration that was not yet started.
	InstallationDBRestorationStateRequested InstallationDBRestorationState = "installation-db-restoration-requested"
	// InstallationDBRestorationStateInProgress is an installation db restoration that is currently running.
	InstallationDBRestorationStateInProgress InstallationDBRestorationState = "installation-db-restoration-in-progress"
	// InstallationDBRestorationStateFinalizing is an installation db restoration that is finalizing restoration.
	InstallationDBRestorationStateFinalizing InstallationDBRestorationState = "installation-db-restoration-finishing"
	// InstallationDBRestorationStateSucceeded is an installation db restoration that have finished with success.
	InstallationDBRestorationStateSucceeded InstallationDBRestorationState = "installation-db-restoration-succeeded"
	// InstallationDBRestorationStateFailing is an installation db restoration that is failing.
	InstallationDBRestorationStateFailing InstallationDBRestorationState = "installation-db-restoration-failing"
	// InstallationDBRestorationStateFailed is an installation db restoration that have failed.
	InstallationDBRestorationStateFailed InstallationDBRestorationState = "installation-db-restoration-failed"
	// InstallationDBRestorationStateInvalid is an installation db restoration that is invalid.
	InstallationDBRestorationStateInvalid InstallationDBRestorationState = "installation-db-restoration-invalid"
	// InstallationDBRestorationStateDeletionRequested is an installation db restoration scheduled for deletion.
	InstallationDBRestorationStateDeletionRequested InstallationDBRestorationState = "installation-db-restoration-deletion-requested"
	// InstallationDBRestorationStateDeleted is an installation db restoration that is deleted.
	InstallationDBRestorationStateDeleted InstallationDBRestorationState = "installation-db-restoration-deleted"
)

type InstallationDNS added in v0.54.1

type InstallationDNS struct {
	ID             string
	DomainName     string
	InstallationID string
	IsPrimary      bool
	CreateAt       int64
	DeleteAt       int64
}

InstallationDNS represents single domain name for given Installation.

type InstallationDTO added in v0.31.0

type InstallationDTO struct {
	*Installation
	Annotations []*Annotation `json:"Annotations,omitempty"`
	// Deprecated: This is for backward compatibility until we switch all clients, as DNS was removed from Installation.
	DNS        string
	DNSRecords []*InstallationDNS
}

InstallationDTO represents a Mattermost installation. DTO stands for Data Transfer Object.

type InstallationDatabaseStoreInterface added in v0.10.0

type InstallationDatabaseStoreInterface interface {
	GetInstallation(id string, includeGroupConfig, includeGroupConfigOverrides bool) (*Installation, error)
	GetClusterInstallations(filter *ClusterInstallationFilter) ([]*ClusterInstallation, error)
	GetMultitenantDatabases(filter *MultitenantDatabaseFilter) ([]*MultitenantDatabase, error)
	GetMultitenantDatabase(multitenantdatabaseID string) (*MultitenantDatabase, error)
	GetMultitenantDatabaseForInstallationID(installationID string) (*MultitenantDatabase, error)
	GetInstallationsTotalDatabaseWeight(installationIDs []string) (float64, error)
	CreateMultitenantDatabase(multitenantDatabase *MultitenantDatabase) error
	UpdateMultitenantDatabase(multitenantDatabase *MultitenantDatabase) error
	LockMultitenantDatabase(multitenantdatabaseID, lockerID string) (bool, error)
	UnlockMultitenantDatabase(multitenantdatabaseID, lockerID string, force bool) (bool, error)
	LockMultitenantDatabases(ids []string, lockerID string) (bool, error)
	UnlockMultitenantDatabases(ids []string, lockerID string, force bool) (bool, error)
	GetLogicalDatabases(filter *LogicalDatabaseFilter) ([]*LogicalDatabase, error)
	GetLogicalDatabase(logicalDatabaseID string) (*LogicalDatabase, error)
	GetDatabaseSchemas(filter *DatabaseSchemaFilter) ([]*DatabaseSchema, error)
	GetDatabaseSchema(databaseSchemaID string) (*DatabaseSchema, error)
	GetSingleTenantDatabaseConfigForInstallation(installationID string) (*SingleTenantDatabaseConfig, error)
	GetProxyDatabaseResourcesForInstallation(installationID string) (*DatabaseResourceGrouping, error)
	GetOrCreateProxyDatabaseResourcesForInstallation(installationID, multitenantDatabaseID string) (*DatabaseResourceGrouping, error)
	DeleteInstallationProxyDatabaseResources(multitenantDatabase *MultitenantDatabase, databaseSchema *DatabaseSchema) error
}

InstallationDatabaseStoreInterface is the interface necessary for SQLStore functionality to correlate an installation to a cluster for database creation. TODO(gsagula): Consider renaming this interface to InstallationDatabaseInterface. For reference, https://github.com/mattermost/mattermost-cloud/pull/209#discussion_r424597373

type InstallationFilter

type InstallationFilter struct {
	Paging
	InstallationIDs []string
	OwnerID         string
	GroupID         string
	State           string
	DNS             string
	Name            string
}

InstallationFilter describes the parameters used to constrain a set of installations.

type InstallationStateReport added in v0.8.0

type InstallationStateReport []StateReportEntry

InstallationStateReport is a report of all installation requests states.

func GetInstallationRequestStateReport added in v0.8.0

func GetInstallationRequestStateReport() InstallationStateReport

GetInstallationRequestStateReport returns a InstallationStateReport based on the current model of installation states.

type InstallationsCount added in v0.26.0

type InstallationsCount struct {
	Count int64
}

InstallationsCount represents the number of installations

type InstallationsStatus added in v0.42.0

type InstallationsStatus struct {
	InstallationsTotal           int64
	InstallationsStable          int64
	InstallationsHibernating     int64
	InstallationsPendingDeletion int64
	InstallationsUpdating        int64
}

InstallationsStatus represents the status of all installations.

func InstallationsStatusFromReader added in v0.42.0

func InstallationsStatusFromReader(reader io.Reader) (*InstallationsStatus, error)

InstallationsStatusFromReader decodes a json-encoded InstallationsStatus from the given io.Reader.

type KopsInstanceGroupMetadata added in v0.44.0

type KopsInstanceGroupMetadata struct {
	NodeInstanceType string
	NodeMinCount     int64
	NodeMaxCount     int64
}

KopsInstanceGroupMetadata is the metadata of an instance group.

type KopsInstanceGroupsMetadata added in v0.44.0

type KopsInstanceGroupsMetadata map[string]KopsInstanceGroupMetadata

KopsInstanceGroupsMetadata is a map of instance group names to their metadata.

type KopsMetadata

type KopsMetadata struct {
	Name                 string
	Version              string
	AMI                  string
	MasterInstanceType   string
	MasterCount          int64
	NodeInstanceType     string
	NodeMinCount         int64
	NodeMaxCount         int64
	MaxPodsPerNode       int64
	VPC                  string
	Networking           string
	MasterInstanceGroups KopsInstanceGroupsMetadata
	NodeInstanceGroups   KopsInstanceGroupsMetadata
	CustomInstanceGroups KopsInstanceGroupsMetadata  `json:"CustomInstanceGroups,omitempty"`
	ChangeRequest        *KopsMetadataRequestedState `json:"ChangeRequest,omitempty"`
	RotatorRequest       *RotatorMetadata            `json:"RotatorRequest,omitempty"`
	Warnings             []string                    `json:"Warnings,omitempty"`
}

KopsMetadata is the provisioner metadata stored in a model.Cluster.

func NewKopsMetadata

func NewKopsMetadata(metadataBytes []byte) (*KopsMetadata, error)

NewKopsMetadata creates an instance of KopsMetadata given the raw provisioner metadata.

func (*KopsMetadata) AddWarning added in v0.21.0

func (km *KopsMetadata) AddWarning(warning string)

AddWarning adds a warning the kops metadata warning list.

func (*KopsMetadata) ApplyChangeRequest added in v0.60.0

func (km *KopsMetadata) ApplyChangeRequest()

ApplyChangeRequest applies change request values to the KopsMetadata that are not reflected by calling RefreshKopsMetadata().

func (*KopsMetadata) ApplyClusterCreateRequest added in v0.71.0

func (km *KopsMetadata) ApplyClusterCreateRequest(createRequest *CreateClusterRequest) bool

func (*KopsMetadata) ApplyClusterSizePatch added in v0.71.0

func (km *KopsMetadata) ApplyClusterSizePatch(patchRequest *PatchClusterSizeRequest) bool

func (*KopsMetadata) ApplyUpgradePatch added in v0.71.0

func (km *KopsMetadata) ApplyUpgradePatch(patchRequest *PatchUpgradeClusterRequest) bool

ApplyUpgradePatch applies the patch to the given cluster's metadata.

func (*KopsMetadata) ClearChangeRequest added in v0.21.0

func (km *KopsMetadata) ClearChangeRequest()

ClearChangeRequest clears the kops metadata change request.

func (*KopsMetadata) ClearRotatorRequest added in v0.43.0

func (km *KopsMetadata) ClearRotatorRequest()

ClearRotatorRequest clears the kops metadata rotator request.

func (*KopsMetadata) ClearWarnings added in v0.21.0

func (km *KopsMetadata) ClearWarnings()

ClearWarnings clears the kops metadata warnings.

func (*KopsMetadata) GetCommonMetadata added in v0.71.0

func (km *KopsMetadata) GetCommonMetadata() ProvisionerMetadata

func (*KopsMetadata) GetKopsResizeSetActionsFromChanges added in v0.60.0

func (km *KopsMetadata) GetKopsResizeSetActionsFromChanges(changes KopsInstanceGroupMetadata, igName string) []string

GetKopsResizeSetActionsFromChanges produces a set of kops set actions that should be applied to the instance groups from the provided change data.

func (*KopsMetadata) GetWorkerNodesResizeChanges added in v0.44.0

func (km *KopsMetadata) GetWorkerNodesResizeChanges() KopsInstanceGroupsMetadata

GetWorkerNodesResizeChanges calculates instance group resizing based on the current ChangeRequest.

func (*KopsMetadata) ValidateChangeRequest added in v0.39.0

func (km *KopsMetadata) ValidateChangeRequest() error

ValidateChangeRequest ensures that the ChangeRequest has at least one actionable value.

func (*KopsMetadata) ValidateClusterSizePatch added in v0.71.0

func (em *KopsMetadata) ValidateClusterSizePatch(patchRequest *PatchClusterSizeRequest) error

type KopsMetadataRequestedState added in v0.21.0

type KopsMetadataRequestedState struct {
	Version            string `json:"Version,omitempty"`
	AMI                string `json:"AMI,omitempty"`
	MasterInstanceType string `json:"MasterInstanceType,omitempty"`
	MasterCount        int64  `json:"MasterCount,omitempty"`
	NodeInstanceType   string `json:"NodeInstanceType,omitempty"`
	NodeMinCount       int64  `json:"NodeMinCount,omitempty"`
	NodeMaxCount       int64  `json:"NodeMaxCount,omitempty"`
	MaxPodsPerNode     int64  `json:"MaxPodsPerNode,omitempty"`
	Networking         string `json:"Networking,omitempty"`
	VPC                string `json:"VPC,omitempty"`
}

KopsMetadataRequestedState is the requested state for kops metadata.

type LaunchTemplateData added in v0.71.0

type LaunchTemplateData struct {
	Name           string
	ClusterName    string
	AMI            string
	MaxPodsPerNode int64
	SecurityGroups []string
}

type LeaveGroupRequest added in v0.18.0

type LeaveGroupRequest struct {
	RetainConfig bool
}

LeaveGroupRequest describes the parameters to leave a group.

func (*LeaveGroupRequest) ApplyToURL added in v0.18.0

func (request *LeaveGroupRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type ListStateChangeEventsRequest added in v0.50.0

type ListStateChangeEventsRequest struct {
	Paging
	ResourceType ResourceType
	ResourceID   string
}

ListStateChangeEventsRequest represents request for state change events query.

func (*ListStateChangeEventsRequest) ApplyToURL added in v0.50.0

func (request *ListStateChangeEventsRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type ListSubscriptionsRequest added in v0.50.0

type ListSubscriptionsRequest struct {
	Paging
	Owner     string
	EventType EventType
}

ListSubscriptionsRequest represents a request data for querying subscriptions.

func (*ListSubscriptionsRequest) ApplyToURL added in v0.50.0

func (request *ListSubscriptionsRequest) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type LogicalDatabase added in v0.47.0

type LogicalDatabase struct {
	ID                    string
	MultitenantDatabaseID string
	Name                  string
	CreateAt              int64
	DeleteAt              int64
	LockAcquiredBy        *string
	LockAcquiredAt        int64
}

LogicalDatabase represents a logical database inside a MultitenantDatabase.

func LogicalDatabaseFromReader added in v0.47.0

func LogicalDatabaseFromReader(reader io.Reader) (*LogicalDatabase, error)

LogicalDatabaseFromReader decodes a json-encoded logical database from the given io.Reader.

func LogicalDatabasesFromReader added in v0.47.0

func LogicalDatabasesFromReader(reader io.Reader) ([]*LogicalDatabase, error)

LogicalDatabasesFromReader decodes a json-encoded list of logical databases from the given io.Reader.

type LogicalDatabaseFilter added in v0.47.0

type LogicalDatabaseFilter struct {
	Paging
	MultitenantDatabaseID string
}

LogicalDatabaseFilter describes the parameters used to constrain a set of LogicalDatabase.

type MigrateClusterInstallationRequest added in v0.46.1

type MigrateClusterInstallationRequest struct {
	InstallationID   string
	SourceClusterID  string
	TargetClusterID  string
	DNSSwitch        bool
	LockInstallation bool
}

MigrateClusterInstallationRequest describes the parameters used to compose migration request between two clusters.

func NewMigrateClusterInstallationRequestFromReader added in v0.46.1

func NewMigrateClusterInstallationRequestFromReader(reader io.Reader) (MigrateClusterInstallationRequest, error)

NewMigrateClusterInstallationRequestFromReader will create a MigrateClusterInstallationRequest from an io.Reader.

func (*MigrateClusterInstallationRequest) Validate added in v0.46.1

func (request *MigrateClusterInstallationRequest) Validate() error

Validate validate the migration request for cluster installations

type MigrateClusterInstallationResponse added in v0.48.0

type MigrateClusterInstallationResponse struct {
	SourceClusterID           string
	TargetClusterID           string
	Operation                 string
	TotalClusterInstallations int
}

MigrateClusterInstallationResponse describes the summary of migration between two clusters.

func MigrateClusterInstallationResponseFromReader added in v0.48.0

func MigrateClusterInstallationResponseFromReader(reader io.Reader) (*MigrateClusterInstallationResponse, error)

MigrateClusterInstallationResponseFromReader decodes a json-encoded cluster migration from the given io.Reader.

type MinioOperatorFilestore added in v0.7.0

type MinioOperatorFilestore struct{}

MinioOperatorFilestore is a filestore backed by the MinIO operator.

func NewMinioOperatorFilestore added in v0.7.0

func NewMinioOperatorFilestore() *MinioOperatorFilestore

NewMinioOperatorFilestore returns a new NewMinioOperatorFilestore interface.

func (*MinioOperatorFilestore) GenerateFilestoreSpecAndSecret added in v0.7.0

func (f *MinioOperatorFilestore) GenerateFilestoreSpecAndSecret(store InstallationDatabaseStoreInterface, logger log.FieldLogger) (*FilestoreConfig, *corev1.Secret, error)

GenerateFilestoreSpecAndSecret creates the k8s filestore spec and secret for accessing the MinIO operator filestore.

func (*MinioOperatorFilestore) Provision added in v0.7.0

Provision completes all the steps necessary to provision a MinIO operator filestore.

func (*MinioOperatorFilestore) Teardown added in v0.7.0

Teardown removes all MinIO operator resources related to a given installation.

type MultiTenantDBMigrationData added in v0.45.0

type MultiTenantDBMigrationData struct {
	DatabaseID string
}

MultiTenantDBMigrationData represents migration data for Multi-tenant database.

type MultitenantDatabase added in v0.19.0

type MultitenantDatabase struct {
	ID                                 string
	RdsClusterID                       string
	VpcID                              string
	DatabaseType                       string
	State                              string
	WriterEndpoint                     string
	ReaderEndpoint                     string
	Installations                      MultitenantDatabaseInstallations
	MigratedInstallations              MultitenantDatabaseInstallations
	MaxInstallationsPerLogicalDatabase int64 `json:"MaxInstallationsPerLogicalDatabase,omitempty"`
	CreateAt                           int64
	DeleteAt                           int64
	LockAcquiredBy                     *string
	LockAcquiredAt                     int64
}

MultitenantDatabase represents database infrastructure that contains multiple installation databases.

func MultitenantDatabaseFromReader added in v0.46.1

func MultitenantDatabaseFromReader(reader io.Reader) (*MultitenantDatabase, error)

MultitenantDatabaseFromReader decodes a json-encoded multitenant database from the given io.Reader.

func MultitenantDatabasesFromReader added in v0.25.0

func MultitenantDatabasesFromReader(reader io.Reader) ([]*MultitenantDatabase, error)

MultitenantDatabasesFromReader decodes a json-encoded list of multitenant databases from the given io.Reader.

func (*MultitenantDatabase) CreationDateString added in v0.62.0

func (d *MultitenantDatabase) CreationDateString() string

CreationDateString returns a standardized date string for a multitenant database string.

func (*MultitenantDatabase) GetReaderEndpoint added in v0.46.1

func (d *MultitenantDatabase) GetReaderEndpoint() string

GetReaderEndpoint returns the best available reader endpoint for a multitenant database.

type MultitenantDatabaseFilter added in v0.19.0

type MultitenantDatabaseFilter struct {
	Paging
	LockerID               string
	InstallationID         string
	MigratedInstallationID string
	VpcID                  string
	DatabaseType           string
	MaxInstallationsLimit  int
}

MultitenantDatabaseFilter describes the parameters used to constrain a set of MultitenantDatabases.

type MultitenantDatabaseInstallations added in v0.25.0

type MultitenantDatabaseInstallations []string

MultitenantDatabaseInstallations is the list of installation IDs that belong to a given MultitenantDatabase.

func (*MultitenantDatabaseInstallations) Add added in v0.25.0

func (i *MultitenantDatabaseInstallations) Add(installationID string)

Add inserts a new installation in the container.

func (*MultitenantDatabaseInstallations) Contains added in v0.25.0

func (i *MultitenantDatabaseInstallations) Contains(installationID string) bool

Contains checks if the supplied installation ID exists in the container.

func (*MultitenantDatabaseInstallations) Count added in v0.25.0

Count returns the number of installations on the multitenant database.

func (*MultitenantDatabaseInstallations) Remove added in v0.25.0

func (i *MultitenantDatabaseInstallations) Remove(installationID string)

Remove deletes the installation from the container.

type MysqlOperatorDatabase added in v0.8.0

type MysqlOperatorDatabase struct{}

MysqlOperatorDatabase is a database backed by the MySQL operator.

func NewMysqlOperatorDatabase added in v0.8.0

func NewMysqlOperatorDatabase() *MysqlOperatorDatabase

NewMysqlOperatorDatabase returns a new MysqlOperatorDatabase interface.

func (*MysqlOperatorDatabase) GenerateDatabaseSecret added in v0.38.0

func (d *MysqlOperatorDatabase) GenerateDatabaseSecret(store InstallationDatabaseStoreInterface, logger log.FieldLogger) (*corev1.Secret, error)

GenerateDatabaseSecret creates the k8s database spec and secret for accessing the MySQL operator database.

func (*MysqlOperatorDatabase) MigrateOut added in v0.45.0

MigrateOut migrating out of MySQL Operator managed database is not supported.

func (*MysqlOperatorDatabase) MigrateTo added in v0.45.0

MigrateTo migration to MySQL Operator managed database is not supported.

func (*MysqlOperatorDatabase) Provision added in v0.8.0

Provision completes all the steps necessary to provision a MySQL operator database.

func (*MysqlOperatorDatabase) RefreshResourceMetadata added in v0.43.0

func (d *MysqlOperatorDatabase) RefreshResourceMetadata(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error

RefreshResourceMetadata ensures various operator database resource's metadata are correct.

func (*MysqlOperatorDatabase) RollbackMigration added in v0.45.0

RollbackMigration rolling back migration is not supported for MySQL Operator managed database.

func (*MysqlOperatorDatabase) Snapshot added in v0.17.0

Snapshot is not supported by the operator and it should return an error.

func (*MysqlOperatorDatabase) Teardown added in v0.8.0

Teardown removes all MySQL operator resources for a given installation.

func (*MysqlOperatorDatabase) TeardownMigrated added in v0.45.0

TeardownMigrated tearing down migrated databases is not supported for MySQL Operator managed database.

type NodeGroupMetadata added in v0.71.0

type NodeGroupMetadata struct {
	Name              string
	Type              string `json:"Type,omitempty"`
	InstanceType      string `json:"InstanceType,omitempty"`
	MinCount          int64  `json:"MinCount,omitempty"`
	MaxCount          int64  `json:"MaxCount,omitempty"`
	WithPublicSubnet  bool   `json:"WithPublicSubnet,omitempty"`
	WithSecurityGroup bool   `json:"WithSecurityGroup,omitempty"`
}

NodeGroupMetadata is the metadata of an instance group.

func (*NodeGroupMetadata) CopyMissingFieldsFrom added in v0.71.0

func (ng *NodeGroupMetadata) CopyMissingFieldsFrom(other NodeGroupMetadata)

CopyMissingFieldsFrom copy empty fields from the given NodeGroupMetadata to the current metadata.

type PGBouncerConfig added in v0.71.0

type PGBouncerConfig struct {
	MinPoolSize                   int
	DefaultPoolSize               int
	ReservePoolSize               int
	MaxClientConnections          int
	MaxDatabaseConnectionsPerPool int
	ServerIdleTimeout             int
	ServerLifetime                int
	ServerResetQueryAlways        int
}

PGBouncerConfig contains the configuration for the PGBouncer utility. //////////////////////////////////////////////////////////////////////////////

  • MaxDatabaseConnectionsPerPool is the maximum number of connections per logical database pool when using proxy databases.
  • MinPoolSize is the minimum pool size.
  • DefaultPoolSize is the default pool size per user.
  • ReservePoolSize is the default pool size per user.
  • MaxClientConnections is the maximum client connections.
  • ServerIdleTimeout is the server idle timeout.
  • ServerLifetime is the server lifetime.
  • ServerResetQueryAlways is boolean 0 or 1 whether server_reset_query should be run in all pooling modes.

//////////////////////////////////////////////////////////////////////////////

func (*PGBouncerConfig) Validate added in v0.71.0

func (c *PGBouncerConfig) Validate() error

Validate validates a PGBouncerConfig.

type Paging added in v0.44.0

type Paging struct {
	Page           int
	PerPage        int
	IncludeDeleted bool
}

Paging represent paging filter.

func AllPages added in v0.66.0

func AllPages(includeDeleted bool) Paging

AllPages Paging filter returning all elements with a customizable deleted flag.

func AllPagesNotDeleted added in v0.44.0

func AllPagesNotDeleted() Paging

AllPagesNotDeleted if paging filter returning all not deleted elements.

func AllPagesWithDeleted added in v0.44.0

func AllPagesWithDeleted() Paging

AllPagesWithDeleted if paging filter returning all elements including deleted ones.

func (*Paging) AddToQuery added in v0.44.0

func (p *Paging) AddToQuery(q url.Values)

AddToQuery adds paging filter to query values.

type PatchClusterSizeRequest added in v0.21.0

type PatchClusterSizeRequest struct {
	NodeInstanceType *string        `json:"node-instance-type,omitempty"`
	NodeMinCount     *int64         `json:"node-min-count,omitempty"`
	NodeMaxCount     *int64         `json:"node-max-count,omitempty"`
	RotatorConfig    *RotatorConfig `json:"rotatorConfig,omitempty"`
	NodeGroups       []string       `json:"nodeGroups,omitempty"`
}

PatchClusterSizeRequest specifies the parameters for resizing a cluster.

func NewResizeClusterRequestFromReader added in v0.21.0

func NewResizeClusterRequestFromReader(reader io.Reader) (*PatchClusterSizeRequest, error)

NewResizeClusterRequestFromReader will create an PatchClusterSizeRequest from an io.Reader with JSON data.

func (*PatchClusterSizeRequest) Validate added in v0.21.0

func (p *PatchClusterSizeRequest) Validate() error

Validate validates the values of a PatchClusterSizeRequest.

type PatchGroupRequest

type PatchGroupRequest struct {
	ID            string
	MaxRolling    *int64
	Name          *string
	Description   *string
	Version       *string
	Image         *string
	MattermostEnv EnvVarMap

	ForceSequenceUpdate       bool
	ForceInstallationsRestart bool
}

PatchGroupRequest specifies the parameters for an updated group.

func NewPatchGroupRequestFromReader

func NewPatchGroupRequestFromReader(reader io.Reader) (*PatchGroupRequest, error)

NewPatchGroupRequestFromReader will create a PatchGroupRequest from an io.Reader with JSON data.

func (*PatchGroupRequest) Apply

func (p *PatchGroupRequest) Apply(group *Group) bool

Apply applies the patch to the given group.

func (*PatchGroupRequest) Validate added in v0.17.0

func (p *PatchGroupRequest) Validate() error

Validate validates the values of a group patch request

type PatchInstallationDeletionRequest added in v0.70.0

type PatchInstallationDeletionRequest struct {
	DeletionPendingExpiry *int64
}

PatchInstallationDeletionRequest specifies the parameters for an updating installation deletion parameters.

func NewPatchInstallationDeletionRequestFromReader added in v0.70.0

func NewPatchInstallationDeletionRequestFromReader(reader io.Reader) (*PatchInstallationDeletionRequest, error)

NewPatchInstallationDeletionRequestFromReader will create a PatchInstallationDeletionRequest from an io.Reader with JSON data.

func (*PatchInstallationDeletionRequest) Apply added in v0.70.0

func (p *PatchInstallationDeletionRequest) Apply(installation *Installation) bool

Apply applies the deletion patch to the given installation.

func (*PatchInstallationDeletionRequest) Validate added in v0.70.0

Validate validates the values of a installation deletion patch request.

type PatchInstallationRequest added in v0.19.0

type PatchInstallationRequest struct {
	OwnerID       *string
	Image         *string
	Version       *string
	Size          *string
	License       *string
	PriorityEnv   EnvVarMap
	MattermostEnv EnvVarMap
}

PatchInstallationRequest specifies the parameters for an updated installation.

func NewPatchInstallationRequestFromReader added in v0.19.0

func NewPatchInstallationRequestFromReader(reader io.Reader) (*PatchInstallationRequest, error)

NewPatchInstallationRequestFromReader will create a PatchInstallationRequest from an io.Reader with JSON data.

func (*PatchInstallationRequest) Apply added in v0.19.0

func (p *PatchInstallationRequest) Apply(installation *Installation) bool

Apply applies the patch to the given installation.

func (*PatchInstallationRequest) Validate added in v0.19.0

func (p *PatchInstallationRequest) Validate() error

Validate validates the values of a installation patch request.

type PatchMultitenantDatabaseRequest added in v0.47.0

type PatchMultitenantDatabaseRequest struct {
	MaxInstallationsPerLogicalDatabase *int64
}

PatchMultitenantDatabaseRequest specifies the parameters for an updated multitenant database.

func NewPatchMultitenantDatabaseRequestFromReader added in v0.47.0

func NewPatchMultitenantDatabaseRequestFromReader(reader io.Reader) (*PatchMultitenantDatabaseRequest, error)

NewPatchMultitenantDatabaseRequestFromReader will create a PatchMultitenantDatabaseRequest from an io.Reader with JSON data.

func (*PatchMultitenantDatabaseRequest) Apply added in v0.47.0

Apply applies the patch to the given multitenant database.

func (*PatchMultitenantDatabaseRequest) Validate added in v0.47.0

func (p *PatchMultitenantDatabaseRequest) Validate() error

Validate validates the values of a multitenant database patch request.

type PatchUpgradeClusterRequest added in v0.20.0

type PatchUpgradeClusterRequest struct {
	Version        *string        `json:"version,omitempty"`
	AMI            *string        `json:"ami,omitempty"`
	RotatorConfig  *RotatorConfig `json:"rotatorConfig,omitempty"`
	MaxPodsPerNode *int64
}

PatchUpgradeClusterRequest specifies the parameters for upgrading a cluster.

func NewUpgradeClusterRequestFromReader added in v0.20.0

func NewUpgradeClusterRequestFromReader(reader io.Reader) (*PatchUpgradeClusterRequest, error)

NewUpgradeClusterRequestFromReader will create an UpgradeClusterRequest from an io.Reader with JSON data.

func (*PatchUpgradeClusterRequest) Validate added in v0.20.0

func (p *PatchUpgradeClusterRequest) Validate() error

Validate validates the values of a cluster upgrade request.

type ProvisionClusterRequest added in v0.14.0

type ProvisionClusterRequest struct {
	DesiredUtilityVersions map[string]*HelmUtilityVersion `json:"utility-versions,omitempty"`
	Force                  bool                           `json:"force"`
}

ProvisionClusterRequest contains metadata related to changing the installed cluster state.

func NewProvisionClusterRequestFromReader added in v0.14.0

func NewProvisionClusterRequestFromReader(reader io.Reader) (*ProvisionClusterRequest, error)

NewProvisionClusterRequestFromReader will create an UpdateClusterRequest from an io.Reader with JSON data.

type ProvisionerMetadata added in v0.71.0

type ProvisionerMetadata struct {
	Name             string
	Version          string
	AMI              string
	NodeInstanceType string
	NodeMinCount     int64
	NodeMaxCount     int64
	MaxPodsPerNode   int64
	VPC              string
	Networking       string
}

type Resource added in v0.47.1

type Resource interface {
	GetID() string
	IsDeleted() bool
}

Resource is a generic interface implemented by all resources supervised by Provisioner.

func ClustersAsResources added in v0.47.1

func ClustersAsResources(collection []*Cluster) []Resource

ClustersAsResources returns collection as Resource objects.

func InstallationsAsResources added in v0.47.1

func InstallationsAsResources(collection []*Installation) []Resource

InstallationsAsResources returns collection as Resource objects.

type ResourceType added in v0.50.0

type ResourceType string

ResourceType specifies a type of Provisioners' resource.

const (
	// TypeCluster is the string value that represents a cluster.
	TypeCluster ResourceType = "cluster"
	// TypeInstallation is the string value that represents an installation.
	TypeInstallation ResourceType = "installation"
	// TypeClusterInstallation is the string value that represents a cluster
	// installation.
	TypeClusterInstallation ResourceType = "cluster_installation"
	// TypeInstallationBackup is the string value that represents an installation backup.
	TypeInstallationBackup ResourceType = "installation_backup"
	// TypeInstallationDBRestoration is the string value that represents an installation db restoration operation.
	TypeInstallationDBRestoration ResourceType = "installation_db_restoration_operation"
	// TypeInstallationDBMigration is the string value that represents an installation db migration operation.
	TypeInstallationDBMigration ResourceType = "installation_db_migration_operation"
)

func (ResourceType) String added in v0.50.0

func (t ResourceType) String() string

String converts ResourceType to string.

type Resources added in v0.47.1

type Resources []Resource

Resources is a collection of Resource objects.

type RotatorConfig added in v0.43.0

type RotatorConfig struct {
	UseRotator              *bool `json:"use-rotator,omitempty"`
	MaxScaling              *int  `json:"max-scaling,omitempty"`
	MaxDrainRetries         *int  `json:"max-drain-retries,omitempty"`
	EvictGracePeriod        *int  `json:"evict-grace-period,omitempty"`
	WaitBetweenRotations    *int  `json:"wait-between-rotations,omitempty"`
	WaitBetweenDrains       *int  `json:"wait-between-drains,omitempty"`
	WaitBetweenPodEvictions *int  `json:"wait-between-pod-evictions,omitempty"`
}

RotatorConfig is the config setup for the Rotator tool run

func (RotatorConfig) Validate added in v0.66.0

func (r RotatorConfig) Validate() error

Validate validates that the provided attributes for the rotator are set

type RotatorMetadata added in v0.43.0

type RotatorMetadata struct {
	Status *rotator.RotatorMetadata
	Config *RotatorConfig
}

RotatorMetadata is the metadata for the Rotator tool

type S3DataResidence added in v0.43.0

type S3DataResidence struct {
	Region     string
	URL        string
	Bucket     string
	PathPrefix string
	ObjectKey  string
}

S3DataResidence contains information about backup location.

func (S3DataResidence) FullPath added in v0.44.0

func (dr S3DataResidence) FullPath() string

FullPath returns joined path of object in the file store.

type SingleTenantDatabaseConfig added in v0.35.0

type SingleTenantDatabaseConfig struct {
	PrimaryInstanceType string
	ReplicaInstanceType string
	ReplicasCount       int
}

SingleTenantDatabaseConfig represents configuration for the database when used in single tenant mode.

func NewSingleTenantDatabaseConfigurationFromReader added in v0.35.0

func NewSingleTenantDatabaseConfigurationFromReader(reader io.Reader) (*SingleTenantDatabaseConfig, error)

NewSingleTenantDatabaseConfigurationFromReader will create a SingleTenantDatabaseConfig from an io.Reader with JSON data.

func (*SingleTenantDatabaseConfig) ToJSON added in v0.35.0

func (cfg *SingleTenantDatabaseConfig) ToJSON() ([]byte, error)

ToJSON marshals database configuration to JSON if it is not nil.

type SingleTenantDatabaseRequest added in v0.35.0

type SingleTenantDatabaseRequest struct {
	PrimaryInstanceType string
	ReplicaInstanceType string
	ReplicasCount       int
}

SingleTenantDatabaseRequest represents requested configuration of single tenant database.

func NewSingleTenantDatabaseRequestFromReader added in v0.35.0

func NewSingleTenantDatabaseRequestFromReader(reader io.Reader) (*SingleTenantDatabaseRequest, error)

NewSingleTenantDatabaseRequestFromReader will create a SingleTenantDatabaseRequest from an io.Reader with JSON data.

func (*SingleTenantDatabaseRequest) SetDefaults added in v0.35.0

func (request *SingleTenantDatabaseRequest) SetDefaults()

SetDefaults sets the default values for a single tenant database configuration request.

func (*SingleTenantDatabaseRequest) ToDBConfig added in v0.35.0

func (request *SingleTenantDatabaseRequest) ToDBConfig(database string) *SingleTenantDatabaseConfig

ToDBConfig converts SingleTenantDatabaseRequest to SingleTenantDatabaseConfig if database type is single tenant.

func (*SingleTenantDatabaseRequest) Validate added in v0.35.0

func (request *SingleTenantDatabaseRequest) Validate() error

Validate validates the values of single tenant database configuration request.

type StateChangeEvent added in v0.50.0

type StateChangeEvent struct {
	ID           string
	EventID      string
	OldState     string
	NewState     string
	ResourceID   string
	ResourceType ResourceType
}

StateChangeEvent contains data specific to StateChangeEvent.

type StateChangeEventData added in v0.50.0

type StateChangeEventData struct {
	Event       Event
	StateChange StateChangeEvent
}

StateChangeEventData is a combination of StateChangeEvent and Event data.

func NewStateChangeEventsDataFromReader added in v0.50.0

func NewStateChangeEventsDataFromReader(reader io.Reader) ([]*StateChangeEventData, error)

NewStateChangeEventsDataFromReader will create an array of StateChangeEventData from an io.Reader with JSON data.

func (*StateChangeEventData) ToEventPayload added in v0.50.0

func (e *StateChangeEventData) ToEventPayload() StateChangeEventPayload

ToEventPayload converts StateChangeEventData to StateChangeEventPayload.

func (*StateChangeEventData) ToWebhookPayload added in v0.50.0

func (e *StateChangeEventData) ToWebhookPayload() WebhookPayload

ToWebhookPayload converts StateChangeEventData to WebhookPayload.

type StateChangeEventDeliveryData added in v0.50.0

type StateChangeEventDeliveryData struct {
	EventDelivery EventDelivery
	EventData     StateChangeEventData
	EventHeaders  Headers
}

StateChangeEventDeliveryData is a combination of StateChangeEventData and EventDelivery.

type StateChangeEventFilter added in v0.50.0

type StateChangeEventFilter struct {
	Paging
	ResourceType ResourceType
	ResourceID   string
	OldStates    []string
	NewStates    []string
}

StateChangeEventFilter is a filter for state change event queries.

type StateChangeEventPayload added in v0.50.0

type StateChangeEventPayload struct {
	EventID      string       `json:"eventId"`
	Timestamp    int64        `json:"timestamp"`
	ResourceID   string       `json:"resourceId"`
	ResourceType ResourceType `json:"resourceType"`
	NewState     string       `json:"newState"`
	OldState     string       `json:"oldState"`
	ExtraData    map[string]string
}

StateChangeEventPayload represents payload that is sent to consumers.

func NewStateChangeEventPayloadFromReader added in v0.50.0

func NewStateChangeEventPayloadFromReader(reader io.Reader) (*StateChangeEventPayload, error)

NewStateChangeEventPayloadFromReader will create a StateChangeEventPayload from an io.Reader with JSON data.

type StateList added in v0.8.0

type StateList []string

StateList is a list of states

func (*StateList) Count added in v0.8.0

func (sl *StateList) Count() int

Count provides the number of states in a StateList.

type StateReportEntry added in v0.8.0

type StateReportEntry struct {
	RequestedState string
	ValidStates    StateList
	InvalidStates  StateList
}

StateReportEntry is a report entry of a given request state.

type Subscription added in v0.50.0

type Subscription struct {
	ID                    string
	Name                  string
	URL                   string
	OwnerID               string
	EventType             EventType
	LastDeliveryStatus    SubscriptionDeliveryStatus
	LastDeliveryAttemptAt int64
	// FailureThreshold specifies the time, after which undelivered event will be considered failed.
	FailureThreshold time.Duration
	CreateAt         int64
	DeleteAt         int64
	LockAcquiredBy   *string
	LockAcquiredAt   int64
	Headers          Headers
}

Subscription is a subscription for Provisioner events.

func NewSubscriptionFromReader added in v0.50.0

func NewSubscriptionFromReader(reader io.Reader) (*Subscription, error)

NewSubscriptionFromReader will create a Subscription from an io.Reader with JSON data.

func NewSubscriptionsFromReader added in v0.50.0

func NewSubscriptionsFromReader(reader io.Reader) ([]*Subscription, error)

NewSubscriptionsFromReader will create a slice of Subscriptions from an io.Reader with JSON data.

func (Subscription) IsDeleted added in v0.50.0

func (s Subscription) IsDeleted() bool

IsDeleted returns true if subscription is deleted.

type SubscriptionDeliveryStatus added in v0.50.0

type SubscriptionDeliveryStatus string

SubscriptionDeliveryStatus represents delivery status for subscription.

const (
	// SubscriptionDeliveryNone indicates no prior delivery for the subscription.
	SubscriptionDeliveryNone SubscriptionDeliveryStatus = ""
	// SubscriptionDeliverySucceeded indicates that last delivery for subscription succeeded.
	SubscriptionDeliverySucceeded SubscriptionDeliveryStatus = "succeeded"
	// SubscriptionDeliveryFailed indicates that last delivery for subscription failed.
	SubscriptionDeliveryFailed SubscriptionDeliveryStatus = "failed"
)

type SubscriptionsFilter added in v0.50.0

type SubscriptionsFilter struct {
	Paging
	Owner     string
	EventType EventType
}

SubscriptionsFilter is a filter for subscription queries.

type SupervisedResource added in v0.47.1

type SupervisedResource interface {
	Resource
	GetState() string
}

SupervisedResource is a resource with dedicated supervisor.

type UpdateClusterRequest added in v0.8.0

type UpdateClusterRequest struct {
	AllowInstallations bool
}

UpdateClusterRequest specifies the parameters available for updating a cluster.

func NewUpdateClusterRequestFromReader added in v0.8.0

func NewUpdateClusterRequestFromReader(reader io.Reader) (*UpdateClusterRequest, error)

NewUpdateClusterRequestFromReader will create an UpdateClusterRequest from an io.Reader with JSON data.

type UtilityGroupVersions added in v0.36.0

type UtilityGroupVersions struct {
	PrometheusOperator  *HelmUtilityVersion
	Thanos              *HelmUtilityVersion
	Nginx               *HelmUtilityVersion
	NginxInternal       *HelmUtilityVersion
	Fluentbit           *HelmUtilityVersion
	Teleport            *HelmUtilityVersion
	Pgbouncer           *HelmUtilityVersion
	Promtail            *HelmUtilityVersion
	Rtcd                *HelmUtilityVersion
	NodeProblemDetector *HelmUtilityVersion
	MetricsServer       *HelmUtilityVersion
	Velero              *HelmUtilityVersion
	Cloudprober         *HelmUtilityVersion
}

UtilityGroupVersions holds the concrete metadata for any cluster utilities

func (*UtilityGroupVersions) AsMap added in v0.37.0

AsMap returns the UtilityGroupVersion represented as a map with the canonical names for each utility as the keys and the members of the struct making up the values

type UtilityMetadata added in v0.14.0

type UtilityMetadata struct {
	DesiredVersions UtilityGroupVersions
	ActualVersions  UtilityGroupVersions
}

UtilityMetadata is a container struct for any metadata related to cluster utilities that needs to be persisted in the database

func NewUtilityMetadata added in v0.20.0

func NewUtilityMetadata(metadataBytes []byte) (*UtilityMetadata, error)

NewUtilityMetadata creates an instance of UtilityMetadata given the raw utility metadata.

func UtilityMetadataFromReader added in v0.14.0

func UtilityMetadataFromReader(reader io.Reader) (*UtilityMetadata, error)

UtilityMetadataFromReader produces a UtilityMetadata object from the JSON representation embedded in a io.Reader

type Webhook added in v0.3.0

type Webhook struct {
	ID       string
	OwnerID  string
	URL      string
	CreateAt int64
	DeleteAt int64
	Headers  Headers
}

Webhook is

func WebhookFromReader added in v0.3.0

func WebhookFromReader(reader io.Reader) (*Webhook, error)

WebhookFromReader decodes a json-encoded webhook from the given io.Reader.

func WebhooksFromReader added in v0.3.0

func WebhooksFromReader(reader io.Reader) ([]*Webhook, error)

WebhooksFromReader decodes a json-encoded list of webhooks from the given io.Reader.

func (*Webhook) IsDeleted added in v0.3.0

func (w *Webhook) IsDeleted() bool

IsDeleted returns whether the webhook was marked as deleted or not.

type WebhookFilter added in v0.3.0

type WebhookFilter struct {
	Paging
	OwnerID string
}

WebhookFilter describes the parameters used to constrain a set of webhooks.

type WebhookHeader added in v0.71.0

type WebhookHeader struct {
	Key          string  `json:"key"`
	Value        *string `json:"value,omitempty"`
	ValueFromEnv *string `json:"value_from_env,omitempty"`
}

type WebhookPayload added in v0.3.0

type WebhookPayload struct {
	EventID   string            `json:"event_id"`
	Timestamp int64             `json:"timestamp"`
	ID        string            `json:"id"`
	Type      ResourceType      `json:"type"`
	NewState  string            `json:"new_state"`
	OldState  string            `json:"old_state"`
	ExtraData map[string]string `json:"extra_data,omitempty"`
}

WebhookPayload is the payload sent in every webhook.

func WebhookPayloadFromReader added in v0.3.0

func WebhookPayloadFromReader(reader io.Reader) (*WebhookPayload, error)

WebhookPayloadFromReader decodes a json-encoded webhook payload from the given io.Reader.

func (*WebhookPayload) ToJSON added in v0.3.0

func (p *WebhookPayload) ToJSON() (string, error)

ToJSON returns a JSON string representation of the webhook payload.

Jump to

Keyboard shortcuts

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