@@ -14,10 +14,10 @@ import (
1414
1515 "gopkg.in/yaml.v3"
1616
17- helmEngine "github.com/cozystack/talm/pkg/engine/helm"
18- "github.com/cozystack/talm/pkg/yamltools"
1917 "github.com/cosi-project/runtime/pkg/resource"
2018 "github.com/cosi-project/runtime/pkg/resource/meta"
19+ helmEngine "github.com/cozystack/talm/pkg/engine/helm"
20+ "github.com/cozystack/talm/pkg/yamltools"
2121 "github.com/hashicorp/go-multierror"
2222 "helm.sh/helm/v3/pkg/chart"
2323 "helm.sh/helm/v3/pkg/chart/loader"
@@ -95,26 +95,26 @@ func debugPhase(opts Options, patches []string, clusterName string, clusterEndpo
9595}
9696
9797// FullConfigProcess handles the full process of creating and updating the Bundle.
98- func FullConfigProcess (ctx context.Context , opts Options , patches []string ) (* bundle.Bundle , error ) {
98+ func FullConfigProcess (ctx context.Context , opts Options , patches []string ) (* bundle.Bundle , machine. Type , error ) {
9999 configBundle , err := InitializeConfigBundle (opts )
100100 if err != nil {
101- return nil , fmt .Errorf ("initial config bundle error: %w" , err )
101+ return nil , machine . TypeUnknown , fmt .Errorf ("initial config bundle error: %w" , err )
102102 }
103103
104104 loadedPatches , err := configpatcher .LoadPatches (patches )
105105 if err != nil {
106106 if opts .Debug {
107107 debugPhase (opts , patches , "" , "" , machine .TypeUnknown )
108108 }
109- return nil , err
109+ return nil , machine . TypeUnknown , err
110110 }
111111
112112 err = configBundle .ApplyPatches (loadedPatches , true , false )
113113 if err != nil {
114114 if opts .Debug {
115115 debugPhase (opts , patches , "" , "" , machine .TypeUnknown )
116116 }
117- return nil , fmt .Errorf ("apply initial patches error: %w" , err )
117+ return nil , machine . TypeUnknown , fmt .Errorf ("apply initial patches error: %w" , err )
118118 }
119119
120120 // Updating parameters after applying patches
@@ -140,16 +140,16 @@ func FullConfigProcess(ctx context.Context, opts Options, patches []string) (*bu
140140 }
141141 configBundle , err = InitializeConfigBundle (updatedOpts )
142142 if err != nil {
143- return nil , fmt .Errorf ("reinit config bundle error: %w" , err )
143+ return nil , machineType , fmt .Errorf ("reinit config bundle error: %w" , err )
144144 }
145145
146146 // Applying updated patches
147147 err = configBundle .ApplyPatches (loadedPatches , (machineType == machine .TypeControlPlane ), (machineType == machine .TypeWorker ))
148148 if err != nil {
149- return nil , fmt .Errorf ("apply updated patches error: %w" , err )
149+ return nil , machineType , fmt .Errorf ("apply updated patches error: %w" , err )
150150 }
151151
152- return configBundle , nil
152+ return configBundle , machineType , nil
153153}
154154
155155// Function to initialize configuration settings
0 commit comments