filter_kubernetes: fix code indentation and proper break on spec found
@@ -376,13 +376,11 @@ static int merge_meta(char *reg_buf, size_t reg_size,
if (spec_found == FLB_TRUE) {
for (i = 0; i < spec_val.via.map.size; i++) {
k = spec_val.via.map.ptr[i].key;
-
- char *ptr = (char *) k.via.str.ptr;
- size_t size = k.via.str.size;
-
- if (size == 8 && strncmp(ptr, "nodeName", 8) == 0) {
+ if (k.via.str.size == 8 &&
+ strncmp(k.via.str.ptr, "nodeName", 8) == 0) {
have_nodename = i;
map_size++;
+ break;
}
}
}
