Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func (c *actionsController) update(updates map[string]state.RawConfig, applyStat
}

actionsMap["run_once"] = true
actionsMap["remote_config_id"] = parsed.remoteConfigID
for k, v := range auth {
actionsMap[k] = v
}
Expand Down Expand Up @@ -182,6 +183,7 @@ type parsedActionsConfig struct {
path string
bootstrapServers string
actionsJSON json.RawMessage
remoteConfigID string
}

func parseActionsConfig(updates map[string]state.RawConfig, applyStateCallback func(string, state.ApplyStatus)) []parsedActionsConfig {
Expand All @@ -205,6 +207,7 @@ func parseActionsConfig(updates map[string]state.RawConfig, applyStateCallback f
path: path,
bootstrapServers: bootstrapServers,
actionsJSON: cfg.Actions,
remoteConfigID: rawConfig.Metadata.ID,
})
}
return configs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestActionsController(t *testing.T) {

rcUpdate := map[string]state.RawConfig{
"config_1": {Config: []byte("invalid")},
"config_2": {Config: serializedConfig},
"config_2": {Config: serializedConfig, Metadata: state.Metadata{ID: "test_remote_config_id"}},
}

updateStatus := make(map[string]state.ApplyStatus)
Expand Down Expand Up @@ -133,6 +133,9 @@ func TestActionsController(t *testing.T) {
// Check that run_once was injected
assert.Equal(t, true, instance["run_once"])

// Check that remote_config_id was injected
assert.Equal(t, "test_remote_config_id", instance["remote_config_id"])

// Check that actions are present
assert.NotNil(t, instance["read_messages"])
}
Expand Down Expand Up @@ -167,7 +170,7 @@ func TestActionsControllerNoBootstrapServers(t *testing.T) {
require.NoError(t, err)

rcUpdate := map[string]state.RawConfig{
"config_1": {Config: serializedConfig},
"config_1": {Config: serializedConfig, Metadata: state.Metadata{ID: "no_bootstrap_test_id"}},
}

updateStatus := make(map[string]state.ApplyStatus)
Expand Down Expand Up @@ -204,7 +207,7 @@ func TestActionsControllerNoMatchingKafkaConsumer(t *testing.T) {
require.NoError(t, err)

rcUpdate := map[string]state.RawConfig{
"config_1": {Config: serializedConfig},
"config_1": {Config: serializedConfig, Metadata: state.Metadata{ID: "no_match_test_id"}},
}

updateStatus := make(map[string]state.ApplyStatus)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enhancements:
- Add remote config ID tagging to events generated by kafka_action integration for easy UI filtering