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

Commit

Permalink
Fix logic for completed when parent is not found
Browse files Browse the repository at this point in the history
Signed-off-by: Darren Shepherd <darren@acorn.io>
  • Loading branch information
ibuildthecloud committed Aug 12, 2023
1 parent 6ebf089 commit fd103f1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/controller/appstatus/cli_status.go
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/acorn-io/baaah/pkg/router"
"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/labels"
"github.com/acorn-io/runtime/pkg/publicname"
apierrors "k8s.io/apimachinery/pkg/api/errors"
)
Expand All @@ -30,12 +31,13 @@ func CLIStatus(req router.Request, resp router.Response) (err error) {
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
if parentName := app.Labels[labels.AcornParentAcornName]; parentName != "" {
var parent v1.AppInstance
if err := req.Get(&parent, app.Namespace, parentName); apierrors.IsNotFound(err) {
app.Status.AppStatus.Completed = false
} else if err != nil {
return err
}
}
}

Expand Down

0 comments on commit fd103f1

Please sign in to comment.