Documentation ¶
Index ¶
- Constants
- func CheckOriginFunc(allowedOrigins []string) func(r *http.Request) bool
- func Create(c *gin.Context) apierror.APIErrors
- func Delete(c *gin.Context) apierror.APIErrors
- func Deploy(c *gin.Context) apierror.APIErrors
- func Exec(c *gin.Context) apierror.APIErrors
- func ExportToRegistry(c *gin.Context) apierror.APIErrors
- func FullIndex(c *gin.Context) apierror.APIErrors
- func GetFileContentType(file multipart.File) (string, error)
- func GetPart(c *gin.Context) apierror.APIErrors
- func ImportGit(c *gin.Context) apierror.APIErrors
- func Index(c *gin.Context) apierror.APIErrors
- func Logs(c *gin.Context)
- func Match(c *gin.Context) apierror.APIErrors
- func PortForward(c *gin.Context) apierror.APIErrors
- func Redeploy(ctx context.Context, cluster *kubernetes.Cluster, namespace string, ...) apierror.APIErrors
- func Restart(c *gin.Context) apierror.APIErrors
- func Running(c *gin.Context) apierror.APIErrors
- func Show(c *gin.Context) apierror.APIErrors
- func SortByName(s1, s2 *StagingScriptConfig) int
- func Stage(c *gin.Context) apierror.APIErrors
- func Staged(c *gin.Context) apierror.APIErrors
- func StagingScriptConfigResolve(ctx context.Context, logger logr.Logger, cluster *kubernetes.Cluster, ...) error
- func Update(c *gin.Context) apierror.APIErrors
- func Upload(c *gin.Context) apierror.APIErrors
- func ValidateChartValues(c *gin.Context) apierror.APIErrors
- type StagingScriptConfig
Constants ¶
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 Create ¶ added in v1.8.0
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
Delete handles the API endpoint DELETE /namespaces/:namespace/applications/:app It removes the named application
func Deploy ¶ added in v1.8.0
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 ExportToRegistry ¶ added in v1.10.0
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
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 GetPart ¶ added in v1.8.0
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
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
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
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
Match handles the API endpoint /namespace/:namespace/appsmatches/:pattern (GET) It returns a list of all Epinio-controlled applications matching the prefix pattern.
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
Restart handles the API endpoint POST /namespaces/:namespace/applications/:app/restart
func Running ¶ added in v1.8.0
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
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
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
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
Update handles the API endpoint PATCH /namespaces/:namespace/applications/:app
func Upload ¶ added in v1.8.0
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
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)