Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Never show orphaned acorns as complete
Browse files Browse the repository at this point in the history
Signed-off-by: Darren Shepherd <darren@acorn.io>
  • Loading branch information
ibuildthecloud committed Jul 19, 2023
1 parent d6d69e1 commit d7e58ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controller/appdefinition/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ func DeploySpec(req router.Request, resp router.Response) (err error) {
if err := addPVCs(req, appInstance, resp); err != nil {
return err
}
addAcorns(req, appInstance, tag, pullSecrets, resp)
if err := addAcorns(req, appInstance, tag, pullSecrets, resp); err != nil {
return err
}

resp.Objects(pullSecrets.Objects()...)
resp.Objects(interpolator.Objects()...)
Expand Down
10 changes: 10 additions & 0 deletions pkg/controller/appstatus/cli_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/acorn-io/baaah/pkg/typed"
v1 "github.com/acorn-io/runtime/pkg/apis/internal.acorn.io/v1"
"github.com/acorn-io/runtime/pkg/publicname"
apierrors "k8s.io/apimachinery/pkg/api/errors"
)

func CLIStatus(req router.Request, resp router.Response) (err error) {
Expand All @@ -28,6 +29,15 @@ func CLIStatus(req router.Request, resp router.Response) (err error) {
app.Status.Columns.UpToDate == "0" &&
app.Status.Columns.Message == "OK" &&
app.Status.Columns.Endpoints == ""
if app.Status.AppStatus.Completed {
var parent v1.AppInstance
parentName, _ := publicname.Split(publicname.Get(app))
if err := req.Get(&parent, app.Namespace, parentName); apierrors.IsNotFound(err) {
app.Status.AppStatus.Completed = false
} else if err != nil {
return err
}
}

resp.Objects(app)
return
Expand Down

0 comments on commit d7e58ca

Please sign in to comment.