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
1 change: 1 addition & 0 deletions plugins/filter_kubernetes/kube_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct flb_kube {
int annotations;
int namespace_labels;
int namespace_annotations;
int namespace_metadata_only;
int dummy_meta;
int tls_debug;
int tls_verify;
Expand Down
2 changes: 1 addition & 1 deletion plugins/filter_kubernetes/kube_meta.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ int flb_kube_meta_get(struct flb_kube *ctx,
data_size, namespace_out_buf, namespace_out_size, namespace_meta);
}

if(ctx->labels == FLB_TRUE || ctx->annotations == FLB_TRUE) {
if(ctx->namespace_metadata_only == FLB_FALSE) {
ret_pod_meta = flb_kube_pod_meta_get(ctx, tag, tag_len, data, data_size,
out_buf, out_size, meta, props);
}
Expand Down
6 changes: 6 additions & 0 deletions plugins/filter_kubernetes/kubernetes.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,12 @@ static struct flb_config_map config_map[] = {
0, FLB_TRUE, offsetof(struct flb_kube, namespace_annotations),
"include Kubernetes namespace annotations on every record"
},
/* Ignore pod metadata entirely, useful for fetching only namespace meta */
{
FLB_CONFIG_MAP_BOOL, "namespace_metadata_only", "false",
0, FLB_TRUE, offsetof(struct flb_kube, namespace_metadata_only),
"ignore pod metadata entirely and only fetch namespace metadata"
},

/*
* The Application may 'propose' special configuration keys
Expand Down