Skip to content

Commit fa8ccd5

Browse files
authored
[f5cloudexporter] Updated for upcoming client auth extension changes (#3509)
* updated f5cloudexporter for upcoming client auth extension changes * added CHANGLOG entry for the breaking change
1 parent 64b9b5e commit fa8ccd5

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
## 🛑 Breaking changes 🛑
6+
7+
- `f5cloud` exporter (#3509):
8+
- Renamed the config 'auth' field to 'f5cloud_auth'. This will prevent a config field name collision when [Support for Custom Exporter Authenticators as Extensions](https://github.com/open-telemetry/opentelemetry-collector/pull/3128) is ready to be integrated.
9+
510
## v0.27.0
611

712
# 🎉 OpenTelemetry Collector Contrib v0.27.0 (Beta) 🎉

exporter/f5cloudexporter/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ The following settings are required:
1313
- `endpoint` (no default): The URL to send data to. See your F5 Cloud account for details.
1414
- `source` (no default): A unique identifier that is used to distinguish where this data is coming from (e.g. dev_cluster). This is in
1515
addition to the pipeline attributes and resources.
16-
- `auth.credential_file` (no default): Path to the credential file used to authenticate this client. See your F5
16+
- `f5cloud_auth.credential_file` (no default): Path to the credential file used to authenticate this client. See your F5
1717
Cloud account for details.
1818

1919
The following settings can be optionally configured:
2020

21-
- `auth.audience` (no default): Identifies the recipient that the authentication JWT is intended for. See your F5 Cloud
21+
- `f5cloud_auth.audience` (no default): Identifies the recipient that the authentication JWT is intended for. See your F5 Cloud
2222
account for details.
2323

2424
- `timeout` (default = 30s): HTTP request time limit. For details see https://golang.org/pkg/net/http/#Client
@@ -31,7 +31,7 @@ Example:
3131
f5cloud:
3232
endpoint: https://<ENDPOINT_FOUND_IN_F5_CLOUD_PORTAL>
3333
source: prod
34-
auth:
34+
f5cloud_auth:
3535
credential_file: "/etc/creds/key.json"
3636
```
3737

exporter/f5cloudexporter/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type Config struct {
3131
Source string `mapstructure:"source"`
3232

3333
// AuthConfig represents the F5 Cloud authentication configuration options.
34-
AuthConfig AuthConfig `mapstructure:"auth"`
34+
AuthConfig AuthConfig `mapstructure:"f5cloud_auth"`
3535
}
3636

3737
func (c *Config) sanitize() error {
@@ -49,11 +49,11 @@ func (c *Config) sanitize() error {
4949
}
5050

5151
if len(c.AuthConfig.CredentialFile) == 0 {
52-
return fmt.Errorf("missing required \"auth.credential_file\" setting")
52+
return fmt.Errorf("missing required \"f5cloud_auth.credential_file\" setting")
5353
}
5454

5555
if _, err := os.Stat(c.AuthConfig.CredentialFile); os.IsNotExist(err) {
56-
return fmt.Errorf("the provided \"auth.credential_file\" does not exist")
56+
return fmt.Errorf("the provided \"f5cloud_auth.credential_file\" does not exist")
5757
}
5858

5959
if len(c.AuthConfig.Audience) == 0 {

exporter/f5cloudexporter/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func TestConfig_sanitize(t *testing.T) {
119119
Source: validSource,
120120
CredentialFile: "",
121121
},
122-
errorMessage: "missing required \"auth.credential_file\" setting",
122+
errorMessage: "missing required \"f5cloud_auth.credential_file\" setting",
123123
shouldError: true,
124124
},
125125
{
@@ -129,7 +129,7 @@ func TestConfig_sanitize(t *testing.T) {
129129
Source: validSource,
130130
CredentialFile: "non-existent cred file",
131131
},
132-
errorMessage: "the provided \"auth.credential_file\" does not exist",
132+
errorMessage: "the provided \"f5cloud_auth.credential_file\" does not exist",
133133
shouldError: true,
134134
},
135135
{

exporter/f5cloudexporter/testdata/config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ exporters:
88
f5cloud:
99
endpoint: "https://f5cloud"
1010
source: "dev"
11-
auth:
11+
f5cloud_auth:
1212
credential_file: "/etc/creds/key.json"
1313
f5cloud/allsettings:
1414
endpoint: "https://f5cloud"
1515
source: "dev"
16-
auth:
16+
f5cloud_auth:
1717
credential_file: "/etc/creds/key.json"
1818
audience: "exampleaudience"
1919
timeout: 10s

0 commit comments

Comments
 (0)