@@ -20,6 +20,7 @@ package action
20
20
21
21
import (
22
22
"context"
23
+ "fmt"
23
24
24
25
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25
26
applicationv1 "tkestack.io/tke/api/application/v1"
@@ -31,6 +32,7 @@ import (
31
32
applicationprovider "tkestack.io/tke/pkg/application/provider/application"
32
33
"tkestack.io/tke/pkg/application/util"
33
34
chartpath "tkestack.io/tke/pkg/application/util/chartpath/v1"
35
+ "tkestack.io/tke/pkg/util/log"
34
36
)
35
37
36
38
// Install installs a chart archive
@@ -52,7 +54,12 @@ func Install(ctx context.Context,
52
54
destfile , err := Pull (ctx , applicationClient , platformClient , app , repo , updateStatusFunc )
53
55
if err != nil {
54
56
newStatus := app .Status .DeepCopy ()
55
- if updateStatusFunc != nil && app .Status .Phase != applicationv1 .AppPhaseInstallFailed {
57
+ if updateStatusFunc != nil {
58
+ if app .Status .Phase == applicationv1 .AppPhaseInstallFailed {
59
+ log .Error (fmt .Sprintf ("install app failed, helm pull err: %s" , err .Error ()))
60
+ // delayed retry, queue.AddRateLimited does not meet the demand
61
+ return app , nil
62
+ }
56
63
newStatus .Phase = applicationv1 .AppPhaseInstallFailed
57
64
newStatus .Message = "fetch chart failed"
58
65
newStatus .Reason = err .Error ()
@@ -62,8 +69,6 @@ func Install(ctx context.Context,
62
69
return nil , updateStatusErr
63
70
}
64
71
}
65
- // delayed retry, queue.AddRateLimited does not meet the demand
66
- return app , nil
67
72
}
68
73
69
74
newApp , err := applicationClient .Apps (app .Namespace ).Get (ctx , app .Name , metav1.GetOptions {})
@@ -95,6 +100,7 @@ func Install(ctx context.Context,
95
100
var updateStatusErr error
96
101
if err != nil {
97
102
if app .Status .Phase == applicationv1 .AppPhaseInstallFailed {
103
+ log .Error (fmt .Sprintf ("install app failed, helm install err: %s" , err .Error ()))
98
104
// delayed retry, queue.AddRateLimited does not meet the demand
99
105
return app , nil
100
106
}
0 commit comments