@@ -146,7 +146,7 @@ func InstallWatchComponentByHelm(ctx context.Context, projectID,
146
146
blog .Errorf ("InstallWatchComponentByHelm[%s] GetWatchInstaller failed: %v" , taskID , err )
147
147
return err
148
148
}
149
- err = installer .Install (clusterID , values )
149
+ err = installer .Install (ctx , clusterID , values )
150
150
if err != nil {
151
151
blog .Errorf ("InstallWatchComponentByHelm[%s] Install failed: %v" , taskID , err )
152
152
return err
@@ -166,7 +166,7 @@ func DeleteWatchComponentByHelm(ctx context.Context, projectID,
166
166
blog .Errorf ("DeleteWatchComponentByHelm[%s] GetWatchInstaller failed: %v" , traceID , err )
167
167
return err
168
168
}
169
- err = install .Uninstall (clusterID )
169
+ err = install .Uninstall (ctx , clusterID )
170
170
if err != nil {
171
171
blog .Errorf ("DeleteWatchComponentByHelm[%s] Uninstall failed: %v" , traceID , err )
172
172
return err
@@ -178,7 +178,7 @@ func DeleteWatchComponentByHelm(ctx context.Context, projectID,
178
178
179
179
err = loop .LoopDoFunc (timeContext , func () error {
180
180
var exist bool
181
- exist , err = install .IsInstalled (clusterID )
181
+ exist , err = install .IsInstalled (ctx , clusterID )
182
182
if err != nil {
183
183
blog .Errorf ("DeleteWatchComponentByHelm[%s] failed[%s:%s]: %v" , traceID , projectID , clusterID , err )
184
184
return nil
@@ -260,7 +260,7 @@ func InstallImagePullSecretByAddon(ctx context.Context, projectID, clusterID str
260
260
blog .Errorf ("InstallImagePullSecretByAddon[%s] GetAddonInstaller failed: %v" , taskID , err )
261
261
return err
262
262
}
263
- err = installer .Install (clusterID , "" )
263
+ err = installer .Install (ctx , clusterID , "" )
264
264
if err != nil {
265
265
blog .Errorf ("InstallImagePullSecretByAddon[%s] Install failed: %v" , taskID , err )
266
266
return err
@@ -280,7 +280,7 @@ func DeleteImagePullSecretByAddon(ctx context.Context, projectID,
280
280
blog .Errorf ("DeleteImagePullSecretByAddon[%s] GetAddonInstaller failed: %v" , traceID , err )
281
281
return err
282
282
}
283
- err = install .Uninstall (clusterID )
283
+ err = install .Uninstall (ctx , clusterID )
284
284
if err != nil {
285
285
blog .Errorf ("DeleteImagePullSecretByAddon[%s] Uninstall failed: %v" , traceID , err )
286
286
return err
@@ -474,7 +474,7 @@ func ensureVclusterWithInstaller(ctx context.Context, info *VclusterInfo) error
474
474
blog .Errorf ("ensureVclusterWithInstaller[%s] GetVclusterInstaller failed: %v" , taskID , err )
475
475
return err
476
476
}
477
- installed , err := installer .IsInstalled (info .SrcClusterID )
477
+ installed , err := installer .IsInstalled (ctx , info .SrcClusterID )
478
478
if err != nil {
479
479
blog .Errorf ("ensureVclusterWithInstaller[%s] IsInstalled failed: %v" , taskID , err )
480
480
return err
@@ -498,17 +498,17 @@ func ensureVclusterWithInstaller(ctx context.Context, info *VclusterInfo) error
498
498
499
499
// install or upgrade
500
500
if installed {
501
- if errUpgrade := installer .Upgrade (info .SrcClusterID , values ); errUpgrade != nil {
501
+ if errUpgrade := installer .Upgrade (ctx , info .SrcClusterID , values ); errUpgrade != nil {
502
502
return fmt .Errorf ("upgrade app failed, err %s" , errUpgrade )
503
503
}
504
504
} else {
505
- if errInstall := installer .Install (info .SrcClusterID , values ); errInstall != nil {
505
+ if errInstall := installer .Install (ctx , info .SrcClusterID , values ); errInstall != nil {
506
506
return fmt .Errorf ("install app failed, err %s" , errInstall )
507
507
}
508
508
}
509
509
510
510
// check status
511
- ok , err := installer .CheckAppStatus (info .SrcClusterID , time .Minute * 10 , false )
511
+ ok , err := installer .CheckAppStatus (ctx , info .SrcClusterID , time .Minute * 10 , false )
512
512
if err != nil {
513
513
return fmt .Errorf ("check app status failed, err %s" , err )
514
514
}
@@ -596,7 +596,7 @@ func DeleteVclusterComponentByHelm(ctx context.Context, info *VclusterInfo) erro
596
596
blog .Errorf ("DeleteVclusterComponentByHelm[%s] GetVclusterInstaller failed: %v" , taskID , err )
597
597
return err
598
598
}
599
- err = install .Uninstall (info .SrcClusterID )
599
+ err = install .Uninstall (ctx , info .SrcClusterID )
600
600
if err != nil {
601
601
blog .Errorf ("DeleteVclusterComponentByHelm[%s] Uninstall failed: %v" , taskID , err )
602
602
return err
@@ -607,7 +607,7 @@ func DeleteVclusterComponentByHelm(ctx context.Context, info *VclusterInfo) erro
607
607
defer cancel ()
608
608
609
609
err = loop .LoopDoFunc (timeContext , func () error {
610
- exist , errInstall := install .IsInstalled (info .SrcClusterID )
610
+ exist , errInstall := install .IsInstalled (ctx , info .SrcClusterID )
611
611
if errInstall != nil {
612
612
blog .Errorf ("DeleteVclusterComponentByHelm[%s] failed[%s:%s]: %v" , taskID , info .ProjectID ,
613
613
info .SrcClusterID , errInstall )
@@ -749,7 +749,7 @@ func ensureAutoScalerWithInstaller(ctx context.Context, nodeGroups []proto.NodeG
749
749
blog .Errorf ("ensureAutoScalerWithInstaller[%s] CreateClusterNamespace failed: %v" , taskID , err )
750
750
}
751
751
752
- installed , err := installer .IsInstalled (as .ClusterID )
752
+ installed , err := installer .IsInstalled (ctx , as .ClusterID )
753
753
if err != nil {
754
754
blog .Errorf ("ensureAutoScalerWithInstaller IsInstalled failed: %v" , err )
755
755
return err
@@ -776,14 +776,14 @@ func ensureAutoScalerWithInstaller(ctx context.Context, nodeGroups []proto.NodeG
776
776
}
777
777
// install or upgrade
778
778
if installed {
779
- if err = installer .Upgrade (as .ClusterID , values ); err != nil {
779
+ if err = installer .Upgrade (ctx , as .ClusterID , values ); err != nil {
780
780
return fmt .Errorf ("upgrade app failed, err %s" , err )
781
781
}
782
782
783
783
cloudprovider .GetStorageModel ().CreateTaskStepLogInfo (context .Background (),
784
784
taskID , stepName , "upgrade app successful" )
785
785
} else {
786
- if err = installer .Install (as .ClusterID , values ); err != nil {
786
+ if err = installer .Install (ctx , as .ClusterID , values ); err != nil {
787
787
return fmt .Errorf ("install app failed, err %s" , err )
788
788
}
789
789
@@ -793,7 +793,7 @@ func ensureAutoScalerWithInstaller(ctx context.Context, nodeGroups []proto.NodeG
793
793
794
794
// check status
795
795
var ok bool
796
- ok , err = installer .CheckAppStatus (as .ClusterID , time .Minute * 10 , false )
796
+ ok , err = installer .CheckAppStatus (ctx , as .ClusterID , time .Minute * 10 , false )
797
797
if err != nil {
798
798
return fmt .Errorf ("check app status failed, err %s" , err )
799
799
}
@@ -814,11 +814,11 @@ func ensureAutoScalerWithInstaller(ctx context.Context, nodeGroups []proto.NodeG
814
814
return fmt .Errorf ("transAutoScalingOptionToValues failed, err: %s" , err )
815
815
}
816
816
817
- if err = installer .Upgrade (as .ClusterID , values ); err != nil {
817
+ if err = installer .Upgrade (ctx , as .ClusterID , values ); err != nil {
818
818
return fmt .Errorf ("upgrade app failed, err %s" , err )
819
819
}
820
820
// check status
821
- ok , errCheck := installer .CheckAppStatus (as .ClusterID , time .Minute * 10 , false )
821
+ ok , errCheck := installer .CheckAppStatus (ctx , as .ClusterID , time .Minute * 10 , false )
822
822
if errCheck != nil {
823
823
return fmt .Errorf ("check app status failed, err %s" , err )
824
824
}
0 commit comments