@@ -397,58 +397,58 @@ function edit_manifest() {
397397 yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name==\" ENABLE_FLOW_FILTER\" ).value|=\" $2 \" " " $3 "
398398 ;;
399399 " filter_direction" )
400- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_DIRECTION \" ).value|= \" $2 \" " " $3 "
400+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.direction = \" $2 \" )| tostring) " " $3 "
401401 ;;
402402 " filter_cidr" )
403- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_IP_CIDR \" ).value|= \" $2 \" " " $3 "
403+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.ip_cidr = \" $2 \" )| tostring) " " $3 "
404404 ;;
405405 " filter_protocol" )
406- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_PROTOCOL \" ).value|= \" $2 \" " " $3 "
406+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.protocol = \" $2 \" )| tostring) " " $3 "
407407 ;;
408408 " filter_sport" )
409- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_SOURCE_PORT \" ).value|= \" $2 \" " " $3 "
409+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.source_port = $2 )| tostring) " " $3 "
410410 ;;
411411 " filter_dport" )
412- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_DESTINATION_PORT \" ).value|= \" $2 \" " " $3 "
412+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.destination_port = $2 )| tostring) " " $3 "
413413 ;;
414414 " filter_port" )
415- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_PORT \" ).value|= \" $2 \" " " $3 "
415+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.port = $2 )| tostring) " " $3 "
416416 ;;
417417 " filter_sport_range" )
418- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_SOURCE_PORT_RANGE \" ).value|= \" $2 \" " " $3 "
418+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.source_port_range = \" $2 \" )| tostring) " " $3 "
419419 ;;
420420 " filter_dport_range" )
421- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_DESTINATION_PORT_RANGE \" ).value|= \" $2 \" " " $3 "
421+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.destination_port_range = \" $2 \" )| tostring) " " $3 "
422422 ;;
423423 " filter_port_range" )
424- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_PORT_RANGE \" ).value|= \" $2 \" " " $3 "
424+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.port_range = \" $2 \" )| tostring) " " $3 "
425425 ;;
426426 " filter_sports" )
427- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_SOURCE_PORTS \" ).value|= \" $2 \" " " $3 "
427+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.source_ports = \" $2 \" )| tostring) " " $3 "
428428 ;;
429- " filter_dportS " )
430- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_DESTINATION_PORTS \" ).value|= \" $2 \" " " $3 "
429+ " filter_dports " )
430+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.destination_ports = \" $2 \" )| tostring) " " $3 "
431431 ;;
432432 " filter_ports" )
433- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_PORTS \" ).value|= \" $2 \" " " $3 "
433+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.ports = \" $2 \" )| tostring) " " $3 "
434434 ;;
435435 " filter_icmp_type" )
436- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_ICMP_TYPE \" ).value|= \" $2 \" " " $3 "
436+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.icmp_type = $2 )| tostring) " " $3 "
437437 ;;
438438 " filter_icmp_code" )
439- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_ICMP_CODE \" ).value|= \" $2 \" " " $3 "
439+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.icmp_code = $2 )| tostring) " " $3 "
440440 ;;
441441 " filter_peer_ip" )
442- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_PEER_IP \" ).value|= \" $2 \" " " $3 "
442+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.peer_ip = \" $2 \" )| tostring) " " $3 "
443443 ;;
444444 " filter_action" )
445- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_ACTION \" ).value|= \" $2 \" " " $3 "
445+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.action = \" $2 \" )| tostring) " " $3 "
446446 ;;
447447 " filter_tcp_flags" )
448- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_TCP_FLAGS \" ).value|= \" $2 \" " " $3 "
448+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.tcp_flags = \" $2 \" )| tostring) " " $3 "
449449 ;;
450450 " filter_pkt_drops" )
451- yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name== \" FILTER_DROPS \" ).value|= \" $2 \" " " $3 "
451+ yq e --inplace " .spec.template.spec.containers[0].env[] |= select(.name == \" FLOW_FILTER_RULES \" ).value |=(fromjson | map(.drops = $2 )| tostring) " " $3 "
452452 ;;
453453 " filter_regexes" )
454454 copyFLPConfig " $3 "
0 commit comments