@@ -74,7 +74,7 @@ func NewComposeService() (compose.Service, error) {
74
74
func (s * composeService ) Up (ctx context.Context , project * types.Project , options compose.UpOptions ) error {
75
75
w := progress .ContextWriter (ctx )
76
76
77
- eventName := "Convert to Helm charts"
77
+ eventName := "Convert Compose file to Helm charts"
78
78
w .Event (progress .CreatingEvent (eventName ))
79
79
80
80
chart , err := helm .GetChartInMemory (project )
@@ -83,16 +83,31 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
83
83
}
84
84
w .Event (progress .NewEvent (eventName , progress .Done , "" ))
85
85
86
- eventName = "Install Helm charts"
87
- w .Event (progress .CreatingEvent (eventName ))
88
-
89
- err = s .sdk .InstallChart (project .Name , chart , func (format string , v ... interface {}) {
90
- message := fmt .Sprintf (format , v ... )
91
- w .Event (progress .NewEvent (eventName , progress .Done , message ))
92
- })
86
+ stack , err := s .sdk .Get (project .Name )
87
+ if err != nil || stack == nil {
88
+ // install stack
89
+ eventName = "Install Compose stack"
90
+ w .Event (progress .CreatingEvent (eventName ))
91
+
92
+ err = s .sdk .InstallChart (project .Name , chart , func (format string , v ... interface {}) {
93
+ message := fmt .Sprintf (format , v ... )
94
+ w .Event (progress .NewEvent (eventName , progress .Done , message ))
95
+ })
96
+
97
+ } else {
98
+ //update stack
99
+ eventName = "Updating Compose stack"
100
+ w .Event (progress .CreatingEvent (eventName ))
101
+
102
+ err = s .sdk .UpdateChart (project .Name , chart , func (format string , v ... interface {}) {
103
+ message := fmt .Sprintf (format , v ... )
104
+ w .Event (progress .NewEvent (eventName , progress .Done , message ))
105
+ })
106
+ }
93
107
if err != nil {
94
108
return err
95
109
}
110
+
96
111
w .Event (progress .NewEvent (eventName , progress .Done , "" ))
97
112
98
113
return s .client .WaitForPodState (ctx , client.WaitForStatusOptions {
0 commit comments