Documentation ¶
Index ¶
- Constants
- Variables
- func CheckProvider(provider string) (string, error)
- func ClusterInstallationConfigFromReader(reader io.Reader) (map[string]interface{}, error)
- func ContainsAnnotation(annotations []*Annotation, annotation *Annotation) bool
- func InstallationsCountFromReader(reader io.Reader) (int, error)
- func IsSupportedAffinity(affinity string) bool
- func IsSupportedDatabase(database string) bool
- func IsSupportedFilestore(filestore string) bool
- func IsValidExecCommand(command string) bool
- func NewID() string
- func ValidClusterVersion(name string) bool
- type AWSMetadata
- type AddAnnotationsRequest
- type Annotation
- type AnnotationsFilter
- type CIMigrationDatabase
- type Client
- func (c *Client) AddClusterAnnotations(clusterID string, annotationsRequest *AddAnnotationsRequest) (*ClusterDTO, error)
- func (c *Client) AddInstallationAnnotations(installationID string, annotationsRequest *AddAnnotationsRequest) (*InstallationDTO, error)
- func (c *Client) CreateCluster(request *CreateClusterRequest) (*ClusterDTO, error)
- func (c *Client) CreateGroup(request *CreateGroupRequest) (*Group, error)
- func (c *Client) CreateInstallation(request *CreateInstallationRequest) (*InstallationDTO, error)
- func (c *Client) CreateWebhook(request *CreateWebhookRequest) (*Webhook, error)
- func (c *Client) DeleteCluster(clusterID string) error
- func (c *Client) DeleteClusterAnnotation(clusterID string, annotationName string) error
- func (c *Client) DeleteGroup(groupID string) error
- func (c *Client) DeleteInstallation(installationID string) error
- func (c *Client) DeleteInstallationAnnotation(installationID string, annotationName string) error
- func (c *Client) DeleteWebhook(webhookID string) error
- func (c *Client) ExecClusterInstallationCLI(clusterInstallationID, command string, subcommand []string) ([]byte, error)
- func (c *Client) GetCluster(clusterID string) (*ClusterDTO, error)
- func (c *Client) GetClusterInstallation(clusterInstallationID string) (*ClusterInstallation, error)
- func (c *Client) GetClusterInstallationConfig(clusterInstallationID string) (map[string]interface{}, error)
- func (c *Client) GetClusterInstallations(request *GetClusterInstallationsRequest) ([]*ClusterInstallation, error)
- func (c *Client) GetClusterUtilities(clusterID string) (*UtilityMetadata, error)
- func (c *Client) GetClusters(request *GetClustersRequest) ([]*ClusterDTO, error)
- func (c *Client) GetGroup(groupID string) (*Group, error)
- func (c *Client) GetGroupStatus(groupID string) (*GroupStatus, error)
- func (c *Client) GetGroups(request *GetGroupsRequest) ([]*Group, error)
- func (c *Client) GetInstallation(installationID string, request *GetInstallationRequest) (*InstallationDTO, error)
- func (c *Client) GetInstallationByDNS(DNS string, request *GetInstallationRequest) (*InstallationDTO, error)
- func (c *Client) GetInstallations(request *GetInstallationsRequest) ([]*InstallationDTO, error)
- func (c *Client) GetInstallationsCount(includeDeleted bool) (int, error)
- func (c *Client) GetMultitenantDatabases(request *GetDatabasesRequest) ([]*MultitenantDatabase, error)
- func (c *Client) GetWebhook(webhookID string) (*Webhook, error)
- func (c *Client) GetWebhooks(request *GetWebhooksRequest) ([]*Webhook, error)
- func (c *Client) HibernateInstallation(installationID string) (*InstallationDTO, error)
- func (c *Client) JoinGroup(groupID, installationID string) error
- func (c *Client) LeaveGroup(installationID string, request *LeaveGroupRequest) error
- func (c *Client) LockAPIForCluster(clusterID string) error
- func (c *Client) LockAPIForClusterInstallation(clusterID string) error
- func (c *Client) LockAPIForGroup(groupID string) error
- func (c *Client) LockAPIForInstallation(installationID string) error
- func (c *Client) ProvisionCluster(clusterID string, request *ProvisionClusterRequest) (*ClusterDTO, error)
- func (c *Client) ResizeCluster(clusterID string, request *PatchClusterSizeRequest) (*ClusterDTO, error)
- func (c *Client) RetryCreateCluster(clusterID string) error
- func (c *Client) RetryCreateInstallation(installationID string) error
- func (c *Client) RunMattermostCLICommandOnClusterInstallation(clusterInstallationID string, subcommand []string) ([]byte, error)
- func (c *Client) SetClusterInstallationConfig(clusterInstallationID string, config map[string]interface{}) error
- func (c *Client) UnlockAPIForCluster(clusterID string) error
- func (c *Client) UnlockAPIForClusterInstallation(clusterID string) error
- func (c *Client) UnlockAPIForGroup(groupID string) error
- func (c *Client) UnlockAPIForInstallation(installationID string) error
- func (c *Client) UpdateCluster(clusterID string, request *UpdateClusterRequest) (*ClusterDTO, error)
- func (c *Client) UpdateGroup(request *PatchGroupRequest) (*Group, error)
- func (c *Client) UpdateInstallation(installationID string, request *PatchInstallationRequest) (*InstallationDTO, error)
- func (c *Client) UpgradeCluster(clusterID string, request *PatchUpgradeClusterRequest) (*ClusterDTO, error)
- func (c *Client) WakeupInstallation(installationID string) (*InstallationDTO, error)
- type Cluster
- func (c *Cluster) ActualUtilityVersion(utility string) (string, error)
- func (c *Cluster) Clone() *Cluster
- func (c *Cluster) DesiredUtilityVersion(utility string) (string, error)
- func (c *Cluster) SetUtilityActualVersion(utility string, version string) error
- func (c *Cluster) SetUtilityDesiredVersions(versions map[string]string) error
- func (c *Cluster) ToDTO(annotations []*Annotation) *ClusterDTO
- func (c *Cluster) ValidTransitionState(newState string) bool
- type ClusterDTO
- type ClusterFilter
- type ClusterInstallation
- type ClusterInstallationConfigRequest
- type ClusterInstallationExecSubcommand
- type ClusterInstallationFilter
- type ClusterInstallationMattermostCLISubcommand
- type ClusterStateReport
- type CreateClusterRequest
- type CreateGroupRequest
- type CreateInstallationRequest
- type CreateWebhookRequest
- type Database
- type EnvVar
- type EnvVarMap
- type Filestore
- type GetClusterInstallationsRequest
- type GetClustersRequest
- type GetDatabasesRequest
- type GetGroupsRequest
- type GetInstallationRequest
- type GetInstallationsRequest
- type GetWebhooksRequest
- type Group
- type GroupFilter
- type GroupStatus
- type Installation
- func (i *Installation) Clone() *Installation
- func (i *Installation) ConfigMergedWithGroup() bool
- func (i *Installation) InstallationSequenceMatchesMergedGroupSequence() bool
- func (i *Installation) InternalDatabase() bool
- func (i *Installation) InternalFilestore() bool
- func (i *Installation) IsInGroup() bool
- func (i *Installation) MergeWithGroup(group *Group, includeOverrides bool)
- func (i *Installation) SyncGroupAndInstallationSequence()
- func (i *Installation) ToDTO(annotations []*Annotation) *InstallationDTO
- func (i *Installation) ValidTransitionState(newState string) bool
- type InstallationDTO
- type InstallationDatabaseStoreInterface
- type InstallationFilter
- type InstallationStateReport
- type InstallationsCount
- type KopsMetadata
- type KopsMetadataRequestedState
- type LeaveGroupRequest
- type MinioOperatorFilestore
- func (f *MinioOperatorFilestore) GenerateFilestoreSpecAndSecret(store InstallationDatabaseStoreInterface, logger log.FieldLogger) (*mmv1alpha1.Minio, *corev1.Secret, error)
- func (f *MinioOperatorFilestore) Provision(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error
- func (f *MinioOperatorFilestore) Teardown(keepData bool, store InstallationDatabaseStoreInterface, ...) error
- type MultitenantDatabase
- type MultitenantDatabaseFilter
- type MultitenantDatabaseInstallations
- type MysqlOperatorDatabase
- func (d *MysqlOperatorDatabase) GenerateDatabaseSpecAndSecret(store InstallationDatabaseStoreInterface, logger log.FieldLogger) (*mmv1alpha1.Database, *corev1.Secret, error)
- func (d *MysqlOperatorDatabase) Provision(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error
- func (d *MysqlOperatorDatabase) Snapshot(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error
- func (d *MysqlOperatorDatabase) Teardown(store InstallationDatabaseStoreInterface, keepData bool, ...) error
- type PatchClusterSizeRequest
- type PatchGroupRequest
- type PatchInstallationRequest
- type PatchUpgradeClusterRequest
- type ProvisionClusterRequest
- type StateList
- type StateReportEntry
- type UpdateClusterRequest
- type UtilityMetadata
- type Webhook
- type WebhookFilter
- type WebhookPayload
Constants ¶
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" )
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" )
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" // ClusterInstallationStateStable is a cluster installation in a stable state and undergoing no changes. ClusterInstallationStateStable = "stable" )
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" // 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" // 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" )
const ( // PrometheusCanonicalName is the canonical string representation of prometheus PrometheusCanonicalName = "prometheus" // 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" // FluentbitCanonicalName is the canonical string representation of fluentbit FluentbitCanonicalName = "fluentbit" // TeleportCanonicalName is the canonical string representation of teleport TeleportCanonicalName = "teleport" )
const ( // PrometheusDefaultVersion defines the default version for the Helm chart PrometheusDefaultVersion = "10.4.0" // PrometheusOperatorDefaultVersion defines the default version for the Helm chart PrometheusOperatorDefaultVersion = "9.4.4" // ThanosDefaultVersion defines the default version for the Helm chart ThanosDefaultVersion = "2.4.3" // NginxDefaultVersion defines the default version for the Helm chart NginxDefaultVersion = "2.15.0" // FluentbitDefaultVersion defines the default version for the Helm chart FluentbitDefaultVersion = "2.8.7" // TeleportDefaultVersion defines the default version for the Helm chart TeleportDefaultVersion = "0.3.0" )
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 )
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" // DatabaseEngineTypeMySQL is a MySQL database. DatabaseEngineTypeMySQL = "mysql" // DatabaseEngineTypePostgres is a PostgreSQL database. DatabaseEngineTypePostgres = "postgres" )
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" )
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" // 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" // InstallationStateDeletionRequested is an installation to be deleted. 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" )
const ( // TypeCluster is the string value that represents a cluster. TypeCluster = "cluster" // TypeInstallation is the string value that represents an installation. TypeInstallation = "installation" // TypeClusterInstallation is the string value that represents a cluster // installation. TypeClusterInstallation = "cluster_installaton" )
const ( // InstallationDefaultSize is the default size for an installation. InstallationDefaultSize = mmv1alpha1.Size100String )
const (
// ProviderAWS is the cloud provider AWS.
ProviderAWS = "aws"
)
Variables ¶
var AllClusterInstallationStates = []string{ ClusterInstallationStateCreationRequested, ClusterInstallationStateCreationFailed, ClusterInstallationStateDeletionRequested, ClusterInstallationStateDeletionFailed, ClusterInstallationStateDeleted, ClusterInstallationStateReconciling, ClusterInstallationStateStable, }
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.
var AllClusterInstallationStatesPendingWork = []string{ ClusterInstallationStateCreationRequested, ClusterInstallationStateReconciling, ClusterInstallationStateDeletionRequested, }
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.
var AllClusterRequestStates = []string{ ClusterStateCreationRequested, ClusterStateProvisioningRequested, ClusterStateUpgradeRequested, ClusterStateResizeRequested, ClusterStateDeletionRequested, }
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.
var AllClusterStates = []string{ ClusterStateStable, ClusterStateRefreshMetadata, ClusterStateCreationRequested, ClusterStateCreationFailed, ClusterStateProvisioningRequested, ClusterStateProvisioningFailed, ClusterStateUpgradeRequested, ClusterStateUpgradeFailed, ClusterStateResizeRequested, ClusterStateResizeFailed, ClusterStateDeletionRequested, ClusterStateDeletionFailed, ClusterStateDeleted, }
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.
var AllClusterStatesPendingWork = []string{ ClusterStateCreationRequested, ClusterStateProvisioningRequested, ClusterStateRefreshMetadata, ClusterStateUpgradeRequested, ClusterStateResizeRequested, ClusterStateDeletionRequested, }
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.
var AllInstallationRequestStates = []string{ InstallationStateCreationRequested, InstallationStateHibernationRequested, InstallationStateUpdateRequested, InstallationStateDeletionRequested, }
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.
var AllInstallationStates = []string{ InstallationStateStable, InstallationStateCreationRequested, InstallationStateCreationPreProvisioning, InstallationStateCreationInProgress, InstallationStateCreationDNS, InstallationStateCreationFailed, InstallationStateCreationNoCompatibleClusters, InstallationStateCreationFinalTasks, InstallationStateHibernationRequested, InstallationStateHibernationInProgress, InstallationStateHibernating, InstallationStateUpdateRequested, InstallationStateUpdateInProgress, InstallationStateUpdateFailed, InstallationStateDeletionRequested, InstallationStateDeletionInProgress, InstallationStateDeletionFinalCleanup, InstallationStateDeletionFailed, InstallationStateDeleted, }
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.
var AllInstallationStatesPendingWork = []string{ InstallationStateCreationRequested, InstallationStateCreationPreProvisioning, InstallationStateCreationInProgress, InstallationStateCreationNoCompatibleClusters, InstallationStateCreationFinalTasks, InstallationStateCreationDNS, InstallationStateHibernationRequested, InstallationStateHibernationInProgress, InstallationStateUpdateRequested, InstallationStateUpdateInProgress, InstallationStateDeletionRequested, InstallationStateDeletionInProgress, InstallationStateDeletionFinalCleanup, }
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.
var BuildHash string
BuildHash holds the git commit hash when we build the server
Functions ¶
func CheckProvider ¶
CheckProvider normalizes the given provider, returning an error if invalid.
func ClusterInstallationConfigFromReader ¶
ClusterInstallationConfigFromReader decodes a json-encoded config from the config io.Reader.
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 InstallationsCountFromReader ¶ added in v0.26.0
InstallationsCountFromReader decodes a json-encoded installations count data from the given io.Reader
func IsSupportedAffinity ¶
IsSupportedAffinity returns true if the given affinity string is supported.
func IsSupportedDatabase ¶ added in v0.7.0
IsSupportedDatabase returns true if the given database string is supported.
func IsSupportedFilestore ¶ added in v0.7.0
IsSupportedFilestore returns true if the given filestore string is supported.
func IsValidExecCommand ¶ added in v0.27.0
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 ValidClusterVersion ¶ added in v0.9.0
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 Annotation ¶ added in v0.31.0
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 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 Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the programmatic interface to the provisioning server API.
func NewClientWithHeaders ¶ added in v0.7.0
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) 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) 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) (*Group, 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) 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 ¶
DeleteCluster deletes the given cluster and all resources contained therein.
func (*Client) DeleteClusterAnnotation ¶ added in v0.31.0
DeleteClusterAnnotation deletes annotation from the given cluster.
func (*Client) DeleteGroup ¶
DeleteGroup deletes the given group and all resources contained therein.
func (*Client) DeleteInstallation ¶
DeleteInstallation deletes the given installation and all resources contained therein.
func (*Client) DeleteInstallationAnnotation ¶ added in v0.31.0
DeleteInstallationAnnotation deletes annotation from the given installation.
func (*Client) DeleteWebhook ¶ added in v0.3.0
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) 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) GetGroup ¶
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) ([]*Group, error)
GetGroups fetches the list of groups from the configured provisioning server.
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) 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) 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
GetInstallationsCount returns then number of installations filtered by deleted field
func (*Client) GetMultitenantDatabases ¶ added in v0.25.0
func (c *Client) GetMultitenantDatabases(request *GetDatabasesRequest) ([]*MultitenantDatabase, error)
GetMultitenantDatabases fetches the list of multitenant databases from the configured provisioning server.
func (*Client) GetWebhook ¶ added in v0.3.0
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 ¶
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) LockAPIForCluster ¶ added in v0.25.0
LockAPIForCluster locks API changes for a given cluster.
func (*Client) LockAPIForClusterInstallation ¶ added in v0.25.0
LockAPIForClusterInstallation locks API changes for a given cluster installation.
func (*Client) LockAPIForGroup ¶ added in v0.25.0
LockAPIForGroup locks API changes for a given group.
func (*Client) LockAPIForInstallation ¶ added in v0.25.0
LockAPIForInstallation locks API changes for a given installation.
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) RetryCreateCluster ¶
RetryCreateCluster retries the creation of a cluster from the configured provisioning server.
func (*Client) RetryCreateInstallation ¶
RetryCreateInstallation retries the creation of a installation 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) UnlockAPIForCluster ¶ added in v0.25.0
UnlockAPIForCluster unlocks API changes for a given cluster.
func (*Client) UnlockAPIForClusterInstallation ¶ added in v0.25.0
UnlockAPIForClusterInstallation unlocks API changes for a given cluster installation.
func (*Client) UnlockAPIForGroup ¶ added in v0.25.0
UnlockAPIForGroup unlocks API changes for a given group.
func (*Client) UnlockAPIForInstallation ¶ added in v0.25.0
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) (*Group, 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) 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) (*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 UtilityMetadata *UtilityMetadata AllowInstallations bool CreateAt int64 DeleteAt int64 APISecurityLock bool LockAcquiredBy *string LockAcquiredAt int64 }
Cluster represents a Kubernetes cluster.
func ClusterFromReader ¶
ClusterFromReader decodes a json-encoded cluster from the given io.Reader.
func ClustersFromReader ¶
ClustersFromReader decodes a json-encoded list of clusters from the given io.Reader.
func (*Cluster) ActualUtilityVersion ¶ added in v0.14.0
ActualUtilityVersion fetches the desired version of a utility from the Cluster object
func (*Cluster) DesiredUtilityVersion ¶ added in v0.14.0
DesiredUtilityVersion fetches the desired version of a utility from the Cluster object
func (*Cluster) SetUtilityActualVersion ¶ added in v0.14.0
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
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
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.
func ClusterDTOFromReader ¶ added in v0.31.0
func ClusterDTOFromReader(reader io.Reader) (*ClusterDTO, error)
ClusterDTOFromReader decodes a json-encoded cluster DTO from the given io.Reader.
func ClusterDTOsFromReader ¶ added in v0.31.0
func ClusterDTOsFromReader(reader io.Reader) ([]*ClusterDTO, error)
ClusterDTOsFromReader decodes a json-encoded list of cluster DTOs from the given io.Reader.
type ClusterFilter ¶
type ClusterFilter struct { Page int PerPage int IncludeDeleted bool 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 }
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 ¶
func (c *ClusterInstallation) Clone() *ClusterInstallation
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 { IDs []string InstallationID string ClusterID string Page int PerPage int IncludeDeleted 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 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 CreateClusterRequest ¶
type CreateClusterRequest struct { Provider string `json:"provider,omitempty"` Zones []string `json:"zones,omitempty"` Version string `json:"version,omitempty"` KopsAMI string `json:"kops-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]string `json:"utility-versions,omitempty"` Annotations []string `json:"annotations,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 }
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) SetDefaults ¶ added in v0.18.0
func (request *CreateGroupRequest) SetDefaults()
SetDefaults sets the default values for a group create request.
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 { OwnerID string GroupID string Version string Image string DNS string License string Size string Affinity string Database string Filestore string APISecurityLock bool MattermostEnv EnvVarMap Annotations []string }
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 CreateWebhookRequest ¶ added in v0.3.0
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
type Database interface { Provision(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error Teardown(store InstallationDatabaseStoreInterface, keepData bool, logger log.FieldLogger) error Snapshot(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error GenerateDatabaseSpecAndSecret(store InstallationDatabaseStoreInterface, logger log.FieldLogger) (*mmv1alpha1.Database, *corev1.Secret, error) }
Database is the interface for managing Mattermost databases.
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.
type EnvVarMap ¶ added in v0.16.0
EnvVarMap is a map of multiple env var names to their values.
func EnvVarFromJSON ¶ added in v0.17.0
EnvVarFromJSON creates a EnvVarMap from the JSON represented as a []byte.
func (*EnvVarMap) ClearOrPatch ¶ added in v0.20.0
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
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.
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) (*mmv1alpha1.Minio, *corev1.Secret, error) }
Filestore is the interface for managing Mattermost filestores.
type GetClusterInstallationsRequest ¶
type GetClusterInstallationsRequest struct { ClusterID string InstallationID string Page int PerPage int IncludeDeleted bool }
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 ¶
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 GetDatabasesRequest ¶ added in v0.25.0
GetDatabasesRequest describes the parameters to request a list of multitenant databases.
func (*GetDatabasesRequest) ApplyToURL ¶ added in v0.25.0
func (request *GetDatabasesRequest) ApplyToURL(u *url.URL)
ApplyToURL modifies the given url to include query string parameters for the request.
type GetGroupsRequest ¶
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 GetInstallationRequest ¶ added in v0.17.0
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 { OwnerID string GroupID string IncludeGroupConfig bool IncludeGroupConfigOverrides bool Page int PerPage int IncludeDeleted bool DNS string }
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 GetWebhooksRequest ¶ added in v0.3.0
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 ¶
GroupFromReader decodes a json-encoded group from the given io.Reader.
func GroupsFromReader ¶
GroupsFromReader decodes a json-encoded list of groups from the given io.Reader.
type GroupFilter ¶
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 InstallationsUnstable 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 Installation ¶
type Installation struct { ID string OwnerID string GroupID *string GroupSequence *int64 `json:"GroupSequence,omitempty"` Version string Image string DNS string Database string Filestore string License string MattermostEnv EnvVarMap Size string Affinity string State string CreateAt int64 DeleteAt int64 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) 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) 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) *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 InstallationDTO ¶ added in v0.31.0
type InstallationDTO struct { *Installation Annotations []*Annotation `json:"Annotations,omitempty"` }
InstallationDTO represents a Mattermost installation. DTO stands for Data Transfer Object.
func InstallationDTOFromReader ¶ added in v0.31.0
func InstallationDTOFromReader(reader io.Reader) (*InstallationDTO, error)
InstallationDTOFromReader decodes a json-encoded installation DTO from the given io.Reader.
func InstallationDTOsFromReader ¶ added in v0.31.0
func InstallationDTOsFromReader(reader io.Reader) ([]*InstallationDTO, error)
InstallationDTOsFromReader decodes a json-encoded list of installation DTOs from the given io.Reader.
type InstallationDatabaseStoreInterface ¶ added in v0.10.0
type InstallationDatabaseStoreInterface interface { GetClusterInstallations(filter *ClusterInstallationFilter) ([]*ClusterInstallation, error) GetMultitenantDatabase(multitenantdatabaseID string) (*MultitenantDatabase, error) GetMultitenantDatabases(filter *MultitenantDatabaseFilter) ([]*MultitenantDatabase, error) GetMultitenantDatabaseForInstallationID(installationID string) (*MultitenantDatabase, error) CreateMultitenantDatabase(multitenantDatabase *MultitenantDatabase) error UpdateMultitenantDatabase(multitenantDatabase *MultitenantDatabase) error LockMultitenantDatabase(multitenantdatabaseID, lockerID string) (bool, error) UnlockMultitenantDatabase(multitenantdatabaseID, lockerID string, force bool) (bool, 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 { OwnerID string GroupID string Page int PerPage int IncludeDeleted bool DNS 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 int
}
InstallationsCount represents the number of installations
type KopsMetadata ¶
type KopsMetadata struct { Name string Version string AMI string MasterInstanceType string MasterCount int64 NodeInstanceType string NodeMinCount int64 NodeMaxCount int64 ChangeRequest *KopsMetadataRequestedState `json:"ChangeRequest,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) ClearChangeRequest ¶ added in v0.21.0
func (km *KopsMetadata) ClearChangeRequest()
ClearChangeRequest clears the kops metadata change request.
func (*KopsMetadata) ClearWarnings ¶ added in v0.21.0
func (km *KopsMetadata) ClearWarnings()
ClearWarnings clears the kops metadata warnings.
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"` }
KopsMetadataRequestedState is the requested state for kops metadata.
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 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) (*mmv1alpha1.Minio, *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
func (f *MinioOperatorFilestore) Provision(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error
Provision completes all the steps necessary to provision a MinIO operator filestore.
func (*MinioOperatorFilestore) Teardown ¶ added in v0.7.0
func (f *MinioOperatorFilestore) Teardown(keepData bool, store InstallationDatabaseStoreInterface, logger log.FieldLogger) error
Teardown removes all MinIO operator resources related to a given installation.
type MultitenantDatabase ¶ added in v0.19.0
type MultitenantDatabase struct { ID string VpcID string DatabaseType string Installations MultitenantDatabaseInstallations CreateAt int64 DeleteAt int64 LockAcquiredBy *string LockAcquiredAt int64 }
MultitenantDatabase represents database infrastructure that contains multiple installation databases.
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.
type MultitenantDatabaseFilter ¶ added in v0.19.0
type MultitenantDatabaseFilter struct { LockerID string InstallationID string VpcID string DatabaseType string MaxInstallationsLimit int Page int PerPage int }
MultitenantDatabaseFilter filters results based on a specific installation ID, Vpc ID and a number of installation's limit.
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
func (i *MultitenantDatabaseInstallations) Count() int
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) GenerateDatabaseSpecAndSecret ¶ added in v0.8.0
func (d *MysqlOperatorDatabase) GenerateDatabaseSpecAndSecret(store InstallationDatabaseStoreInterface, logger log.FieldLogger) (*mmv1alpha1.Database, *corev1.Secret, error)
GenerateDatabaseSpecAndSecret creates the k8s database spec and secret for accessing the MySQL operator database.
func (*MysqlOperatorDatabase) Provision ¶ added in v0.8.0
func (d *MysqlOperatorDatabase) Provision(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error
Provision completes all the steps necessary to provision a MySQL operator database.
func (*MysqlOperatorDatabase) Snapshot ¶ added in v0.17.0
func (d *MysqlOperatorDatabase) Snapshot(store InstallationDatabaseStoreInterface, logger log.FieldLogger) error
Snapshot is not supported by the operator and it should return an error.
func (*MysqlOperatorDatabase) Teardown ¶ added in v0.8.0
func (d *MysqlOperatorDatabase) Teardown(store InstallationDatabaseStoreInterface, keepData bool, logger log.FieldLogger) error
Teardown removes all MySQL operator resources for a given installation.
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"` }
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) Apply ¶ added in v0.21.0
func (p *PatchClusterSizeRequest) Apply(metadata *KopsMetadata) bool
Apply applies the patch to the given cluster's kops metadata.
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 }
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 PatchInstallationRequest ¶ added in v0.19.0
type PatchInstallationRequest struct { Version *string Image *string Size *string License *string 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 PatchUpgradeClusterRequest ¶ added in v0.20.0
type PatchUpgradeClusterRequest struct { Version *string `json:"version,omitempty"` KopsAMI *string `json:"kops-ami,omitempty"` }
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) Apply ¶ added in v0.20.0
func (p *PatchUpgradeClusterRequest) Apply(metadata *KopsMetadata) bool
Apply applies the patch to the given cluster's metadata.
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]string `json:"utility-versions,omitempty"`
}
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 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 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 UtilityMetadata ¶ added in v0.14.0
type UtilityMetadata struct { DesiredVersions utilityVersions ActualVersions utilityVersions }
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
Webhook is
func WebhookFromReader ¶ added in v0.3.0
WebhookFromReader decodes a json-encoded webhook from the given io.Reader.
func WebhooksFromReader ¶ added in v0.3.0
WebhooksFromReader decodes a json-encoded list of webhooks from the given io.Reader.
type WebhookFilter ¶ added in v0.3.0
WebhookFilter describes the parameters used to constrain a set of webhooks.
type WebhookPayload ¶ added in v0.3.0
type WebhookPayload struct { Timestamp int64 `json:"timestamp"` ID string `json:"id"` Type string `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.
Source Files ¶
- affinity.go
- annotation.go
- aws_metadata.go
- client.go
- cluster.go
- cluster_dto.go
- cluster_installation.go
- cluster_installation_migration_database.go
- cluster_installation_request.go
- cluster_installation_states.go
- cluster_request.go
- cluster_states.go
- cluster_utility.go
- env.go
- exec.go
- general.go
- group.go
- group_request.go
- group_status.go
- id.go
- installation.go
- installation_database.go
- installation_dto.go
- installation_filestore.go
- installation_request.go
- installation_states.go
- kops_metadata.go
- multitenant_database.go
- multitenant_database_request.go
- provider.go
- version.go
- webhook.go
- webhook_request.go