diff --git a/client/system/detect_cloud/detect.go b/client/system/detect_cloud/detect.go index 3bbff434580..8a8de763eb2 100644 --- a/client/system/detect_cloud/detect.go +++ b/client/system/detect_cloud/detect.go @@ -25,8 +25,6 @@ func Detect(ctx context.Context) string { detectDigitalOcean, detectGCP, detectOracle, - detectIBMCloud, - detectSoftlayer, detectVultr, } diff --git a/client/system/detect_cloud/gcp.go b/client/system/detect_cloud/gcp.go index c673f893739..a24c38c0c6b 100644 --- a/client/system/detect_cloud/gcp.go +++ b/client/system/detect_cloud/gcp.go @@ -6,7 +6,7 @@ import ( ) func detectGCP(ctx context.Context) string { - req, err := http.NewRequestWithContext(ctx, "GET", "http://metadata.google.internal", nil) + req, err := http.NewRequestWithContext(ctx, "GET", "http://169.254.169.254", nil) if err != nil { return "" } diff --git a/client/system/detect_cloud/ibmcloud.go b/client/system/detect_cloud/ibmcloud.go deleted file mode 100644 index 07de6a2ee11..00000000000 --- a/client/system/detect_cloud/ibmcloud.go +++ /dev/null @@ -1,54 +0,0 @@ -package detect_cloud - -import ( - "context" - "net/http" -) - -func detectIBMCloud(ctx context.Context) string { - v1ResultChan := make(chan bool, 1) - v2ResultChan := make(chan bool, 1) - - go func() { - v1ResultChan <- detectIBMSecure(ctx) - }() - - go func() { - v2ResultChan <- detectIBM(ctx) - }() - - v1Result, v2Result := <-v1ResultChan, <-v2ResultChan - - if v1Result || v2Result { - return "IBM Cloud" - } - return "" -} - -func detectIBMSecure(ctx context.Context) bool { - req, err := http.NewRequestWithContext(ctx, "PUT", "https://api.metadata.cloud.ibm.com/instance_identity/v1/token", nil) - if err != nil { - return false - } - - resp, err := hc.Do(req) - if err != nil { - return false - } - defer resp.Body.Close() - return resp.StatusCode == http.StatusOK -} - -func detectIBM(ctx context.Context) bool { - req, err := http.NewRequestWithContext(ctx, "PUT", "http://api.metadata.cloud.ibm.com/instance_identity/v1/token", nil) - if err != nil { - return false - } - - resp, err := hc.Do(req) - if err != nil { - return false - } - defer resp.Body.Close() - return resp.StatusCode == http.StatusOK -} diff --git a/client/system/detect_cloud/softlayer.go b/client/system/detect_cloud/softlayer.go deleted file mode 100644 index a09b522c454..00000000000 --- a/client/system/detect_cloud/softlayer.go +++ /dev/null @@ -1,25 +0,0 @@ -package detect_cloud - -import ( - "context" - "net/http" -) - -func detectSoftlayer(ctx context.Context) string { - req, err := http.NewRequestWithContext(ctx, "GET", "https://api.service.softlayer.com/rest/v3/SoftLayer_Resource_Metadata/UserMetadata.txt", nil) - if err != nil { - return "" - } - - resp, err := hc.Do(req) - if err != nil { - return "" - } - defer resp.Body.Close() - - if resp.StatusCode == http.StatusOK { - // Since SoftLayer was acquired by IBM, we should return "IBM Cloud" - return "IBM Cloud" - } - return "" -}