Skip to content

Commit

Permalink
fix: missing app state initializing (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
hysyeah authored Jan 3, 2025
1 parent ee3f8c3 commit 913c2bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/apiserver/handler_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (h *Handler) listBackend(req *restful.Request, resp *restful.Response) {
if am.Spec.Type != appv1alpha1.App {
continue
}
if am.Spec.AppOwner == owner && (am.Status.State == appv1alpha1.Downloading || am.Status.State == appv1alpha1.Installing) {
if am.Spec.AppOwner == owner && (am.Status.State == appv1alpha1.Pending || am.Status.State == appv1alpha1.Downloading || am.Status.State == appv1alpha1.Installing) {
var appConfig appinstaller.ApplicationConfig
err = json.Unmarshal([]byte(am.Spec.Config), &appConfig)
if err != nil {
Expand All @@ -164,13 +164,14 @@ func (h *Handler) listBackend(req *restful.Request, resp *restful.Response) {
Spec: appv1alpha1.ApplicationSpec{
Name: am.Spec.AppName,
Appid: utils.GetAppID(am.Spec.AppName),
IsSysApp: userspace.IsSysApp(am.Spec.AppName),
Namespace: am.Spec.AppNamespace,
Owner: owner,
Entrances: appConfig.Entrances,
Icon: appConfig.Icon,
},
Status: appv1alpha1.ApplicationStatus{
State: appv1alpha1.Installing.String(),
State: am.Status.State.String(),
StatusTime: &now,
UpdateTime: &now,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const (
var (
empty = sets.Empty{}
// States represents the state for whole application lifecycle.
States = sets.String{"pending": empty, "downloading": empty, "installing": empty, "running": empty,
States = sets.String{"pending": empty, "downloading": empty, "installing": empty, "initializing": empty, "running": empty,
"uninstalling": empty, "upgrading": empty, "suspend": empty}
// Sources represents the source of the application.
Sources = sets.String{"market": empty, "custom": empty, "devbox": empty, "system": empty, "unknown": empty}
Expand Down

0 comments on commit 913c2bb

Please sign in to comment.