[pve-devel] [PATCH pve-network] zones: simple|evpn : only enable ip-forward if gateway is defined on the subnet

Thomas Lamprecht t.lamprecht at proxmox.com
Mon May 10 09:36:46 CEST 2021


On 10.05.21 08:40, Alexandre Derumier wrote:
> diff --git a/test/zones/simple/ipv4v6nogateway/sdn_config b/test/zones/simple/ipv4v6nogateway/sdn_config
> new file mode 100644
> index 0000000..dbd75c9
> --- /dev/null
> +++ b/test/zones/simple/ipv4v6nogateway/sdn_config
> @@ -0,0 +1,25 @@
> +{
> +  version => 1,
> +  vnets   => {
> +               ids => {
> +                        myvnet => { type => "vnet", zone => "myzone" },
> +                      },
> +             },
> +  zones   => {
> +               ids => { myzone => { ipam => "pve", type => "simple" } },
> +             },
> +  subnets => {
> +		ids => {
> +			'myzone-192.168.0.0-24' => {
> +							'type' => 'subnet',
> +							'vnet' => 'myvnet',
> +						},
> +			'myzone-2a08:2142:302:3::-64' => {
> +							'type' => 'subnet',
> +							'vnet' => 'myvnet',
> +							}
> +		}
> +             }
> +}

In general:
can we please format this "pretty" human-readable?

Also, anything against switching that to JSON? I do not really like the eval on
file content in the test framework and the original running config is also in JSON...

I could just do that with a simple perl script like
perl -MJSON -e 'my $d=""; while(<>) {$d .= $_;} print to_json(eval $d, {pretty=>1,canonical=>1});' FILEs...
put in a bash loop.





More information about the pve-devel mailing list