s3pg

package
v0.0.0-...-d5808ce Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 64 Imported by: 0

README

s3pgstore

This backing store uses S3 for application archives and support bundles. In addition, this store uses postgres for storage of all metadata and cache. There are some scenarios where this store uses the local Kubernetes cluster for storing some sensitive information (gitops, etc).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func CreateAdminIDConfigMap

func CreateAdminIDConfigMap(clusterID string) (*corev1.ConfigMap, error)

CreateAdminIDConfigMap creates an id for an kotsadm instance and stores in configmap

func IsKotsadmIDConfigMapPresent

func IsKotsadmIDConfigMapPresent() (bool, error)

IsKotsadmIDConfigMapPresent checks if the configmap for kotsadm-id exists

Types

type S3PGStore

type S3PGStore struct {
}

func (S3PGStore) AddAppToAllDownstreams

func (s S3PGStore) AddAppToAllDownstreams(appID string) error

func (S3PGStore) ClearTaskStatus

func (s S3PGStore) ClearTaskStatus(id string) error

func (S3PGStore) CreateApp

func (s S3PGStore) CreateApp(name string, upstreamURI string, licenseData string, isAirgapEnabled bool, skipImagePush bool) (*apptypes.App, error)

func (S3PGStore) CreateAppVersion

func (s S3PGStore) CreateAppVersion(appID string, currentSequence *int64, filesInDir string, source string, skipPreflights bool, gitops gitopstypes.DownstreamGitOps) (int64, error)

func (S3PGStore) CreateAppVersionArchive

func (s S3PGStore) CreateAppVersionArchive(appID string, sequence int64, archivePath string) error

CreateAppVersion takes an unarchived app, makes an archive and then uploads it to s3 with the appID and sequence specified

func (S3PGStore) CreateNewCluster

func (s S3PGStore) CreateNewCluster(userID string, isAllUsers bool, title string, token string) (string, error)

func (S3PGStore) CreatePendingSupportBundle

func (s S3PGStore) CreatePendingSupportBundle(id string, appID string, clusterID string) error

func (S3PGStore) CreateScheduledInstanceSnapshot

func (c S3PGStore) CreateScheduledInstanceSnapshot(id string, clusterID string, timestamp time.Time) error

func (S3PGStore) CreateScheduledSnapshot

func (c S3PGStore) CreateScheduledSnapshot(id string, appID string, timestamp time.Time) error

func (S3PGStore) CreateSession

func (s S3PGStore) CreateSession(forUser *usertypes.User, issuedAt time.Time, expiresAt time.Time, roles []string) (*sessiontypes.Session, error)

func (S3PGStore) CreateSupportBundle

func (s S3PGStore) CreateSupportBundle(id string, appID string, archivePath string, marshalledTree []byte) (*supportbundletypes.SupportBundle, error)

func (S3PGStore) DeletePendingScheduledInstanceSnapshots

func (c S3PGStore) DeletePendingScheduledInstanceSnapshots(clusterID string) error

func (S3PGStore) DeletePendingScheduledSnapshots

func (c S3PGStore) DeletePendingScheduledSnapshots(appID string) error

func (S3PGStore) DeleteSession

func (s S3PGStore) DeleteSession(id string) error

func (S3PGStore) GetAirgapInstallStatus

func (s S3PGStore) GetAirgapInstallStatus() (*airgaptypes.InstallStatus, error)

func (S3PGStore) GetAllAppLicenses

func (s S3PGStore) GetAllAppLicenses() ([]*kotsv1beta1.License, error)

func (S3PGStore) GetApp

func (s S3PGStore) GetApp(id string) (*apptypes.App, error)

func (S3PGStore) GetAppFromSlug

func (s S3PGStore) GetAppFromSlug(slug string) (*apptypes.App, error)

func (S3PGStore) GetAppIDFromSlug

func (s S3PGStore) GetAppIDFromSlug(slug string) (string, error)

func (S3PGStore) GetAppStatus

func (s S3PGStore) GetAppStatus(appID string) (*appstatustypes.AppStatus, error)

func (S3PGStore) GetAppVersion

func (s S3PGStore) GetAppVersion(appID string, sequence int64) (*versiontypes.AppVersion, error)

func (S3PGStore) GetAppVersionArchive

func (s S3PGStore) GetAppVersionArchive(appID string, sequence int64, dstPath string) error

GetAppVersionArchive will fetch the archive and return a string that contains a directory name where it's extracted into

func (S3PGStore) GetAppVersionsAfter

func (s S3PGStore) GetAppVersionsAfter(appID string, sequence int64) ([]*versiontypes.AppVersion, error)

func (S3PGStore) GetClusterIDFromDeployToken

