Skip to content

Commit df2023f

Browse files
authored
Merge pull request #466 from redhatrises/cloud_updates
2 parents 7f09b1f + f1ec108 commit df2023f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

falcon/cloud.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,21 @@ func Cloud(cloudString string) CloudType {
3232
// CloudValidate parses cloud string (example: us-1, us-2, eu-1, us-gov-1, etc.). Error is returned when string cannot be recognized.
3333
func CloudValidate(cloudString string) (CloudType, error) {
3434
trimmed := strings.TrimSpace(cloudString)
35-
lower := strings.ToLower(trimmed)
35+
stripped := strings.ReplaceAll(trimmed, "-", "")
36+
lower := strings.ToLower(stripped)
37+
3638
switch lower {
3739
case "":
3840
fallthrough
3941
case "autodiscover":
4042
return CloudAutoDiscover, nil
41-
case "us-1":
43+
case "us1":
4244
return CloudUs1, nil
43-
case "us-2":
45+
case "us2":
4446
return CloudUs2, nil
45-
case "eu-1":
47+
case "eu1":
4648
return CloudEu1, nil
47-
case "us-gov-1":
49+
case "usgov1":
4850
return CloudUsGov1, nil
4951
case "gov1":
5052
return CloudGov1, nil

falcon/containers.go

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ func FalconContainerUploadURI(falconCloud CloudType) string {
3838
}
3939

4040
// FalconContainerSensorImageURI returns a URI for downloading a container sensor image. Defaults to the falcon-sensor image.
41+
// When the Falcon Cloud CloudType is set to CloudAutoDiscover, be sure to provide the results of ApiConfig.Cloud after the client
42+
// has been initialized to ensure the correct CloudType is used and not CloudAutoDiscover.
4143
func FalconContainerSensorImageURI(falconCloud CloudType, sensorType SensorType) string {
4244
switch sensorType {
4345
case SidecarSensor:

0 commit comments

Comments
 (0)