Documentation
¶
Index ¶
- func ClearTaskStatus(id string) error
- func CreateAppFromAirgap(pendingApp *PendingApp, airgapBundle multipart.File, registryHost string, ...) error
- func CreateAppVersionArchive(appID string, sequence int64, archivePath string) error
- func DownloadUpdate(a *App, archiveDir string, toCursor string) error
- func ExtractArchiveToTempDirectory(archiveFilename string) (string, error)
- func GetAppVersionArchive(appID string, sequence int) (string, error)
- func GetTaskStatus(id string) (string, error)
- func SetTaskStatus(id string, message string, status string) error
- func UpdateRegistry(appID string, hostname string, username string, password string, ...) error
- func UpdateTaskStatusTimestamp(id string) error
- type App
- func (a App) CreateFirstVersion(filesInDir string, source string) (int64, error)
- func (a App) CreateVersion(filesInDir string, source string) (int64, error)
- func (a *App) RenderDir(archiveDir string) error
- func (a App) RewriteImages(hostname string, username string, password string, namespace string, ...) error
- func (a App) UpdateConfigValuesInDB(filesInDir string) error
- type Diff
- type Downstream
- type GitOpsConfig
- type PendingApp
- type RegistrySettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearTaskStatus ¶
func CreateAppFromAirgap ¶
func CreateAppFromAirgap(pendingApp *PendingApp, airgapBundle multipart.File, registryHost string, namespace string, username string, password string) error
CreateAppFromAirgap does a lot. Maybe too much. Definitely too much. This function assumes that there's an app in the database that doesn't have a version After execution, there will be a sequence 0 of the app, and all clusters in the database will also have a version
func CreateAppVersionArchive ¶
CreateAppVersion takes an unarchived app, makes an archive and then uploads it to s3 with the appID and sequence specified
func GetAppVersionArchive ¶
GetAppVersionArchive will fetch the archive and return a string that contains a directory name where it's extracted into
func GetTaskStatus ¶
func UpdateRegistry ¶
Types ¶
type App ¶
type App struct {
ID string
Slug string
Name string
IsAirgap bool
CurrentSequence int
Downstreams []*Downstream
RegistrySettings *RegistrySettings
}
func GetFromSlug ¶
func (App) CreateFirstVersion ¶
CreateFirstVersion works much likst CreateVersion except that it assumes version 0 and never attempts to calculate a diff, or look at previous versions
func (App) CreateVersion ¶
CreateVersion creates a new version of the app in the database, but the caller is responsible for uploading the archive to s3
func (*App) RenderDir ¶
RenderDir renders an app archive dir this is useful for when the license/config have updated, and template functions need to be evaluated again
func (App) RewriteImages ¶
func (a App) RewriteImages(hostname string, username string, password string, namespace string, configValues *kotsv1beta1.ConfigValues) error
RewriteImages will use the app (a) and send the images to the registry specified. It will create patches for these and create a new version of the application
func (App) UpdateConfigValuesInDB ¶
UpdateConfigValuesInDB it gets the config values from filesInDir and updates the current sequence config values in the db THIS SHOULD ONLY BE CALLED ON APP INSTALLS (WHEN CREATING THE FIRST VERSION)
type Downstream ¶
type GitOpsConfig ¶
type GitOpsConfig struct {
Provider string `json:"provider"`
RepoURI string `json:"repoUri"`
Hostname string `json:"hostname"`
Path string `json:"path"`
Branch string `json:"branch"`
Format string `json:"format"`
Action string `json:"action"`
PublicKey string `json:"publicKey"`
PrivateKey string `json:"-"`
LastError string `json:"lastError"`
}
func GetDownstreamGitOps ¶
func GetDownstreamGitOps(appID string, clusterID string) (*GitOpsConfig, error)
GetDownstreamGitOps will return the gitops config for a downstrea, This implementation copies how it works in typescript.
func (*GitOpsConfig) CloneURL ¶
func (g *GitOpsConfig) CloneURL() string
func (*GitOpsConfig) CommitURL ¶
func (g *GitOpsConfig) CommitURL(hash string) string
type PendingApp ¶
func GetPendingAirgapUploadApp ¶
func GetPendingAirgapUploadApp() (*PendingApp, error)