fix: do not require a local image for k3s deploys
Kubernetes pulls the app image itself, so a k3s host is free to reap its local copy while the workload keeps running, which the `registry` plugin already does on its own. Deploys, restarts, `dokku run`, and in-cluster cron no longer assert that the image is present locally, falling back to the metadata recorded in the app's current Helm release. A `ps:restart` naming a single process type now rolls only that process type's pods rather than silently redeploying every one. Apps with an `app.json` postdeploy task still require the image locally, as that task runs on the Dokku host.
This commit is contained in:
@@ -186,7 +186,20 @@ func TriggerPostDelete(appName string) error {
|
||||
}
|
||||
|
||||
// TriggerPostDeploy is a trigger to execute the postdeploy deployment task
|
||||
//
|
||||
// The task is looked up before the image name is resolved because resolving it
|
||||
// asserts the image exists on the local docker daemon. That assertion does not
|
||||
// hold for schedulers running workloads off this host, which are free to reap
|
||||
// the local copy while the app keeps running in a cluster. An app with no
|
||||
// postdeploy task needs no image at all, so it should not be made to fail here.
|
||||
func TriggerPostDeploy(appName string, imageTag string) error {
|
||||
command, err := getPhaseScript(appName, "postdeploy")
|
||||
if err == nil && command == "" {
|
||||
common.LogInfo1("Checking for postdeploy task")
|
||||
common.LogVerbose("No postdeploy task found, skipping")
|
||||
return nil
|
||||
}
|
||||
|
||||
image, err := common.GetDeployingAppImageName(appName, imageTag, "")
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user