app

package
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTaskStatus

func ClearTaskStatus(id string) error

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

func 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 DownloadUpdate

func DownloadUpdate(a *App, archiveDir string, toCursor string) error

func ExtractArchiveToTempDirectory

func ExtractArchiveToTempDirectory(archiveFilename string) (string, error)

func GetAppVersionArchive

func GetAppVersionArchive(appID string, sequence int) (string, error)

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

func GetTaskStatus

func GetTaskStatus(id string) (string, error)

func IsRequiredItem added in v1.13.3

func IsRequiredItem(item kotsv1beta1.ConfigItem) bool

func IsUnsetItem added in v1.13.3

func IsUnsetItem(item kotsv1beta1.ConfigItem) bool

func SetDownstreamVersionPendingPreflight added in v1.13.3

func SetDownstreamVersionPendingPreflight(appID string, sequence int64) error

SetDownstreamVersionPendingPreflight sets the status for the downstream version with the given sequence and app id to "pending_preflight"

func SetDownstreamVersionReady added in v1.13.3

func SetDownstreamVersionReady(appID string, sequence int64) error

SetDownstreamVersionReady sets the status for the downstream version with the given sequence and app id to "pending"

func SetTaskStatus

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

func UpdateConfigValuesInDB added in v1.13.3

func UpdateConfigValuesInDB(filesInDir string, appID string, sequence int64) error

UpdateConfigValuesInDB it gets the config values from filesInDir and updates the app version config values in the db for the given sequence and app id

func UpdateRegistry

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

func UpdateTaskStatusTimestamp

func UpdateTaskStatusTimestamp(id string) error

Types

type App

type App struct {
	ID              string
	Slug            string
	Name            string
	IsAirgap        bool
	CurrentSequence int
	Downstreams     []*Downstream

	RegistrySettings *RegistrySettings
}

func Get

func Get(id string) (*App, error)

func GetFromSlug

func GetFromSlug(slug string) (*App, error)

func (App) CreateFirstVersion

func (a App) CreateFirstVersion(filesInDir string, source string) (int64, error)

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

func (a App) CreateVersion(filesInDir string, source string) (int64, error)

CreateVersion creates a new version of the app in the database, but the caller is responsible for uploading the archive to s3

func (App) GetVersions added in v1.13.3

func (a App) GetVersions() ([]AppVersion, error)

return the list of versions available for an app

func (*App) RenderDir

func (a *App) RenderDir(archiveDir string) error

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) RenderFile added in v1.13.7

func (a *App) RenderFile(kotsKinds *kotsutil.KotsKinds, inputContent []byte) ([]byte, error)

RenderFile renders a single file this is useful for upstream/kotskinds files that are not rendered in the dir

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

type AppVersion added in v1.13.3

type AppVersion struct {
	Sequence     int
	UpdateCursor int
	VersionLabel string
}

type Diff

type Diff struct {
	FilesChanged int `json:"filesChanged"`
	LinesAdded   int `json:"linesAdded"`
	LinedRemoved int `json:"linesRemoved"`
}

type Downstream

type Downstream struct {
	ClusterID string
	Name      string
}

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

type PendingApp struct {
	ID          string
	Slug        string
	Name        string
	LicenseData string
}

func GetPendingAirgapUploadApp

func GetPendingAirgapUploadApp() (*PendingApp, error)

type RegistrySettings

type RegistrySettings struct {
	Hostname    string
	Username    string
	PasswordEnc string
	Namespace   string
}

Jump to

Keyboard shortcuts

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