@@ -10,6 +10,7 @@ import (
10
10
"strings"
11
11
"time"
12
12
13
+ retryablehttp "github.com/hashicorp/go-retryablehttp"
13
14
"github.com/spf13/cobra"
14
15
"gopkg.in/yaml.v2"
15
16
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -62,7 +63,7 @@ func NewClusterMigrateMultinodeStorageCmd(cli CLI) *cobra.Command {
62
63
// getEkcoMigrationLogs returns the logs of the migration as reported back by ekco.
63
64
func getEkcoMigrationLogs (opts migrateOpts ) (string , error ) {
64
65
url := fmt .Sprintf ("http://%s/storagemigration/logs" , opts .ekcoAddress )
65
- resp , err := http .Get (url )
66
+ resp , err := retryablehttp .Get (url )
66
67
if err != nil {
67
68
return "" , fmt .Errorf ("failed to get migration logs: %w" , err )
68
69
}
@@ -77,7 +78,7 @@ func getEkcoMigrationLogs(opts migrateOpts) (string, error) {
77
78
// getEkcoMigrationStatus returns the status of the storage migration as reported back by ekco.
78
79
func getEkcoMigrationStatus (opts migrateOpts ) (string , error ) {
79
80
url := fmt .Sprintf ("http://%s/storagemigration/status" , opts .ekcoAddress )
80
- resp , err := http .Get (url )
81
+ resp , err := retryablehttp .Get (url )
81
82
if err != nil {
82
83
return "" , fmt .Errorf ("failed to get migration status: %w" , err )
83
84
}
@@ -107,7 +108,7 @@ type MigrationReadyStatus struct {
107
108
108
109
func isClusterReadyForStorageMigration (opts migrateOpts ) (* ClusterReadyStatus , error ) {
109
110
url := fmt .Sprintf ("http://%s/storagemigration/cluster-ready" , opts .ekcoAddress )
110
- resp , err := http .Get (url )
111
+ resp , err := retryablehttp .Get (url )
111
112
if err != nil {
112
113
return nil , fmt .Errorf ("failed to get ekco cluster ready status: %w" , err )
113
114
}
@@ -129,7 +130,7 @@ func isClusterReadyForStorageMigration(opts migrateOpts) (*ClusterReadyStatus, e
129
130
130
131
func isEkcoReadyForStorageMigration (opts migrateOpts ) (* MigrationReadyStatus , error ) {
131
132
url := fmt .Sprintf ("http://%s/storagemigration/ready" , opts .ekcoAddress )
132
- resp , err := http .Get (url )
133
+ resp , err := retryablehttp .Get (url )
133
134
if err != nil {
134
135
return nil , fmt .Errorf ("failed to get ekco status: %w" , err )
135
136
}
0 commit comments