Skip to content

Commit 0693cd2

Browse files
authored
Set filename for EDOT remote configuration (#598)
* Set filename for EDOT remote configuration * Config filename as a constant
1 parent 0c3e42e commit 0693cd2

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

extension/apmconfigextension/elastic/centralconfig/fetcher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
)
3131

3232
const configContentType = "text/json"
33+
const configFileName = "elastic"
3334

3435
var _ apmconfig.RemoteConfigClient = (*fetcherAPMWatcher)(nil)
3536

@@ -75,7 +76,7 @@ func (fw *fetcherAPMWatcher) RemoteConfig(ctx context.Context, agentUid apmconfi
7576

7677
return &protobufs.AgentRemoteConfig{ConfigHash: []byte(result.Source.Etag), Config: &protobufs.AgentConfigMap{
7778
ConfigMap: map[string]*protobufs.AgentConfigFile{
78-
"": {
79+
configFileName: {
7980
Body: marshallConfig,
8081
ContentType: configContentType,
8182
},

extension/apmconfigextension/elastic/centralconfig/fetcher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func TestRemoteConfig(t *testing.T) {
9090
ConfigHash: []byte("abcd"),
9191
Config: &protobufs.AgentConfigMap{
9292
ConfigMap: map[string]*protobufs.AgentConfigFile{
93-
"": {
93+
"elastic": {
9494
Body: []byte(`{"test":"aaa"}`),
9595
ContentType: "text/json",
9696
},

extension/apmconfigextension/integration_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func apmConfigintegrationTest(name string) func(t *testing.T) {
143143
ConfigHash: []byte("abcd"),
144144
Config: &protobufs.AgentConfigMap{
145145
ConfigMap: map[string]*protobufs.AgentConfigFile{
146-
"": {
146+
"elastic": {
147147
Body: []byte(`{"transaction_max_spans":"124"}`),
148148
ContentType: "text/json",
149149
},
@@ -193,7 +193,7 @@ func apmConfigintegrationTest(name string) func(t *testing.T) {
193193
ConfigHash: []byte("abcd"),
194194
Config: &protobufs.AgentConfigMap{
195195
ConfigMap: map[string]*protobufs.AgentConfigFile{
196-
"": {
196+
"elastic": {
197197
Body: []byte(`{"transaction_max_spans":"124"}`),
198198
ContentType: "text/json",
199199
},
@@ -247,7 +247,7 @@ func apmConfigintegrationTest(name string) func(t *testing.T) {
247247
ConfigHash: []byte("abcd"),
248248
Config: &protobufs.AgentConfigMap{
249249
ConfigMap: map[string]*protobufs.AgentConfigFile{
250-
"": {
250+
"elastic": {
251251
Body: []byte(`{"transaction_max_spans":"2"}`),
252252
ContentType: "text/json",
253253
},
@@ -332,7 +332,7 @@ func apmConfigintegrationTest(name string) func(t *testing.T) {
332332
ConfigHash: []byte("abcd"),
333333
Config: &protobufs.AgentConfigMap{
334334
ConfigMap: map[string]*protobufs.AgentConfigFile{
335-
"": {
335+
"elastic": {
336336
Body: []byte(`{"transaction_max_spans":"2"}`),
337337
ContentType: "text/json",
338338
},

extension/apmconfigextension/opamp_callbacks_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func TestOnMessage(t *testing.T) {
125125
ConfigHash: []byte("abcd"),
126126
Config: &protobufs.AgentConfigMap{
127127
ConfigMap: map[string]*protobufs.AgentConfigFile{
128-
"": {
128+
"elastic": {
129129
Body: []byte(`{"test":"aaa"}`),
130130
ContentType: "text/json",
131131
},
@@ -154,7 +154,7 @@ func TestOnMessage(t *testing.T) {
154154
ConfigHash: []byte("abcd"),
155155
Config: &protobufs.AgentConfigMap{
156156
ConfigMap: map[string]*protobufs.AgentConfigFile{
157-
"": {
157+
"elastic": {
158158
ContentType: "text/json",
159159
Body: []byte(`{"test":"aaa"}`),
160160
},
@@ -181,7 +181,7 @@ func TestOnMessage(t *testing.T) {
181181
ConfigHash: []byte("abcd"),
182182
Config: &protobufs.AgentConfigMap{
183183
ConfigMap: map[string]*protobufs.AgentConfigFile{
184-
"": {
184+
"elastic": {
185185
Body: []byte(`{"test":"aaa"}`),
186186
ContentType: "text/json",
187187
},
@@ -197,7 +197,7 @@ func TestOnMessage(t *testing.T) {
197197
ConfigHash: []byte("abcd"),
198198
Config: &protobufs.AgentConfigMap{
199199
ConfigMap: map[string]*protobufs.AgentConfigFile{
200-
"": {
200+
"elastic": {
201201
ContentType: "text/json",
202202
Body: []byte(`{"test":"aaa"}`),
203203
},
@@ -224,7 +224,7 @@ func TestOnMessage(t *testing.T) {
224224
ConfigHash: []byte("abcd"),
225225
Config: &protobufs.AgentConfigMap{
226226
ConfigMap: map[string]*protobufs.AgentConfigFile{
227-
"": {
227+
"elastic": {
228228
Body: []byte(`{"test":"aaa"}`),
229229
ContentType: "text/json",
230230
},
@@ -240,7 +240,7 @@ func TestOnMessage(t *testing.T) {
240240
ConfigHash: []byte("abcd"),
241241
Config: &protobufs.AgentConfigMap{
242242
ConfigMap: map[string]*protobufs.AgentConfigFile{
243-
"": {
243+
"elastic": {
244244
ContentType: "text/json",
245245
Body: []byte(`{"test":"aaa"}`),
246246
},
@@ -272,7 +272,7 @@ func TestOnMessage(t *testing.T) {
272272
ConfigHash: []byte("abcd"),
273273
Config: &protobufs.AgentConfigMap{
274274
ConfigMap: map[string]*protobufs.AgentConfigFile{
275-
"": {
275+
"elastic": {
276276
ContentType: "text/json",
277277
Body: []byte(`{"test":"aaa"}`),
278278
},

0 commit comments

Comments
 (0)