BastilleBSD / bastille

Bastille is an open-source system for automating deployment and management of containerized applications on FreeBSD.
https://bastillebsd.org
BSD 3-Clause "New" or "Revised" License
856 stars 138 forks source link

[BUG] Error listing jails with both ipv6 and ipv4 addresses #583

Open andy-isoc opened 1 year ago

andy-isoc commented 1 year ago

We are creating our jails with both v4 and v6 addresses, config such as

  interface = lo2;
  ip4.addr = lo2|192.168.1.1;
  interface = lo1;
  ip4.addr += lo1|127.0.1.1;
  ip6.addr = lo2|2a02:c206:2103:9465::1/128;

When we try and list all jails, jails that are UP are displaying fine but jails that are DOWN are not being formatted correctly:

[root@bastille ~]# bastille list -a
 JID                                   State  IP Address                   Published Ports  Hostname                              Release       Path
 name_of_up_jail        Up     192.168.1.3,127.0.1.3        -                name_of_up_jail         13.1-RELEASE  /usr/local/bastille/jails/name_of_up_jail/root
 name_of_down_jail  Down   lo2|192.168.1.1
lo2|2a02:c206:2103:9465::1             -                name_of_down_jail  13.1-RELEASE  /usr/local/bastille/jails/name_of_down_jail/root

Bastille and FreeBSD version: 0.9.20220714 13.1-RELEASE-p3 13.1-RELEASE-p3 13.1-RELEASE-p3

Given the config above, I would expect to see


 JID                                   State  IP Address                   Published Ports  Hostname                              Release       Path
 name_of_up_jail        Up     192.168.1.3,127.0.1.3        -                name_of_up_jail         13.1-RELEASE  /usr/local/bastille/jails/name_of_up_jail/root
 name_of_down_jail  Down   192.168.1.1,127.0.1.           -                name_of_down_jail  13.1-RELEASE  /usr/local/bastille/jails/name_of_down_jail/root
andy-isoc commented 1 year ago

I've submitted a possible fix as a PR.

bmac2 commented 1 year ago

@andy-isoc which PR and which branch so I can make sure it is done.

bmac2 commented 1 year ago

@andy-isoc look at your PR and fix the conflicts with main branch. I looked but would feel more comfortable with you resolving them.

bmac2 commented 1 year ago

@andy-isoc also, is this PR still needed after the current release that added some ipv6 stuff??? looks like a similar line was already changed/added in the current release. Please let me know and if it is already fixed please close this PR. Thank you for your help on issues.