@@ -74,7 +74,7 @@ func NewComposeService() (compose.Service, error) {
7474func (s * composeService ) Up (ctx context.Context , project * types.Project , options compose.UpOptions ) error {
7575 w := progress .ContextWriter (ctx )
7676
77- eventName := "Convert to Helm charts"
77+ eventName := "Convert Compose file to Helm charts"
7878 w .Event (progress .CreatingEvent (eventName ))
7979
8080 chart , err := helm .GetChartInMemory (project )
@@ -83,16 +83,31 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
8383 }
8484 w .Event (progress .NewEvent (eventName , progress .Done , "" ))
8585
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+ }
93107 if err != nil {
94108 return err
95109 }
110+
96111 w .Event (progress .NewEvent (eventName , progress .Done , "" ))
97112
98113 return s .client .WaitForPodState (ctx , client.WaitForStatusOptions {
0 commit comments