application

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 75 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInstances = int32(1)
	LocalRegistry    = "127.0.0.1:30500/apps"
)

Variables

This section is empty.

Functions

func CheckOriginFunc added in v0.5.1

func CheckOriginFunc(allowedOrigins []string) func(r *http.Request) bool

func Create added in v1.8.0

func Create(c *gin.Context) apierror.APIErrors

Create handles the API endpoint POST /namespaces/:namespace/applications It creates a new and empty application. I.e. without a workload.

func Delete added in v1.8.0

func Delete(c *gin.Context) apierror.APIErrors

Delete handles the API endpoint DELETE /namespaces/:namespace/applications/:app It removes the named application

func Deploy added in v1.8.0

func Deploy(c *gin.Context) apierror.APIErrors

Deploy handles the API endpoint /namespaces/:namespace/applications/:app/deploy It uses an application chart to create the deployment, configuration and ingress (kube) resources for the app.

func Exec added in v1.8.0

func Exec(c *gin.Context) apierror.APIErrors

func ExportToRegistry added in v1.10.0

func ExportToRegistry(c *gin.Context) apierror.APIErrors

ExportToRegistry handles the API endpoint GET /namespaces/:namespace/applications/:app/export It exports the named application to the export registry (also specified by name)

func FullIndex added in v1.8.0

func FullIndex(c *gin.Context) apierror.APIErrors

FullIndex handles the API endpoint GET /applications It lists all the known applications in all namespaces, with and without workload.

func GetFileContentType added in v1.1.0

func GetFileContentType(file multipart.File) (string, error)

func GetPart added in v1.8.0

func GetPart(c *gin.Context) apierror.APIErrors

GetPart handles the API endpoint GET /namespaces/:namespace/applications/:app/part/:part It determines the contents of the requested part (values, chart, image) and returns as the response of the handler.

func ImportGit added in v1.8.0

func ImportGit(c *gin.Context) apierror.APIErrors

ImportGit handles the API endpoint /namespaces/:namespace/applications/:app/import-git. It receives a Git repo url and revision, clones that (shallow clone), creates a tarball of the repo and puts it on S3.

func Index added in v1.8.0

func Index(c *gin.Context) apierror.APIErrors

Index handles the API endpoint GET /namespaces/:namespace/applications It lists all the known applications in the specified namespace, with and without workload.

func Logs added in v1.8.0

func Logs(c *gin.Context)

Logs handles the API endpoints GET /namespaces/:namespace/applications/:app/logs and GET /namespaces/:namespace/staging/:stage_id/logs It arranges for the logs of the specified application to be streamed over a websocket. Dependent on the endpoint this may be either regular logs, or the app's staging logs.

func Match added in v1.8.0

func Match(c *gin.Context) apierror.APIErrors

Match handles the API endpoint /namespace/:namespace/appsmatches/:pattern (GET) It returns a list of all Epinio-controlled applications matching the prefix pattern.

func PortForward added in v1.8.0

func PortForward(c *gin.Context) apierror.APIErrors

func Redeploy added in v1.10.0

func Redeploy(ctx context.Context, cluster *kubernetes.Cluster, namespace string, appNames []string) apierror.APIErrors

Redeploy does not serve a specific handler. It is used by the configuration and service update/replace handlers to restart the active set of the named applications. Quiescent applications are ignored. This is their means of forcing the applications bound to the changed configuration/service to pick up these changes and use them.

func Restart added in v1.8.0

func Restart(c *gin.Context) apierror.APIErrors

Restart handles the API endpoint POST /namespaces/:namespace/applications/:app/restart

func Running added in v1.8.0

func Running(c *gin.Context) apierror.APIErrors

Running handles the API endpoint GET /namespaces/:namespace/applications/:app/running

It waits for the specified application to be running (i.e. its deployment to be complete), before it returns. An exception is if the application does not become ready within `duration.ToAppBuilt()` (default: 3 minutes). In that case it returns with an error after that time.

__API PORTABILITY NOTE__

With the switch to deployment of apps via helm, and waiting for the helm deployment to be ready before returning this endpoint is technically superfluous, and it should never fail. The command line has been modified to not invoke it anymore.

It is kept for older clients still calling on it. Because of that it is also kept functional. Instead of checking for an app `Deployment` and its status it now checks the app `Pod` statuses.

func Show added in v1.8.0

func Show(c *gin.Context) apierror.APIErrors

Show handles the API endpoint GET /namespaces/:namespace/applications/:app It returns the details of the specified application.

func SortByName added in v1.11.0

func SortByName(s1, s2 *StagingScriptConfig) int

func Stage added in v1.8.0

func Stage(c *gin.Context) apierror.APIErrors

Stage handles the API endpoint /namespaces/:namespace/applications/:app/stage It creates a Job resource to stage the app

func Staged added in v1.8.0

func Staged(c *gin.Context) apierror.APIErrors

Staged handles the API endpoint /namespaces/:namespace/staging/:stage_id/complete It waits for the Job resource staging the app to complete

func StagingScriptConfigResolve added in v1.11.0

func StagingScriptConfigResolve(ctx context.Context, logger logr.Logger, cluster *kubernetes.Cluster, config *StagingScriptConfig) error

func Update added in v1.8.0

func Update(c *gin.Context) apierror.APIErrors

Update handles the API endpoint PATCH /namespaces/:namespace/applications/:app

func Upload added in v1.8.0

func Upload(c *gin.Context) apierror.APIErrors

Upload handles the API endpoint /namespaces/:namespace/applications/:app/store. It receives the application data as an archive (tarball, zip, ...) and stores it. Then it creates the k8s resources needed for staging

func ValidateChartValues added in v1.8.0

func ValidateChartValues(c *gin.Context) apierror.APIErrors

ValidateChartValues handles the API endpoint /namespaces/:namespace/applications/:app/validate-cv Given application by name, and namespace the custom chart values are checked against the declarations in the referenced appchart.

Types

type StagingScriptConfig added in v1.11.0

type StagingScriptConfig struct {
	Name          string                // config name. Needed to mount the resource in the pod
	Builder       string                // glob pattern for builders supported by this resource
	UserID        int64                 // user id to run the build phase with (`cnb` user)
	GroupID       int64                 // group id to run the build hase with
	Base          string                // optional, name of resource to pull the other parts from
	DownloadImage string                // image to run the download phase with
	UnpackImage   string                // image to run the unpack phase with
	Env           models.EnvVariableMap // environment settings
}

StagingScriptConfig holds all the information for using a (set of) buildpack(s)

func DetermineStagingScripts added in v1.11.0

func DetermineStagingScripts(ctx context.Context,
	logger logr.Logger,
	cluster *kubernetes.Cluster,
	namespace, builder string) (*StagingScriptConfig, error)

func NewStagingScriptConfig added in v1.11.0

func NewStagingScriptConfig(config v1.ConfigMap) (*StagingScriptConfig, error)

Jump to

Keyboard shortcuts

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