Skip to content

Commit e909871

Browse files
authored
Merge pull request #272 from cloudability/add-gov-support
add upload support for us-gov-west-1
2 parents dc98f6d + 18eae6f commit e909871

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Cloudability Metrics Agent currently does not support Rancher or On Prem cluster
5656
| CLOUDABILITY_INFORMER_RESYNC_INTERVAL | Optional: Period of time (in hours) that the informers will fully resync the list of running resources. Default: 24 hours. Can be set to 0 to never resync |
5757
| CLOUDABILITY_PARSE_METRIC_DATA | Optional: When true, core files will be parsed and non-relevant data will be removed prior to upload. Default: `false` |
5858
| CLOUDABILITY_HTTPS_CLIENT_TIMEOUT | Optional: Amount (in seconds) of time the http client has before timing out requests. Might need to be increased to clusters with large payloads. Default: `60` |
59-
| CLOUDABILITY_UPLOAD_REGION | Optional: The region the metrics-agent will upload data to. Default `us-west-2`. Supported values: `us-west-2`, `eu-central-1`, `ap-southeast-2`, `me-central-1` |
59+
| CLOUDABILITY_UPLOAD_REGION | Optional: The region the metrics-agent will upload data to. Default `us-west-2`. Supported values: `us-west-2`, `eu-central-1`, `ap-southeast-2`, `me-central-1`, `us-gov-west-1` |
6060
| CLOUDABILITY_CUSTOM_S3_BUCKET | Optional: A custom S3 bucket the metrics-agent will upload data to. If set, the metrics-agent will ONLY upload to this custom location. CLOUDABILITY_CUSTOM_S3_REGION is REQUIRED if this is set. |
6161
| CLOUDABILITY_CUSTOM_S3_REGION | Optional: The AWS region that the custom s3 bucket is in. This will initialize the correct region for the s3 client. CLOUDABILITY_CUSTOM_S3_BUCKET is REQUIRED if this is set. |
6262

charts/metrics-agent/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ type: application
1414

1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
17-
version: 2.11.31
17+
version: 2.11.32
1818

1919
# This is the version number of the application being deployed. This version number should be
2020
# incremented each time you make changes to the application.
21-
appVersion: 2.11.31
21+
appVersion: 2.11.32

charts/metrics-agent/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pollInterval: 180
2424

2525
image:
2626
name: cloudability/metrics-agent
27-
tag: 2.11.31
27+
tag: 2.11.32
2828
pullPolicy: Always
2929

3030
imagePullSecrets: []

client/client.go

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const DefaultBaseURL string = "https://metrics-collector.cloudability.com/metric
3434
const EUBaseURL string = "https://metrics-collector-eu.cloudability.com/metricsample"
3535
const AUBaseURL string = "https://metrics-collector-au.cloudability.com/metricsample"
3636
const MEBaseURL string = "https://metrics-collector-me.cloudability.com/metricsample"
37+
const GovBaseURL string = "https://metrics-collector-gov.cloudability.com/metricsample"
3738
const defaultTimeout = 1 * time.Minute
3839
const defaultMaxRetries = 5
3940

@@ -423,6 +424,8 @@ func GetUploadURLByRegion(region string) string {
423424
return MEBaseURL
424425
case "us-west-2":
425426
return DefaultBaseURL
427+
case "us-gov-west-1":
428+
return GovBaseURL
426429
default:
427430
log.Warnf("Region %s is not supported. Defaulting to us-west-2 region.", region)
428431
return DefaultBaseURL

client/client_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@ func Test_getUploadURLByRegion(t *testing.T) {
553553
if uploadURL != client.MEBaseURL {
554554
t.Error("ME URL was not generated correctly")
555555
}
556+
uploadURL = client.GetUploadURLByRegion("us-gov-west-1")
557+
if uploadURL != client.GovBaseURL {
558+
t.Error("Gov URL was not generated correctly")
559+
}
556560
// unsupported region should default to us-west-2 url generation
557561
uploadURL = client.GetUploadURLByRegion("my-unsupported-region-1")
558562
if uploadURL != client.DefaultBaseURL {

version/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
package version
22

33
// VERSION is the current version of the agent
4-
var VERSION = "2.11.31"
4+
var VERSION = "2.11.32"

0 commit comments

Comments
 (0)