Documentation ¶
Index ¶
- Variables
- func CloseConnection(tb testing.TB, sqlStore *SQLStore)
- func LatestVersion() semver.Version
- type GroupRollingMetadata
- type RawClusterMetadata
- type SQLStore
- func (sqlStore *SQLStore) AddInstallationDomain(installation *model.Installation, dnsRecord *model.InstallationDNS) error
- func (sqlStore *SQLStore) ClaimRetryingSubscription(instanceID string, cooldown time.Duration) (*model.Subscription, error)
- func (sqlStore *SQLStore) ClaimUpToDateSubscription(instanceID string) (*model.Subscription, error)
- func (sqlStore *SQLStore) CountSubscriptionsForEvent(eventType model.EventType) (int64, error)
- func (sqlStore *SQLStore) CreateAnnotation(annotation *model.Annotation) error
- func (sqlStore *SQLStore) CreateCluster(cluster *model.Cluster, annotations []*model.Annotation) error
- func (sqlStore *SQLStore) CreateClusterAnnotations(clusterID string, annotations []*model.Annotation) ([]*model.Annotation, error)
- func (sqlStore *SQLStore) CreateClusterInstallation(clusterInstallation *model.ClusterInstallation) error
- func (sqlStore *SQLStore) CreateDatabaseSchema(databaseSchema *model.DatabaseSchema) error
- func (sqlStore *SQLStore) CreateGroup(group *model.Group, annotations []*model.Annotation) error
- func (sqlStore *SQLStore) CreateGroupAnnotations(groupID string, annotations []*model.Annotation) ([]*model.Annotation, error)
- func (sqlStore *SQLStore) CreateInstallation(installation *model.Installation, annotations []*model.Annotation, ...) error
- func (sqlStore *SQLStore) CreateInstallationAnnotations(installationID string, annotations []*model.Annotation) ([]*model.Annotation, error)
- func (sqlStore *SQLStore) CreateInstallationBackup(backup *model.InstallationBackup) error
- func (sqlStore *SQLStore) CreateInstallationDBMigrationOperation(dbMigration *model.InstallationDBMigrationOperation) error
- func (sqlStore *SQLStore) CreateInstallationDBRestorationOperation(dbRestoration *model.InstallationDBRestorationOperation) error
- func (sqlStore *SQLStore) CreateLogicalDatabase(logicalDatabase *model.LogicalDatabase) error
- func (sqlStore *SQLStore) CreateMultitenantDatabase(multitenantDatabase *model.MultitenantDatabase) error
- func (sqlStore *SQLStore) CreateStateChangeEvent(event *model.StateChangeEventData) error
- func (sqlStore *SQLStore) CreateSubscription(sub *model.Subscription) error
- func (sqlStore *SQLStore) CreateWebhook(webhook *model.Webhook) error
- func (sqlStore *SQLStore) DeleteCluster(id string) error
- func (sqlStore *SQLStore) DeleteClusterAnnotation(clusterID string, annotationName string) error
- func (sqlStore *SQLStore) DeleteClusterInstallation(id string) error
- func (sqlStore *SQLStore) DeleteGroup(id string) error
- func (sqlStore *SQLStore) DeleteGroupAnnotation(groupID string, annotationName string) error
- func (sqlStore *SQLStore) DeleteInActiveClusterInstallationByClusterID(clusterID string) (int64, error)
- func (sqlStore *SQLStore) DeleteInstallation(id string) error
- func (sqlStore *SQLStore) DeleteInstallationAnnotation(installationID string, annotationName string) error
- func (sqlStore *SQLStore) DeleteInstallationBackup(id string) error
- func (sqlStore *SQLStore) DeleteInstallationDBMigrationOperation(id string) error
- func (sqlStore *SQLStore) DeleteInstallationDBRestorationOperation(id string) error
- func (sqlStore *SQLStore) DeleteInstallationDNS(installationID, dnsName string) error
- func (sqlStore *SQLStore) DeleteInstallationProxyDatabaseResources(multitenantDatabase *model.MultitenantDatabase, ...) error
- func (sqlStore *SQLStore) DeleteLogicalDatabase(id string) error
- func (sqlStore *SQLStore) DeleteMultitenantDatabase(multitenantDatabaseID string) error
- func (sqlStore *SQLStore) DeleteSubscription(id string) error
- func (sqlStore *SQLStore) DeleteWebhook(id string) error
- func (sqlStore *SQLStore) DeletionLockInstallation(installationID string) error
- func (sqlStore *SQLStore) DeletionUnlockInstallation(installationID string) error
- func (sqlStore *SQLStore) GetAnnotationByName(name string) (*model.Annotation, error)
- func (sqlStore *SQLStore) GetAnnotationsByName(names []string) ([]*model.Annotation, error)
- func (sqlStore *SQLStore) GetAnnotationsForCluster(clusterID string) ([]*model.Annotation, error)
- func (sqlStore *SQLStore) GetAnnotationsForClusters(filter *model.ClusterFilter) (map[string][]*model.Annotation, error)
- func (sqlStore *SQLStore) GetAnnotationsForInstallation(installationID string) ([]*model.Annotation, error)
- func (sqlStore *SQLStore) GetAnnotationsForInstallations(filter *model.InstallationFilter) (map[string][]*model.Annotation, error)
- func (sqlStore *SQLStore) GetCluster(id string) (*model.Cluster, error)
- func (sqlStore *SQLStore) GetClusterDTO(id string) (*model.ClusterDTO, error)
- func (sqlStore *SQLStore) GetClusterDTOs(filter *model.ClusterFilter) ([]*model.ClusterDTO, error)
- func (sqlStore *SQLStore) GetClusterInstallation(id string) (*model.ClusterInstallation, error)
- func (sqlStore *SQLStore) GetClusterInstallations(filter *model.ClusterInstallationFilter) ([]*model.ClusterInstallation, error)
- func (sqlStore *SQLStore) GetClusters(filter *model.ClusterFilter) ([]*model.Cluster, error)
- func (sqlStore *SQLStore) GetCurrentVersion() (semver.Version, error)
- func (sqlStore *SQLStore) GetDNSRecordsForInstallation(installationID string) ([]*model.InstallationDNS, error)
- func (sqlStore *SQLStore) GetDNSRecordsForInstallations(installationIDs []string) ([]*model.InstallationDNS, error)
- func (sqlStore *SQLStore) GetDatabaseSchema(id string) (*model.DatabaseSchema, error)
- func (sqlStore *SQLStore) GetDatabaseSchemaForInstallationID(installationID string) (*model.DatabaseSchema, error)
- func (sqlStore *SQLStore) GetDatabaseSchemas(filter *model.DatabaseSchemaFilter) ([]*model.DatabaseSchema, error)
- func (sqlStore *SQLStore) GetDeliveriesForSubscription(subID string) ([]*model.EventDelivery, error)
- func (sqlStore *SQLStore) GetGroup(id string) (*model.Group, error)
- func (sqlStore *SQLStore) GetGroupDTO(id string) (*model.GroupDTO, error)
- func (sqlStore *SQLStore) GetGroupDTOs(filter *model.GroupFilter) ([]*model.GroupDTO, error)
- func (sqlStore *SQLStore) GetGroupRollingMetadata(groupID string) (*GroupRollingMetadata, error)
- func (sqlStore *SQLStore) GetGroupStatus(groupID string) (*model.GroupStatus, error)
- func (sqlStore *SQLStore) GetGroups(filter *model.GroupFilter) ([]*model.Group, error)
- func (sqlStore *SQLStore) GetInstallation(id string, includeGroupConfig, includeGroupConfigOverrides bool) (*model.Installation, error)
- func (sqlStore *SQLStore) GetInstallationBackup(id string) (*model.InstallationBackup, error)
- func (sqlStore *SQLStore) GetInstallationBackups(filter *model.InstallationBackupFilter) ([]*model.InstallationBackup, error)
- func (sqlStore *SQLStore) GetInstallationDBMigrationOperation(id string) (*model.InstallationDBMigrationOperation, error)
- func (sqlStore *SQLStore) GetInstallationDBMigrationOperations(filter *model.InstallationDBMigrationFilter) ([]*model.InstallationDBMigrationOperation, error)
- func (sqlStore *SQLStore) GetInstallationDBRestorationOperation(id string) (*model.InstallationDBRestorationOperation, error)
- func (sqlStore *SQLStore) GetInstallationDBRestorationOperations(filter *model.InstallationDBRestorationFilter) ([]*model.InstallationDBRestorationOperation, error)
- func (sqlStore *SQLStore) GetInstallationDNS(id string) (*model.InstallationDNS, error)
- func (sqlStore *SQLStore) GetInstallationDTO(id string, includeGroupConfig, includeGroupConfigOverrides bool) (*model.InstallationDTO, error)
- func (sqlStore *SQLStore) GetInstallationDTOs(filter *model.InstallationFilter, ...) ([]*model.InstallationDTO, error)
- func (sqlStore *SQLStore) GetInstallations(filter *model.InstallationFilter, ...) ([]*model.Installation, error)
- func (sqlStore *SQLStore) GetInstallationsCount(filter *model.InstallationFilter) (int64, error)
- func (sqlStore *SQLStore) GetInstallationsStatus() (*model.InstallationsStatus, error)
- func (sqlStore *SQLStore) GetInstallationsTotalDatabaseWeight(installationIDs []string) (float64, error)
- func (sqlStore *SQLStore) GetLogicalDatabase(id string) (*model.LogicalDatabase, error)
- func (sqlStore *SQLStore) GetLogicalDatabases(filter *model.LogicalDatabaseFilter) ([]*model.LogicalDatabase, error)
- func (sqlStore *SQLStore) GetMultitenantDatabase(id string) (*model.MultitenantDatabase, error)
- func (sqlStore *SQLStore) GetMultitenantDatabaseForInstallationID(installationID string) (*model.MultitenantDatabase, error)
- func (sqlStore *SQLStore) GetMultitenantDatabases(filter *model.MultitenantDatabaseFilter) ([]*model.MultitenantDatabase, error)
- func (sqlStore *SQLStore) GetOrCreateAnnotations(annotations []*model.Annotation) ([]*model.Annotation, error)
- func (sqlStore *SQLStore) GetOrCreateProxyDatabaseResourcesForInstallation(installationID, multitenantDatabaseID string) (*model.DatabaseResourceGrouping, error)
- func (sqlStore *SQLStore) GetProxyDatabaseResourcesForInstallation(installationID string) (*model.DatabaseResourceGrouping, error)
- func (sqlStore *SQLStore) GetSingleTenantDatabaseConfigForInstallation(installationID string) (*model.SingleTenantDatabaseConfig, error)
- func (sqlStore *SQLStore) GetStateChangeEvent(eventID string) (*model.StateChangeEventData, error)
- func (sqlStore *SQLStore) GetStateChangeEvents(filter *model.StateChangeEventFilter) ([]*model.StateChangeEventData, error)
- func (sqlStore *SQLStore) GetStateChangeEventsToProcess(subID string) ([]*model.StateChangeEventDeliveryData, error)
- func (sqlStore *SQLStore) GetSubscription(subID string) (*model.Subscription, error)
- func (sqlStore *SQLStore) GetSubscriptions(filter *model.SubscriptionsFilter) ([]*model.Subscription, error)
- func (sqlStore *SQLStore) GetUnlockedClusterInstallationsPendingWork() ([]*model.ClusterInstallation, error)
- func (sqlStore *SQLStore) GetUnlockedClustersPendingWork() ([]*model.Cluster, error)
- func (sqlStore *SQLStore) GetUnlockedGroupsPendingWork() ([]*model.Group, error)
- func (sqlStore *SQLStore) GetUnlockedInstallationBackupPendingWork() ([]*model.InstallationBackup, error)
- func (sqlStore *SQLStore) GetUnlockedInstallationDBMigrationOperationsPendingWork() ([]*model.InstallationDBMigrationOperation, error)
- func (sqlStore *SQLStore) GetUnlockedInstallationDBRestorationOperationsPendingWork() ([]*model.InstallationDBRestorationOperation, error)
- func (sqlStore *SQLStore) GetUnlockedInstallationsPendingDeletion() ([]*model.Installation, error)
- func (sqlStore *SQLStore) GetUnlockedInstallationsPendingWork() ([]*model.Installation, error)
- func (sqlStore *SQLStore) GetWebhook(id string) (*model.Webhook, error)
- func (sqlStore *SQLStore) GetWebhooks(filter *model.WebhookFilter) ([]*model.Webhook, error)
- func (sqlStore *SQLStore) IsInstallationBackupBeingUsed(backupID string) (bool, error)
- func (sqlStore *SQLStore) IsInstallationBackupRunning(installationID string) (bool, error)
- func (sqlStore *SQLStore) LockCluster(clusterID, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockClusterAPI(clusterID string) error
- func (sqlStore *SQLStore) LockClusterInstallationAPI(id string) error
- func (sqlStore *SQLStore) LockClusterInstallations(clusterInstallationIDs []string, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockDatabaseSchema(databaseSchemaID, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockGroup(groupID, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockGroupAPI(id string) error
- func (sqlStore *SQLStore) LockInstallation(installationID, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockInstallationAPI(installationID string) error
- func (sqlStore *SQLStore) LockInstallationBackup(backupID, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockInstallationBackupAPI(backupID string) error
- func (sqlStore *SQLStore) LockInstallationBackups(backupIDs []string, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockInstallationDBMigrationOperation(id, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockInstallationDBMigrationOperations(ids []string, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockInstallationDBRestorationOperation(id, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockInstallationDBRestorationOperations(ids []string, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockInstallations(installationIDs []string, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockLogicalDatabase(logicalDatabaseID, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockMultitenantDatabase(multitenantDatabaseID, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockMultitenantDatabases(ids []string, lockerID string) (bool, error)
- func (sqlStore *SQLStore) Migrate() error
- func (sqlStore *SQLStore) MigrateClusterInstallations(clusterInstallations []*model.ClusterInstallation, targetCluster string) error
- func (sqlStore *SQLStore) RecoverClusterInstallation(clusterInstallation *model.ClusterInstallation) error
- func (sqlStore *SQLStore) RecoverInstallation(installation *model.Installation) error
- func (sqlStore *SQLStore) SwitchDNS(oldCIsIDs, newCIsIDs, installationIDs []string, ...) error
- func (sqlStore *SQLStore) SwitchPrimaryInstallationDomain(installationID string, installationDNSID string) error
- func (sqlStore *SQLStore) TriggerInstallationDBMigration(dbMigrationOp *model.InstallationDBMigrationOperation, ...) (*model.InstallationDBMigrationOperation, error)
- func (sqlStore *SQLStore) TriggerInstallationDBMigrationRollback(dbMigrationOp *model.InstallationDBMigrationOperation, ...) error
- func (sqlStore *SQLStore) TriggerInstallationRestoration(installation *model.Installation, backup *model.InstallationBackup) (*model.InstallationDBRestorationOperation, error)
- func (sqlStore *SQLStore) UnlockCluster(clusterID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockClusterAPI(clusterID string) error
- func (sqlStore *SQLStore) UnlockClusterInstallationAPI(id string) error
- func (sqlStore *SQLStore) UnlockClusterInstallations(clusterInstallationIDs []string, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockDatabaseSchema(databaseSchemaID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockGroup(groupID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockGroupAPI(id string) error
- func (sqlStore *SQLStore) UnlockInstallation(installationID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockInstallationAPI(installationID string) error
- func (sqlStore *SQLStore) UnlockInstallationBackup(backupID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockInstallationBackupAPI(backupID string) error
- func (sqlStore *SQLStore) UnlockInstallationBackups(backupIDs []string, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockInstallationDBMigrationOperation(id, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockInstallationDBMigrationOperations(ids []string, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockInstallationDBRestorationOperation(id, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockInstallationDBRestorationOperations(ids []string, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockInstallations(installationIDs []string, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockLogicalDatabase(logicalDatabaseID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockMultitenantDatabase(multitenantDatabaseID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockMultitenantDatabases(ids []string, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockSubscription(subID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UpdateCluster(cluster *model.Cluster) error
- func (sqlStore *SQLStore) UpdateClusterInstallation(clusterInstallation *model.ClusterInstallation) error
- func (sqlStore *SQLStore) UpdateClusterInstallationsActiveStatus(db execer, clusterInstallationIDs []string, isActive bool) error
- func (sqlStore *SQLStore) UpdateEventDeliveryStatus(delivery *model.EventDelivery) error
- func (sqlStore *SQLStore) UpdateGroup(group *model.Group, forceUpdateSequence bool) error
- func (sqlStore *SQLStore) UpdateInstallation(installation *model.Installation) error
- func (sqlStore *SQLStore) UpdateInstallationBackupSchedulingData(backup *model.InstallationBackup) error
- func (sqlStore *SQLStore) UpdateInstallationBackupStartTime(backup *model.InstallationBackup) error
- func (sqlStore *SQLStore) UpdateInstallationBackupState(backup *model.InstallationBackup) error
- func (sqlStore *SQLStore) UpdateInstallationCRVersion(installationID, crVersion string) error
- func (sqlStore *SQLStore) UpdateInstallationDBMigrationOperation(dbMigration *model.InstallationDBMigrationOperation) error
- func (sqlStore *SQLStore) UpdateInstallationDBMigrationOperationState(dbMigration *model.InstallationDBMigrationOperation) error
- func (sqlStore *SQLStore) UpdateInstallationDBRestorationOperation(dbRestoration *model.InstallationDBRestorationOperation) error
- func (sqlStore *SQLStore) UpdateInstallationDBRestorationOperationState(dbRestoration *model.InstallationDBRestorationOperation) error
- func (sqlStore *SQLStore) UpdateInstallationGroupSequence(installation *model.Installation) error
- func (sqlStore *SQLStore) UpdateInstallationState(installation *model.Installation) error
- func (sqlStore *SQLStore) UpdateInstallationsState(db execer, installationIDs []string, state string) error
- func (sqlStore *SQLStore) UpdateMultitenantDatabase(multitenantDatabase *model.MultitenantDatabase) error
- func (sqlStore *SQLStore) UpdateSubscriptionStatus(sub *model.Subscription) error
- type Transaction
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClusterAnnotationUsedByInstallation is an error returned when user attempts to delete cluster annotation // present on the installation scheduled on that cluster. ErrClusterAnnotationUsedByInstallation = errors.New("cannot delete cluster annotation, " + "it is used by one or more installations scheduled on the cluster") // ErrInstallationAnnotationDoNotMatchClusters is an error returned when user attempts to add annotation to the // installation, that is not present on any of the clusters on which the installation is scheduled. ErrInstallationAnnotationDoNotMatchClusters = errors.New("cannot add annotations to installation, " + "one or more clusters on which installation is scheduled do not contain one or more of new annotations") )
var ErrNoSubscriptionsToProcess error = fmt.Errorf("no subscriptions to process")
ErrNoSubscriptionsToProcess indicates that there is no subscription to claim.
Functions ¶
func CloseConnection ¶ added in v0.31.0
CloseConnection closes underlying database connection.
func LatestVersion ¶
LatestVersion returns the version to which the last migration migrates.
Types ¶
type GroupRollingMetadata ¶ added in v0.18.0
type GroupRollingMetadata struct { InstallationIDsToBeRolled []string InstallationsTotalCount int64 InstallationsRolling int64 }
GroupRollingMetadata is a batch of information about a group where installatons are being rolled to match a new config.
type RawClusterMetadata ¶ added in v0.20.0
type RawClusterMetadata struct { ProviderMetadataRaw []byte ProvisionerMetadataRaw []byte UtilityMetadataRaw []byte }
RawClusterMetadata is the raw byte metadata for a cluster.
type SQLStore ¶
type SQLStore struct {
// contains filtered or unexported fields
}
SQLStore abstracts access to the database.
func MakeTestSQLStore ¶
func MakeTestSQLStore(tb testing.TB, logger log.FieldLogger) *SQLStore
MakeTestSQLStore creates a SQLStore for use with unit tests.
func New ¶
func New(dsn string, logger logrus.FieldLogger) (*SQLStore, error)
New constructs a new instance of SQLStore.
func (*SQLStore) AddInstallationDomain ¶ added in v0.57.0
func (sqlStore *SQLStore) AddInstallationDomain(installation *model.Installation, dnsRecord *model.InstallationDNS) error
AddInstallationDomain adds Installation domain name to the database.
func (*SQLStore) ClaimRetryingSubscription ¶ added in v0.50.0
func (sqlStore *SQLStore) ClaimRetryingSubscription(instanceID string, cooldown time.Duration) (*model.Subscription, error)
ClaimRetryingSubscription fetches and locks first subscription which last delivery failed and has events to process.
func (*SQLStore) ClaimUpToDateSubscription ¶ added in v0.50.0
func (sqlStore *SQLStore) ClaimUpToDateSubscription(instanceID string) (*model.Subscription, error)
ClaimUpToDateSubscription fetches and locks first subscription which last delivery did not fail and has events to process.
func (*SQLStore) CountSubscriptionsForEvent ¶ added in v0.50.0
CountSubscriptionsForEvent count number of subscriptions for the specified event type.
func (*SQLStore) CreateAnnotation ¶ added in v0.31.0
func (sqlStore *SQLStore) CreateAnnotation(annotation *model.Annotation) error
CreateAnnotation records the given annotation to the database, assigning it a unique ID.
func (*SQLStore) CreateCluster ¶
func (sqlStore *SQLStore) CreateCluster(cluster *model.Cluster, annotations []*model.Annotation) error
CreateCluster records the given cluster to the database, assigning it a unique ID.
func (*SQLStore) CreateClusterAnnotations ¶ added in v0.31.0
func (sqlStore *SQLStore) CreateClusterAnnotations(clusterID string, annotations []*model.Annotation) ([]*model.Annotation, error)
CreateClusterAnnotations maps selected annotations to cluster and stores it in the database.
func (*SQLStore) CreateClusterInstallation ¶
func (sqlStore *SQLStore) CreateClusterInstallation(clusterInstallation *model.ClusterInstallation) error
CreateClusterInstallation records the given cluster installation to the database, assigning it a unique ID.
func (*SQLStore) CreateDatabaseSchema ¶ added in v0.47.0
func (sqlStore *SQLStore) CreateDatabaseSchema(databaseSchema *model.DatabaseSchema) error
CreateDatabaseSchema records the supplied database schema to the datastore.
func (*SQLStore) CreateGroup ¶
CreateGroup records the given group to the database, assigning it a unique ID.
func (*SQLStore) CreateGroupAnnotations ¶ added in v0.55.0
func (sqlStore *SQLStore) CreateGroupAnnotations(groupID string, annotations []*model.Annotation) ([]*model.Annotation, error)
CreateGroupAnnotations maps selected annotations to group and stores it in the database.
func (*SQLStore) CreateInstallation ¶
func (sqlStore *SQLStore) CreateInstallation(installation *model.Installation, annotations []*model.Annotation, dnsRecords []*model.InstallationDNS) error
CreateInstallation records the given installation to the database, assigning it a unique ID.
func (*SQLStore) CreateInstallationAnnotations ¶ added in v0.31.0
func (sqlStore *SQLStore) CreateInstallationAnnotations(installationID string, annotations []*model.Annotation) ([]*model.Annotation, error)
CreateInstallationAnnotations maps selected annotations to installation and stores it in the database. Annotation cannot be added to the Installation if any of the clusters on which the Installation is scheduled is not annotated with it.
func (*SQLStore) CreateInstallationBackup ¶ added in v0.43.0
func (sqlStore *SQLStore) CreateInstallationBackup(backup *model.InstallationBackup) error
CreateInstallationBackup records installation backup to the database, assigning it a unique ID.
func (*SQLStore) CreateInstallationDBMigrationOperation ¶ added in v0.45.0
func (sqlStore *SQLStore) CreateInstallationDBMigrationOperation(dbMigration *model.InstallationDBMigrationOperation) error
CreateInstallationDBMigrationOperation records installation db migration to the database, assigning it a unique ID.
func (*SQLStore) CreateInstallationDBRestorationOperation ¶ added in v0.45.0
func (sqlStore *SQLStore) CreateInstallationDBRestorationOperation(dbRestoration *model.InstallationDBRestorationOperation) error
CreateInstallationDBRestorationOperation records installation db restoration to the database, assigning it a unique ID.
func (*SQLStore) CreateLogicalDatabase ¶ added in v0.47.0
func (sqlStore *SQLStore) CreateLogicalDatabase(logicalDatabase *model.LogicalDatabase) error
CreateLogicalDatabase records the supplied logical database to the datastore.
func (*SQLStore) CreateMultitenantDatabase ¶ added in v0.19.0
func (sqlStore *SQLStore) CreateMultitenantDatabase(multitenantDatabase *model.MultitenantDatabase) error
CreateMultitenantDatabase records the supplied multitenant database to the datastore.
func (*SQLStore) CreateStateChangeEvent ¶ added in v0.50.0
func (sqlStore *SQLStore) CreateStateChangeEvent(event *model.StateChangeEventData) error
CreateStateChangeEvent creates new StateChangeEvent and initializes EventDeliveries.
func (*SQLStore) CreateSubscription ¶ added in v0.50.0
func (sqlStore *SQLStore) CreateSubscription(sub *model.Subscription) error
CreateSubscription creates new subscription.
func (*SQLStore) CreateWebhook ¶ added in v0.3.0
CreateWebhook records the given webhook to the database, assigning it a unique ID.
func (*SQLStore) DeleteCluster ¶
DeleteCluster marks the given cluster as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteClusterAnnotation ¶ added in v0.31.0
DeleteClusterAnnotation removes an annotation from a given cluster. Annotation cannot be removed if it is present on any of the Installations scheduled on the cluster.
func (*SQLStore) DeleteClusterInstallation ¶
DeleteClusterInstallation marks the given cluster installation as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteGroup ¶
DeleteGroup marks the given group as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteGroupAnnotation ¶ added in v0.55.0
DeleteGroupAnnotation removes an annotation from a given group.
func (*SQLStore) DeleteInActiveClusterInstallationByClusterID ¶ added in v0.46.1
func (sqlStore *SQLStore) DeleteInActiveClusterInstallationByClusterID(clusterID string) (int64, error)
DeleteInActiveClusterInstallationByClusterID marks the inactive cluster installation as deleted for a given cluster, but does not remove the record from the database.
func (*SQLStore) DeleteInstallation ¶
DeleteInstallation marks the given installation as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteInstallationAnnotation ¶ added in v0.31.0
func (sqlStore *SQLStore) DeleteInstallationAnnotation(installationID string, annotationName string) error
DeleteInstallationAnnotation removes annotation from a given Installation.
func (*SQLStore) DeleteInstallationBackup ¶ added in v0.44.0
DeleteInstallationBackup marks the given backup as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteInstallationDBMigrationOperation ¶ added in v0.46.1
DeleteInstallationDBMigrationOperation marks the given migration operation as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteInstallationDBRestorationOperation ¶ added in v0.46.1
DeleteInstallationDBRestorationOperation marks the given restoration operation as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteInstallationDNS ¶ added in v0.54.1
DeleteInstallationDNS marks Installation DNS record as deleted.
func (*SQLStore) DeleteInstallationProxyDatabaseResources ¶ added in v0.47.0
func (sqlStore *SQLStore) DeleteInstallationProxyDatabaseResources(multitenantDatabase *model.MultitenantDatabase, databaseSchema *model.DatabaseSchema) error
DeleteInstallationProxyDatabaseResources makes the final database resource cleanup for installatoin deletion.
func (*SQLStore) DeleteLogicalDatabase ¶ added in v0.47.0
DeleteLogicalDatabase marks the given logical database as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteMultitenantDatabase ¶ added in v0.54.0
DeleteMultitenantDatabase marks multitenant database as deleted.
func (*SQLStore) DeleteSubscription ¶ added in v0.50.0
DeleteSubscription marks the given subscription as deleted.
func (*SQLStore) DeleteWebhook ¶ added in v0.3.0
DeleteWebhook marks the given webhook as deleted, but does not remove the record from the database.
func (*SQLStore) DeletionLockInstallation ¶ added in v0.75.0
func (*SQLStore) DeletionUnlockInstallation ¶ added in v0.75.0
func (*SQLStore) GetAnnotationByName ¶ added in v0.31.0
func (sqlStore *SQLStore) GetAnnotationByName(name string) (*model.Annotation, error)
GetAnnotationByName fetches the given annotation by name.
func (*SQLStore) GetAnnotationsByName ¶ added in v0.55.0
func (sqlStore *SQLStore) GetAnnotationsByName(names []string) ([]*model.Annotation, error)
GetAnnotationsByName fetches multiple annotations by name.
func (*SQLStore) GetAnnotationsForCluster ¶ added in v0.31.0
func (sqlStore *SQLStore) GetAnnotationsForCluster(clusterID string) ([]*model.Annotation, error)
GetAnnotationsForCluster fetches all annotations assigned to the cluster.
func (*SQLStore) GetAnnotationsForClusters ¶ added in v0.31.0
func (sqlStore *SQLStore) GetAnnotationsForClusters(filter *model.ClusterFilter) (map[string][]*model.Annotation, error)
GetAnnotationsForClusters fetches all annotations assigned to the clusters.
func (*SQLStore) GetAnnotationsForInstallation ¶ added in v0.31.0
func (sqlStore *SQLStore) GetAnnotationsForInstallation(installationID string) ([]*model.Annotation, error)
GetAnnotationsForInstallation fetches all annotations assigned to the installation.
func (*SQLStore) GetAnnotationsForInstallations ¶ added in v0.31.0
func (sqlStore *SQLStore) GetAnnotationsForInstallations(filter *model.InstallationFilter) (map[string][]*model.Annotation, error)
GetAnnotationsForInstallations fetches all annotations assigned to installations.
func (*SQLStore) GetCluster ¶
GetCluster fetches the given cluster by id.
func (*SQLStore) GetClusterDTO ¶ added in v0.31.0
func (sqlStore *SQLStore) GetClusterDTO(id string) (*model.ClusterDTO, error)
GetClusterDTO fetches the given cluster by id with data from connected tables.
func (*SQLStore) GetClusterDTOs ¶ added in v0.31.0
func (sqlStore *SQLStore) GetClusterDTOs(filter *model.ClusterFilter) ([]*model.ClusterDTO, error)
GetClusterDTOs fetches the given page of clusters with data from connected tables. The first page is 0.
func (*SQLStore) GetClusterInstallation ¶
func (sqlStore *SQLStore) GetClusterInstallation(id string) (*model.ClusterInstallation, error)
GetClusterInstallation fetches the given cluster installation by id.
func (*SQLStore) GetClusterInstallations ¶
func (sqlStore *SQLStore) GetClusterInstallations(filter *model.ClusterInstallationFilter) ([]*model.ClusterInstallation, error)
GetClusterInstallations fetches the given page of created clusters. The first page is 0.
func (*SQLStore) GetClusters ¶
GetClusters fetches the given page of created clusters. The first page is 0.
func (*SQLStore) GetCurrentVersion ¶
GetCurrentVersion queries the System table for the current database version.
func (*SQLStore) GetDNSRecordsForInstallation ¶ added in v0.54.1
func (sqlStore *SQLStore) GetDNSRecordsForInstallation(installationID string) ([]*model.InstallationDNS, error)
GetDNSRecordsForInstallation lists DNS Records for specified installation.
func (*SQLStore) GetDNSRecordsForInstallations ¶ added in v0.63.3
func (sqlStore *SQLStore) GetDNSRecordsForInstallations(installationIDs []string) ([]*model.InstallationDNS, error)
GetDNSRecordsForInstallations lists DNS Records for specified installations.
func (*SQLStore) GetDatabaseSchema ¶ added in v0.47.0
func (sqlStore *SQLStore) GetDatabaseSchema(id string) (*model.DatabaseSchema, error)
GetDatabaseSchema fetches the given database schema by id.
func (*SQLStore) GetDatabaseSchemaForInstallationID ¶ added in v0.47.0
func (sqlStore *SQLStore) GetDatabaseSchemaForInstallationID(installationID string) (*model.DatabaseSchema, error)
GetDatabaseSchemaForInstallationID fetches the given database schema by installation id.
func (*SQLStore) GetDatabaseSchemas ¶ added in v0.47.0
func (sqlStore *SQLStore) GetDatabaseSchemas(filter *model.DatabaseSchemaFilter) ([]*model.DatabaseSchema, error)
GetDatabaseSchemas fetches the given page of created database schemas. The first page is 0.
func (*SQLStore) GetDeliveriesForSubscription ¶ added in v0.50.0
func (sqlStore *SQLStore) GetDeliveriesForSubscription(subID string) ([]*model.EventDelivery, error)
GetDeliveriesForSubscription is a helper function used for some tests.
func (*SQLStore) GetGroupDTO ¶ added in v0.55.0
GetGroupDTO fetches the given group by id with data from connected tables.
func (*SQLStore) GetGroupDTOs ¶ added in v0.55.0
GetGroupDTOs fetches the given page of groups with data from connected tables. The first page is 0.
func (*SQLStore) GetGroupRollingMetadata ¶ added in v0.18.0
func (sqlStore *SQLStore) GetGroupRollingMetadata(groupID string) (*GroupRollingMetadata, error)
GetGroupRollingMetadata returns installation IDs and metadata related to installation configuration reconciliation from group updates.
Note: custom SQL queries are used here instead of calling GetInstallations(). This is done for performance as we don't need the actual installation objects in most cases.
func (*SQLStore) GetGroupStatus ¶ added in v0.30.0
func (sqlStore *SQLStore) GetGroupStatus(groupID string) (*model.GroupStatus, error)
GetGroupStatus returns total number of installations in the group as well as number or Installations already rolled out and awaiting rollout.
Note: This function uses the same conditions as GetGroupRollingMetadata to be more accurate with the internal state seen by the Group Supervisor.
func (*SQLStore) GetGroups ¶
GetGroups fetches the given page of created groups. The first page is 0.
func (*SQLStore) GetInstallation ¶
func (sqlStore *SQLStore) GetInstallation(id string, includeGroupConfig, includeGroupConfigOverrides bool) (*model.Installation, error)
GetInstallation fetches the given installation by id.
func (*SQLStore) GetInstallationBackup ¶ added in v0.43.0
func (sqlStore *SQLStore) GetInstallationBackup(id string) (*model.InstallationBackup, error)
GetInstallationBackup fetches the given installation backup by id.
func (*SQLStore) GetInstallationBackups ¶ added in v0.43.0
func (sqlStore *SQLStore) GetInstallationBackups(filter *model.InstallationBackupFilter) ([]*model.InstallationBackup, error)
GetInstallationBackups fetches the given page of created installation backups. The first page is 0.
func (*SQLStore) GetInstallationDBMigrationOperation ¶ added in v0.45.0
func (sqlStore *SQLStore) GetInstallationDBMigrationOperation(id string) (*model.InstallationDBMigrationOperation, error)
GetInstallationDBMigrationOperation fetches the given installation db migration.
func (*SQLStore) GetInstallationDBMigrationOperations ¶ added in v0.45.0
func (sqlStore *SQLStore) GetInstallationDBMigrationOperations(filter *model.InstallationDBMigrationFilter) ([]*model.InstallationDBMigrationOperation, error)
GetInstallationDBMigrationOperations fetches the given page of created installation db migration. The first page is 0.
func (*SQLStore) GetInstallationDBRestorationOperation ¶ added in v0.45.0
func (sqlStore *SQLStore) GetInstallationDBRestorationOperation(id string) (*model.InstallationDBRestorationOperation, error)
GetInstallationDBRestorationOperation fetches the given installation db restoration.
func (*SQLStore) GetInstallationDBRestorationOperations ¶ added in v0.45.0
func (sqlStore *SQLStore) GetInstallationDBRestorationOperations(filter *model.InstallationDBRestorationFilter) ([]*model.InstallationDBRestorationOperation, error)
GetInstallationDBRestorationOperations fetches the given page of created installation db restoration. The first page is 0.
func (*SQLStore) GetInstallationDNS ¶ added in v0.54.1
func (sqlStore *SQLStore) GetInstallationDNS(id string) (*model.InstallationDNS, error)
GetInstallationDNS returns InstallationDNS with given id.
func (*SQLStore) GetInstallationDTO ¶ added in v0.31.0
func (sqlStore *SQLStore) GetInstallationDTO(id string, includeGroupConfig, includeGroupConfigOverrides bool) (*model.InstallationDTO, error)
GetInstallationDTO fetches the given installation by id with data from connected tables.
func (*SQLStore) GetInstallationDTOs ¶ added in v0.31.0
func (sqlStore *SQLStore) GetInstallationDTOs(filter *model.InstallationFilter, includeGroupConfig, includeGroupConfigOverrides bool) ([]*model.InstallationDTO, error)
GetInstallationDTOs fetches the given page of installation with data from connected tables. The first page is 0.
func (*SQLStore) GetInstallations ¶
func (sqlStore *SQLStore) GetInstallations(filter *model.InstallationFilter, includeGroupConfig, includeGroupConfigOverrides bool) ([]*model.Installation, error)
GetInstallations fetches the given page of created installations. The first page is 0.
func (*SQLStore) GetInstallationsCount ¶ added in v0.26.0
func (sqlStore *SQLStore) GetInstallationsCount(filter *model.InstallationFilter) (int64, error)
GetInstallationsCount returns the number of installations filtered by the deleteAt field.
func (*SQLStore) GetInstallationsStatus ¶ added in v0.42.0
func (sqlStore *SQLStore) GetInstallationsStatus() (*model.InstallationsStatus, error)
GetInstallationsStatus returns status of all installations which aren't deleted.
func (*SQLStore) GetInstallationsTotalDatabaseWeight ¶ added in v0.43.0
func (sqlStore *SQLStore) GetInstallationsTotalDatabaseWeight(installationIDs []string) (float64, error)
GetInstallationsTotalDatabaseWeight returns the total weight value of the provided installations.
func (*SQLStore) GetLogicalDatabase ¶ added in v0.47.0
func (sqlStore *SQLStore) GetLogicalDatabase(id string) (*model.LogicalDatabase, error)
GetLogicalDatabase fetches the given logical database by id.
func (*SQLStore) GetLogicalDatabases ¶ added in v0.47.0
func (sqlStore *SQLStore) GetLogicalDatabases(filter *model.LogicalDatabaseFilter) ([]*model.LogicalDatabase, error)
GetLogicalDatabases fetches the given page of created logical databases. The first page is 0.
func (*SQLStore) GetMultitenantDatabase ¶ added in v0.19.0
func (sqlStore *SQLStore) GetMultitenantDatabase(id string) (*model.MultitenantDatabase, error)
GetMultitenantDatabase fetches the given multitenant database by id.
func (*SQLStore) GetMultitenantDatabaseForInstallationID ¶ added in v0.19.0
func (sqlStore *SQLStore) GetMultitenantDatabaseForInstallationID(installationID string) (*model.MultitenantDatabase, error)
GetMultitenantDatabaseForInstallationID fetches the multitenant database associated with an installation ID. If more than one multitenant database per installation exists, this function returns an error.
func (*SQLStore) GetMultitenantDatabases ¶ added in v0.19.0
func (sqlStore *SQLStore) GetMultitenantDatabases(filter *model.MultitenantDatabaseFilter) ([]*model.MultitenantDatabase, error)
GetMultitenantDatabases fetches the given page of created multitenant database. The first page is 0.
func (*SQLStore) GetOrCreateAnnotations ¶ added in v0.31.0
func (sqlStore *SQLStore) GetOrCreateAnnotations(annotations []*model.Annotation) ([]*model.Annotation, error)
GetOrCreateAnnotations fetches annotations by name or creates them if they do not exist.
func (*SQLStore) GetOrCreateProxyDatabaseResourcesForInstallation ¶ added in v0.47.0
func (sqlStore *SQLStore) GetOrCreateProxyDatabaseResourcesForInstallation(installationID, multitenantDatabaseID string) (*model.DatabaseResourceGrouping, error)
GetOrCreateProxyDatabaseResourcesForInstallation returns DatabaseResourceGrouping for a given installation ID or creates the necessary resources if they don't exist.
func (*SQLStore) GetProxyDatabaseResourcesForInstallation ¶ added in v0.47.0
func (sqlStore *SQLStore) GetProxyDatabaseResourcesForInstallation(installationID string) (*model.DatabaseResourceGrouping, error)
GetProxyDatabaseResourcesForInstallation returns the DatabaseResourceGrouping for a given installation ID.
func (*SQLStore) GetSingleTenantDatabaseConfigForInstallation ¶ added in v0.35.0
func (sqlStore *SQLStore) GetSingleTenantDatabaseConfigForInstallation(installationID string) (*model.SingleTenantDatabaseConfig, error)
GetSingleTenantDatabaseConfigForInstallation fetches single tenant database configuration for specified installation.
func (*SQLStore) GetStateChangeEvent ¶ added in v0.50.0
func (sqlStore *SQLStore) GetStateChangeEvent(eventID string) (*model.StateChangeEventData, error)
GetStateChangeEvent fetches StateChangeEventData based on specified event ID.
func (*SQLStore) GetStateChangeEvents ¶ added in v0.50.0
func (sqlStore *SQLStore) GetStateChangeEvents(filter *model.StateChangeEventFilter) ([]*model.StateChangeEventData, error)
GetStateChangeEvents fetches StateChangeEventData based on the filter.
func (*SQLStore) GetStateChangeEventsToProcess ¶ added in v0.50.0
func (sqlStore *SQLStore) GetStateChangeEventsToProcess(subID string) ([]*model.StateChangeEventDeliveryData, error)
GetStateChangeEventsToProcess returns StateChangeEventDeliveryData for given subscription in order of occurrence.
func (*SQLStore) GetSubscription ¶ added in v0.50.0
func (sqlStore *SQLStore) GetSubscription(subID string) (*model.Subscription, error)
GetSubscription fetches a subscription by ID.
func (*SQLStore) GetSubscriptions ¶ added in v0.50.0
func (sqlStore *SQLStore) GetSubscriptions(filter *model.SubscriptionsFilter) ([]*model.Subscription, error)
GetSubscriptions fetches subscriptions specified by the filter.
func (*SQLStore) GetUnlockedClusterInstallationsPendingWork ¶
func (sqlStore *SQLStore) GetUnlockedClusterInstallationsPendingWork() ([]*model.ClusterInstallation, error)
GetUnlockedClusterInstallationsPendingWork returns an unlocked cluster installation in a pending state.
func (*SQLStore) GetUnlockedClustersPendingWork ¶
GetUnlockedClustersPendingWork returns an unlocked cluster in a pending state.
func (*SQLStore) GetUnlockedGroupsPendingWork ¶ added in v0.17.0
GetUnlockedGroupsPendingWork returns unlocked groups that have installations that require configuration reconciliation.
func (*SQLStore) GetUnlockedInstallationBackupPendingWork ¶ added in v0.43.0
func (sqlStore *SQLStore) GetUnlockedInstallationBackupPendingWork() ([]*model.InstallationBackup, error)
GetUnlockedInstallationBackupPendingWork returns an unlocked installation backups in a pending state.
func (*SQLStore) GetUnlockedInstallationDBMigrationOperationsPendingWork ¶ added in v0.45.0
func (sqlStore *SQLStore) GetUnlockedInstallationDBMigrationOperationsPendingWork() ([]*model.InstallationDBMigrationOperation, error)
GetUnlockedInstallationDBMigrationOperationsPendingWork returns unlocked installation db migrations in a pending state.
func (*SQLStore) GetUnlockedInstallationDBRestorationOperationsPendingWork ¶ added in v0.45.0
func (sqlStore *SQLStore) GetUnlockedInstallationDBRestorationOperationsPendingWork() ([]*model.InstallationDBRestorationOperation, error)
GetUnlockedInstallationDBRestorationOperationsPendingWork returns unlocked installation db restorations in a pending state.
func (*SQLStore) GetUnlockedInstallationsPendingDeletion ¶ added in v0.60.0
func (sqlStore *SQLStore) GetUnlockedInstallationsPendingDeletion() ([]*model.Installation, error)
GetUnlockedInstallationsPendingDeletion returns unlocked installations in a pending deletion state.
func (*SQLStore) GetUnlockedInstallationsPendingWork ¶
func (sqlStore *SQLStore) GetUnlockedInstallationsPendingWork() ([]*model.Installation, error)
GetUnlockedInstallationsPendingWork returns unlocked installations in a pending work state.
func (*SQLStore) GetWebhook ¶ added in v0.3.0
GetWebhook fetches the given webhook by id.
func (*SQLStore) GetWebhooks ¶ added in v0.3.0
GetWebhooks fetches the given page of created webhooks. The first page is 0.
func (*SQLStore) IsInstallationBackupBeingUsed ¶ added in v0.45.0
IsInstallationBackupBeingUsed checks if backup is being used by any DB restoration Operation or DB migration Operation
func (*SQLStore) IsInstallationBackupRunning ¶ added in v0.43.0
IsInstallationBackupRunning checks if any backup is currently running or requested for specified installation.
func (*SQLStore) LockCluster ¶
LockCluster marks the cluster as locked for exclusive use by the caller.
func (*SQLStore) LockClusterAPI ¶ added in v0.25.0
LockClusterAPI locks updates to the cluster from the API.
func (*SQLStore) LockClusterInstallationAPI ¶ added in v0.25.0
LockClusterInstallationAPI locks updates to the cluster installation from the API.
func (*SQLStore) LockClusterInstallations ¶
func (sqlStore *SQLStore) LockClusterInstallations(clusterInstallationIDs []string, lockerID string) (bool, error)
LockClusterInstallations marks the cluster installation as locked for exclusive use by the caller.
func (*SQLStore) LockDatabaseSchema ¶ added in v0.47.0
LockDatabaseSchema marks the database schema as locked for exclusive use by the caller.
func (*SQLStore) LockGroup ¶ added in v0.17.0
LockGroup marks the group as locked for exclusive use by the caller.
func (*SQLStore) LockGroupAPI ¶ added in v0.25.0
LockGroupAPI locks updates to the group from the API.
func (*SQLStore) LockInstallation ¶
LockInstallation marks the installation as locked for exclusive use by the caller.
func (*SQLStore) LockInstallationAPI ¶ added in v0.25.0
LockInstallationAPI locks updates to the installation from the API.
func (*SQLStore) LockInstallationBackup ¶ added in v0.43.0
LockInstallationBackup marks the backup as locked for exclusive use by the caller.
func (*SQLStore) LockInstallationBackupAPI ¶ added in v0.43.0
LockInstallationBackupAPI locks updates to the backup from the API.
func (*SQLStore) LockInstallationBackups ¶ added in v0.44.0
func (sqlStore *SQLStore) LockInstallationBackups(backupIDs []string, lockerID string) (bool, error)
LockInstallationBackups marks backups as locked for exclusive use by the caller.
func (*SQLStore) LockInstallationDBMigrationOperation ¶ added in v0.45.0
LockInstallationDBMigrationOperation marks the InstallationDBMigrationOperation as locked for exclusive use by the caller.
func (*SQLStore) LockInstallationDBMigrationOperations ¶ added in v0.45.0
func (sqlStore *SQLStore) LockInstallationDBMigrationOperations(ids []string, lockerID string) (bool, error)
LockInstallationDBMigrationOperations marks InstallationDBMigrationOperation as locked for exclusive use by the caller.
func (*SQLStore) LockInstallationDBRestorationOperation ¶ added in v0.45.0
LockInstallationDBRestorationOperation marks the InstallationDBRestoration as locked for exclusive use by the caller.
func (*SQLStore) LockInstallationDBRestorationOperations ¶ added in v0.45.0
func (sqlStore *SQLStore) LockInstallationDBRestorationOperations(ids []string, lockerID string) (bool, error)
LockInstallationDBRestorationOperations marks InstallationDBRestorations as locked for exclusive use by the caller.
func (*SQLStore) LockInstallations ¶ added in v0.46.1
func (sqlStore *SQLStore) LockInstallations(installationIDs []string, lockerID string) (bool, error)
LockInstallations marks the installation(s) as locked for exclusive use by the caller.
func (*SQLStore) LockLogicalDatabase ¶ added in v0.47.0
LockLogicalDatabase marks the logical database as locked for exclusive use by the caller.
func (*SQLStore) LockMultitenantDatabase ¶ added in v0.19.0
func (sqlStore *SQLStore) LockMultitenantDatabase(multitenantDatabaseID, lockerID string) (bool, error)
LockMultitenantDatabase marks the database cluster as locked for exclusive use by the caller.
func (*SQLStore) LockMultitenantDatabases ¶ added in v0.45.0
LockMultitenantDatabases marks MultitenantDatabases as locked for exclusive use by the caller.
func (*SQLStore) Migrate ¶
Migrate advances the schema of the configured database to the latest version.
func (*SQLStore) MigrateClusterInstallations ¶ added in v0.46.1
func (sqlStore *SQLStore) MigrateClusterInstallations(clusterInstallations []*model.ClusterInstallation, targetCluster string) error
MigrateClusterInstallations updates the given cluster installation in the database.
func (*SQLStore) RecoverClusterInstallation ¶ added in v0.45.0
func (sqlStore *SQLStore) RecoverClusterInstallation(clusterInstallation *model.ClusterInstallation) error
RecoverClusterInstallation recovers a given cluster installation from the deleted state.
func (*SQLStore) RecoverInstallation ¶ added in v0.45.0
func (sqlStore *SQLStore) RecoverInstallation(installation *model.Installation) error
RecoverInstallation recovers a given installation from the deleted state.
func (*SQLStore) SwitchDNS ¶ added in v0.46.1
func (sqlStore *SQLStore) SwitchDNS(oldCIsIDs, newCIsIDs, installationIDs []string, hibernatingInstallationIDs []string) error
SwitchDNS performs the dns switch from source cluster to target cluster
func (*SQLStore) SwitchPrimaryInstallationDomain ¶ added in v0.57.0
func (sqlStore *SQLStore) SwitchPrimaryInstallationDomain(installationID string, installationDNSID string) error
SwitchPrimaryInstallationDomain sets given domain as primary reducing all others to non-primary.
func (*SQLStore) TriggerInstallationDBMigration ¶ added in v0.45.0
func (sqlStore *SQLStore) TriggerInstallationDBMigration(dbMigrationOp *model.InstallationDBMigrationOperation, installation *model.Installation) (*model.InstallationDBMigrationOperation, error)
TriggerInstallationDBMigration creates new InstallationDBMigrationOperation in Requested state and changes installation state to InstallationStateDBMigrationInProgress.
func (*SQLStore) TriggerInstallationDBMigrationRollback ¶ added in v0.46.1
func (sqlStore *SQLStore) TriggerInstallationDBMigrationRollback(dbMigrationOp *model.InstallationDBMigrationOperation, installation *model.Installation) error
TriggerInstallationDBMigrationRollback triggers rollback of DB migration in single transaction.
func (*SQLStore) TriggerInstallationRestoration ¶ added in v0.45.0
func (sqlStore *SQLStore) TriggerInstallationRestoration(installation *model.Installation, backup *model.InstallationBackup) (*model.InstallationDBRestorationOperation, error)
TriggerInstallationRestoration creates new InstallationDBRestorationOperation in Requested state and changes installation state to InstallationStateDBRestorationInProgress.
func (*SQLStore) UnlockCluster ¶
UnlockCluster releases a lock previously acquired against a caller.
func (*SQLStore) UnlockClusterAPI ¶ added in v0.25.0
UnlockClusterAPI unlocks updates to the cluster from the API.
func (*SQLStore) UnlockClusterInstallationAPI ¶ added in v0.25.0
UnlockClusterInstallationAPI unlocks updates to the cluster installation from the API.
func (*SQLStore) UnlockClusterInstallations ¶
func (sqlStore *SQLStore) UnlockClusterInstallations(clusterInstallationIDs []string, lockerID string, force bool) (bool, error)
UnlockClusterInstallations releases a lock previously acquired against a caller.
func (*SQLStore) UnlockDatabaseSchema ¶ added in v0.47.0
func (sqlStore *SQLStore) UnlockDatabaseSchema(databaseSchemaID, lockerID string, force bool) (bool, error)
UnlockDatabaseSchema releases a lock previously acquired against a caller.
func (*SQLStore) UnlockGroup ¶ added in v0.17.0
UnlockGroup releases a lock previously acquired against a caller.
func (*SQLStore) UnlockGroupAPI ¶ added in v0.25.0
UnlockGroupAPI unlocks updates to the group from the API.
func (*SQLStore) UnlockInstallation ¶
func (sqlStore *SQLStore) UnlockInstallation(installationID, lockerID string, force bool) (bool, error)
UnlockInstallation releases a lock previously acquired against a caller.
func (*SQLStore) UnlockInstallationAPI ¶ added in v0.25.0
UnlockInstallationAPI unlocks updates to the installation from the API.
func (*SQLStore) UnlockInstallationBackup ¶ added in v0.43.0
func (sqlStore *SQLStore) UnlockInstallationBackup(backupID, lockerID string, force bool) (bool, error)
UnlockInstallationBackup releases a lock previously acquired against a caller.
func (*SQLStore) UnlockInstallationBackupAPI ¶ added in v0.43.0
UnlockInstallationBackupAPI unlocks updates to the backup from the API.
func (*SQLStore) UnlockInstallationBackups ¶ added in v0.44.0
func (sqlStore *SQLStore) UnlockInstallationBackups(backupIDs []string, lockerID string, force bool) (bool, error)
UnlockInstallationBackups releases a locks previously acquired against a caller.
func (*SQLStore) UnlockInstallationDBMigrationOperation ¶ added in v0.45.0
func (sqlStore *SQLStore) UnlockInstallationDBMigrationOperation(id, lockerID string, force bool) (bool, error)
UnlockInstallationDBMigrationOperation releases a lock previously acquired against a caller.
func (*SQLStore) UnlockInstallationDBMigrationOperations ¶ added in v0.45.0
func (sqlStore *SQLStore) UnlockInstallationDBMigrationOperations(ids []string, lockerID string, force bool) (bool, error)
UnlockInstallationDBMigrationOperations releases a locks previously acquired against a caller.
func (*SQLStore) UnlockInstallationDBRestorationOperation ¶ added in v0.45.0
func (sqlStore *SQLStore) UnlockInstallationDBRestorationOperation(id, lockerID string, force bool) (bool, error)
UnlockInstallationDBRestorationOperation releases a lock previously acquired against a caller.
func (*SQLStore) UnlockInstallationDBRestorationOperations ¶ added in v0.45.0
func (sqlStore *SQLStore) UnlockInstallationDBRestorationOperations(ids []string, lockerID string, force bool) (bool, error)
UnlockInstallationDBRestorationOperations releases a locks previously acquired against a caller.
func (*SQLStore) UnlockInstallations ¶ added in v0.46.1
func (sqlStore *SQLStore) UnlockInstallations(installationIDs []string, lockerID string, force bool) (bool, error)
UnlockInstallations releases a lock previously acquired against a caller for a set of installations.
func (*SQLStore) UnlockLogicalDatabase ¶ added in v0.47.0
func (sqlStore *SQLStore) UnlockLogicalDatabase(logicalDatabaseID, lockerID string, force bool) (bool, error)
UnlockLogicalDatabase releases a lock previously acquired against a caller.
func (*SQLStore) UnlockMultitenantDatabase ¶ added in v0.19.0
func (sqlStore *SQLStore) UnlockMultitenantDatabase(multitenantDatabaseID, lockerID string, force bool) (bool, error)
UnlockMultitenantDatabase releases a lock previously acquired against a caller.
func (*SQLStore) UnlockMultitenantDatabases ¶ added in v0.45.0
func (sqlStore *SQLStore) UnlockMultitenantDatabases(ids []string, lockerID string, force bool) (bool, error)
UnlockMultitenantDatabases releases a locks previously acquired against a caller.
func (*SQLStore) UnlockSubscription ¶ added in v0.50.0
UnlockSubscription releases a lock previously acquired against a caller.
func (*SQLStore) UpdateCluster ¶
UpdateCluster updates the given cluster in the database.
func (*SQLStore) UpdateClusterInstallation ¶
func (sqlStore *SQLStore) UpdateClusterInstallation(clusterInstallation *model.ClusterInstallation) error
UpdateClusterInstallation updates the given cluster installation in the database.
func (*SQLStore) UpdateClusterInstallationsActiveStatus ¶ added in v0.46.1
func (sqlStore *SQLStore) UpdateClusterInstallationsActiveStatus(db execer, clusterInstallationIDs []string, isActive bool) error
UpdateClusterInstallationsActiveStatus updates the stale status of all cluster installations for a given cluster.
func (*SQLStore) UpdateEventDeliveryStatus ¶ added in v0.50.0
func (sqlStore *SQLStore) UpdateEventDeliveryStatus(delivery *model.EventDelivery) error
UpdateEventDeliveryStatus updates status fields of EventDelivery.
func (*SQLStore) UpdateGroup ¶
UpdateGroup updates the given group in the database. If a value was updated that will possibly affect installation config then update the group sequence number.
func (*SQLStore) UpdateInstallation ¶
func (sqlStore *SQLStore) UpdateInstallation(installation *model.Installation) error
UpdateInstallation updates the given installation in the database.
func (*SQLStore) UpdateInstallationBackupSchedulingData ¶ added in v0.43.0
func (sqlStore *SQLStore) UpdateInstallationBackupSchedulingData(backup *model.InstallationBackup) error
UpdateInstallationBackupSchedulingData updates the given backup data residency and ClusterInstallationID.
func (*SQLStore) UpdateInstallationBackupStartTime ¶ added in v0.43.0
func (sqlStore *SQLStore) UpdateInstallationBackupStartTime(backup *model.InstallationBackup) error
UpdateInstallationBackupStartTime updates the given backup start time.
func (*SQLStore) UpdateInstallationBackupState ¶ added in v0.43.0
func (sqlStore *SQLStore) UpdateInstallationBackupState(backup *model.InstallationBackup) error
UpdateInstallationBackupState updates the given backup to a new state.
func (*SQLStore) UpdateInstallationCRVersion ¶ added in v0.42.0
UpdateInstallationCRVersion updates the given installation CRVersion.
func (*SQLStore) UpdateInstallationDBMigrationOperation ¶ added in v0.45.0
func (sqlStore *SQLStore) UpdateInstallationDBMigrationOperation(dbMigration *model.InstallationDBMigrationOperation) error
UpdateInstallationDBMigrationOperation updates the given installation db migration.
func (*SQLStore) UpdateInstallationDBMigrationOperationState ¶ added in v0.45.0
func (sqlStore *SQLStore) UpdateInstallationDBMigrationOperationState(dbMigration *model.InstallationDBMigrationOperation) error
UpdateInstallationDBMigrationOperationState updates the given installation db migration state.
func (*SQLStore) UpdateInstallationDBRestorationOperation ¶ added in v0.45.0
func (sqlStore *SQLStore) UpdateInstallationDBRestorationOperation(dbRestoration *model.InstallationDBRestorationOperation) error
UpdateInstallationDBRestorationOperation updates the given installation db restoration.
func (*SQLStore) UpdateInstallationDBRestorationOperationState ¶ added in v0.45.0
func (sqlStore *SQLStore) UpdateInstallationDBRestorationOperationState(dbRestoration *model.InstallationDBRestorationOperation) error
UpdateInstallationDBRestorationOperationState updates the given installation db restoration state.
func (*SQLStore) UpdateInstallationGroupSequence ¶ added in v0.18.0
func (sqlStore *SQLStore) UpdateInstallationGroupSequence(installation *model.Installation) error
UpdateInstallationGroupSequence updates the given installation GroupSequence to the value stored in the merged group config. The provided installation must have been merged with group config before passing it in.
func (*SQLStore) UpdateInstallationState ¶ added in v0.18.0
func (sqlStore *SQLStore) UpdateInstallationState(installation *model.Installation) error
UpdateInstallationState updates the given installation to a new state.
func (*SQLStore) UpdateInstallationsState ¶ added in v0.46.1
func (sqlStore *SQLStore) UpdateInstallationsState(db execer, installationIDs []string, state string) error
UpdateInstallationsState updates the set of installations to a new state.
func (*SQLStore) UpdateMultitenantDatabase ¶ added in v0.19.0
func (sqlStore *SQLStore) UpdateMultitenantDatabase(multitenantDatabase *model.MultitenantDatabase) error
UpdateMultitenantDatabase updates a already existent multitenant database in the datastore.
func (*SQLStore) UpdateSubscriptionStatus ¶ added in v0.50.0
func (sqlStore *SQLStore) UpdateSubscriptionStatus(sub *model.Subscription) error
UpdateSubscriptionStatus updates subscription status.
type Transaction ¶ added in v0.31.0
Transaction is a wrapper around *sqlx.Tx providing convenience methods.
func (*Transaction) Commit ¶ added in v0.31.0
func (t *Transaction) Commit() error
Commit commits the pending transaction.
func (*Transaction) RollbackUnlessCommitted ¶ added in v0.31.0
func (t *Transaction) RollbackUnlessCommitted()
RollbackUnlessCommitted rollback the transaction if it is not committed.
Source Files ¶
- annotation.go
- cluster.go
- cluster_dto.go
- cluster_installation.go
- db_database_schema.go
- db_helpers.go
- db_logical_database.go
- db_multitenant_database.go
- driver.go
- events.go
- events_subscription.go
- group.go
- group_dto.go
- helpers.go
- installation.go
- installation_backup.go
- installation_db_migration.go
- installation_db_restoration_operation.go
- installation_dns.go
- installation_dto.go
- lock.go
- migrate.go
- migrations.go
- store.go
- system.go
- testing.go
- util.go
- version.go
- webhook.go