Skip to content

Commit

Permalink
input: add support for upstream configuration for input client plugins.
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan committed Nov 7, 2023
1 parent d1fec26 commit b436fa6
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/flb_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <fluent-bit/flb_metrics.h>
#include <fluent-bit/flb_storage.h>
#include <fluent-bit/flb_downstream.h>
#include <fluent-bit/flb_upstream.h>
#include <fluent-bit/flb_plugin.h>
#include <fluent-bit/flb_kv.h>
#include <fluent-bit/flb_hash_table.h>
Expand Down Expand Up @@ -853,11 +854,20 @@ int flb_input_net_property_check(struct flb_input_instance *ins,
{
int ret = 0;

/* Get Downstream net_setup configmap */
ins->net_config_map = flb_downstream_get_config_map(config);
if (!ins->net_config_map) {
flb_input_instance_destroy(ins);
return -1;
/* Get Downstream or Upstream net_setup configmap */
if (ins->p->flags & FLB_INPUT_NET_SERVER) {
ins->net_config_map = flb_downstream_get_config_map(config);
if (!ins->net_config_map) {
flb_input_instance_destroy(ins);
return -1;
}
}
else if (ins->p->flags & FLB_INPUT_NET) {
ins->net_config_map = flb_upstream_get_config_map(config);
if (!ins->net_config_map) {
flb_input_instance_destroy(ins);
return -1;
}
}

/*
Expand Down

0 comments on commit b436fa6

Please sign in to comment.