func (s S3PGStore) GetClusterIDFromDeployToken(deployToken string) (string, error)

func (S3PGStore) GetClusterIDFromSlug

func (s S3PGStore) GetClusterIDFromSlug(slug string) (string, error)

func (S3PGStore) GetDownstream

func (s S3PGStore) GetDownstream(clusterID string) (*downstreamtypes.Downstream, error)

func (S3PGStore) GetLatestLicenseForApp

func (s S3PGStore) GetLatestLicenseForApp(appID string) (*kotsv1beta1.License, error)

func (S3PGStore) GetLatestPreflightResultsForSequenceZero

func (c S3PGStore) GetLatestPreflightResultsForSequenceZero() (*preflighttypes.PreflightResult, error)

func (S3PGStore) GetLicenseForAppVersion

func (s S3PGStore) GetLicenseForAppVersion(appID string, sequence int64) (*kotsv1beta1.License, error)

func (S3PGStore) GetPendingAirgapUploadApp

func (s S3PGStore) GetPendingAirgapUploadApp() (*airgaptypes.PendingApp, error)

func (S3PGStore) GetPendingInstallationStatus

func (s S3PGStore) GetPendingInstallationStatus() (*installationtypes.InstallStatus, error)

func (S3PGStore) GetPreflightResults

func (c S3PGStore) GetPreflightResults(appID string, sequence int64) (*preflighttypes.PreflightResult, error)

func (S3PGStore) GetPrometheusAddress

func (s S3PGStore) GetPrometheusAddress() (string, error)

func (S3PGStore) GetRedactions

func (s S3PGStore) GetRedactions(bundleID string) (troubleshootredact.RedactionList, error)

func (S3PGStore) GetRegistryDetailsForApp

func (s S3PGStore) GetRegistryDetailsForApp(appID string) (*registrytypes.RegistrySettings, error)

func (S3PGStore) GetReportingInfo

func (s S3PGStore) GetReportingInfo(appID string) *upstreamtypes.ReportingInfo

func (S3PGStore) GetSession

func (s S3PGStore) GetSession(id string) (*sessiontypes.Session, error)

func (S3PGStore) GetSupportBundle

func (s S3PGStore) GetSupportBundle(id string) (*supportbundletypes.SupportBundle, error)

func (S3PGStore) GetSupportBundleAnalysis

func (s S3PGStore) GetSupportBundleAnalysis(id string) (*supportbundletypes.SupportBundleAnalysis, error)

func (S3PGStore) GetSupportBundleArchive

func (s S3PGStore) GetSupportBundleArchive(bundleID string) (string, error)

GetSupportBundle will fetch the bundle archive and return a path to where it is stored. The caller is responsible for deleting.

func (S3PGStore) GetSupportBundleFromSlug

func (s S3PGStore) GetSupportBundleFromSlug(slug string) (*supportbundletypes.SupportBundle, error)

func (S3PGStore) GetSupportBundleSpecForApp

func (s S3PGStore) GetSupportBundleSpecForApp(id string) (string, error)

func (S3PGStore) GetTaskStatus

func (s S3PGStore) GetTaskStatus(id string) (string, string, error)

func (S3PGStore) Init

func (s S3PGStore) Init() error

func (S3PGStore) IsGitOpsEnabledForApp

func (s S3PGStore) IsGitOpsEnabledForApp(appID string) (bool, error)

func (S3PGStore) IsIdentityServiceSupportedForVersion

func (s S3PGStore) IsIdentityServiceSupportedForVersion(appID string, sequence int64) (bool, error)

func (S3PGStore) IsKotsadmIDGenerated

func (s S3PGStore) IsKotsadmIDGenerated() (bool, error)

IsKotsadmIDGenerated retrieves the id of kotsadm if the pod is already

func (S3PGStore) IsNotFound

func (s S3PGStore) IsNotFound(err error) bool

func (S3PGStore) IsRollbackSupportedForVersion

func (s S3PGStore) IsRollbackSupportedForVersion(appID string, sequence int64) (bool, error)

func (S3PGStore) IsSnapshotsSupportedForVersion

func (s S3PGStore) IsSnapshotsSupportedForVersion(a *apptypes.App, sequence int64, renderer rendertypes.Renderer) (bool, error)

func (S3PGStore) ListAppsForDownstream

func (s S3PGStore) ListAppsForDownstream(clusterID string) ([]*apptypes.App, error)

func (S3PGStore) ListClusters

func (s S3PGStore) ListClusters() ([]*downstreamtypes.Downstream, error)

func (S3PGStore) ListDownstreamsForApp

func (s S3PGStore) ListDownstreamsForApp(appID string) ([]downstreamtypes.Downstream, error)

func (S3PGStore) ListInstalledAppSlugs

