Skip to content

Commit 913c2bb

Browse files
authored
fix: missing app state initializing (#123)
1 parent ee3f8c3 commit 913c2bb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pkg/apiserver/handler_service.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (h *Handler) listBackend(req *restful.Request, resp *restful.Response) {
146146
if am.Spec.Type != appv1alpha1.App {
147147
continue
148148
}
149-
if am.Spec.AppOwner == owner && (am.Status.State == appv1alpha1.Downloading || am.Status.State == appv1alpha1.Installing) {
149+
if am.Spec.AppOwner == owner && (am.Status.State == appv1alpha1.Pending || am.Status.State == appv1alpha1.Downloading || am.Status.State == appv1alpha1.Installing) {
150150
var appConfig appinstaller.ApplicationConfig
151151
err = json.Unmarshal([]byte(am.Spec.Config), &appConfig)
152152
if err != nil {
@@ -164,13 +164,14 @@ func (h *Handler) listBackend(req *restful.Request, resp *restful.Response) {
164164
Spec: appv1alpha1.ApplicationSpec{
165165
Name: am.Spec.AppName,
166166
Appid: utils.GetAppID(am.Spec.AppName),
167+
IsSysApp: userspace.IsSysApp(am.Spec.AppName),
167168
Namespace: am.Spec.AppNamespace,
168169
Owner: owner,
169170
Entrances: appConfig.Entrances,
170171
Icon: appConfig.Icon,
171172
},
172173
Status: appv1alpha1.ApplicationStatus{
173-
State: appv1alpha1.Installing.String(),
174+
State: am.Status.State.String(),
174175
StatusTime: &now,
175176
UpdateTime: &now,
176177
},

pkg/constants/constants.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const (
9999
var (
100100
empty = sets.Empty{}
101101
// States represents the state for whole application lifecycle.
102-
States = sets.String{"pending": empty, "downloading": empty, "installing": empty, "running": empty,
102+
States = sets.String{"pending": empty, "downloading": empty, "installing": empty, "initializing": empty, "running": empty,
103103
"uninstalling": empty, "upgrading": empty, "suspend": empty}
104104
// Sources represents the source of the application.
105105
Sources = sets.String{"market": empty, "custom": empty, "devbox": empty, "system": empty, "unknown": empty}

0 commit comments

Comments
 (0)