func (s S3PGStore) ListInstalledAppSlugs() ([]string, error)

func (S3PGStore) ListInstalledApps

func (s S3PGStore) ListInstalledApps() ([]*apptypes.App, error)

func (S3PGStore) ListPendingScheduledInstanceSnapshots

func (c S3PGStore) ListPendingScheduledInstanceSnapshots(clusterID string) ([]snapshottypes.ScheduledInstanceSnapshot, error)

func (S3PGStore) ListPendingScheduledSnapshots

func (c S3PGStore) ListPendingScheduledSnapshots(appID string) ([]snapshottypes.ScheduledSnapshot, error)

func (S3PGStore) ListPendingSupportBundlesForApp

func (s S3PGStore) ListPendingSupportBundlesForApp(appID string) ([]*supportbundletypes.PendingSupportBundle, error)

func (S3PGStore) ListSupportBundles

func (s S3PGStore) ListSupportBundles(appID string) ([]*supportbundletypes.SupportBundle, error)

func (S3PGStore) RemoveApp

func (c S3PGStore) RemoveApp(appID string) error

func (S3PGStore) ResetAirgapInstallInProgress

func (s S3PGStore) ResetAirgapInstallInProgress(appID string) error

func (S3PGStore) ResetPreflightResults

func (s S3PGStore) ResetPreflightResults(appID string, sequence int64) error

func (S3PGStore) RunMigrations

func (s S3PGStore) RunMigrations()

func (S3PGStore) SetAppInstallState

func (s S3PGStore) SetAppInstallState(appID string, state string) error

func (S3PGStore) SetAppIsAirgap

func (s S3PGStore) SetAppIsAirgap(appID string, isAirgap bool) error

func (S3PGStore) SetIgnorePreflightPermissionErrors

func (s S3PGStore) SetIgnorePreflightPermissionErrors(appID string, sequence int64) error

func (S3PGStore) SetInstanceSnapshotSchedule

func (c S3PGStore) SetInstanceSnapshotSchedule(clusterID string, snapshotSchedule string) error

func (S3PGStore) SetInstanceSnapshotTTL

func (c S3PGStore) SetInstanceSnapshotTTL(clusterID string, snapshotTTL string) error

func (S3PGStore) SetIsKotsadmIDGenerated

func (s S3PGStore) SetIsKotsadmIDGenerated() error

SetIsKotsadmIDGenerated sets the status to true if the pod is starting for the first time

func (S3PGStore) SetPreflightResults

func (c S3PGStore) SetPreflightResults(appID string, sequence int64, results []byte) error

func (S3PGStore) SetPrometheusAddress

func (s S3PGStore) SetPrometheusAddress(address string) error

func (S3PGStore) SetRedactions

func (s S3PGStore) SetRedactions(bundleID string, redacts troubleshootredact.RedactionList) error

func (S3PGStore) SetSnapshotSchedule

func (c S3PGStore) SetSnapshotSchedule(appID string, snapshotSchedule string) error

func (S3PGStore) SetSnapshotTTL

func (c S3PGStore) SetSnapshotTTL(appID string, snapshotTTL string) error

func (S3PGStore) SetSupportBundleAnalysis

func (s S3PGStore) SetSupportBundleAnalysis(id string, insights []byte) error

func (S3PGStore) SetTaskStatus

func (s S3PGStore) SetTaskStatus(id string, message string, status string) error

func (S3PGStore) SetUpdateCheckerSpec

func (s S3PGStore) SetUpdateCheckerSpec(appID string, updateCheckerSpec string) error

func (S3PGStore) UpdateAppLicense

func (s S3PGStore) UpdateAppLicense(appID string, sequence int64, archiveDir string, newLicense *kotsv1beta1.License, originalLicenseData string, failOnVersionCreate bool, gitops gitopstypes.DownstreamGitOps, renderer rendertypes.Renderer) (int64, error)

func (S3PGStore) UpdateRegistry

func (s S3PGStore) UpdateRegistry(appID string, hostname string, username string, password string, namespace string) error

func (S3PGStore) UpdateScheduledInstanceSnapshot

func (c S3PGStore) UpdateScheduledInstanceSnapshot(snapshotID string, backupName string) error

func (S3PGStore) UpdateScheduledSnapshot

func (c S3PGStore) UpdateScheduledSnapshot(snapshotID string, backupName string) error

func (S3PGStore) UpdateTaskStatusTimestamp

func (s S3PGStore) UpdateTaskStatusTimestamp(id string) error

func (S3PGStore) WaitForReady

func (s S3PGStore) WaitForReady(ctx context.Context) error

type SessionMetadata

type SessionMetadata struct {
	Roles []string
}

Jump to

Keyboard shortcuts

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