warewulf icon indicating copy to clipboard operation
warewulf copied to clipboard

wwctl container rename "materializes" profile container value into each node

Open epruesse opened this issue 1 year ago • 2 comments

I'm guessing that somehow container rename operates on the expanded node config, and writes out the new container name to each node, even if before it was configured at a profile level.

Before

nodes.conf:

profiles:
  gpu:
    container name: rocky-gpu
nodes:
  gpn01:
    profiles:
    - default
    - gpu

Breakit

wwctl container rename rocky-gpu rockylinux-9-gpu

After

nodes.conf:

profiles:
  gpu:
    container name: rockylinux-9-gpu
nodes:
  gpn01:
    container name: rockylinux-9-gpu
    profiles:
    - default
    - gpu

epruesse avatar Oct 06 '24 03:10 epruesse

I've never renamed a container via wwctl but I'd have assumed it'd only operate on the container and not touch the nodeconfig in any way. It seems more intuitive to be able to assume that wwctl [overlay|container|kernel] ... will never modify a node or profile, only operating on their namesake.

griznog avatar Oct 06 '24 13:10 griznog

Thanks for the report, @epruesse! We'll check it out.

anderbubble avatar Oct 07 '24 16:10 anderbubble

This appears to be resolved in current main.

# cat /etc/warewulf/nodes.conf
nodeprofiles:
  gpu:
    container name: alpine
  default: {}
nodes:
  gpn01:
    profiles:
    - default
    - gpu
    
# wwctl container rename alpine alpine-newname
WARN   : Could not remove image files for alpine: %!w(*errors.fundamental=&{Image /var/lib/warewulf/provision/container/alpine.img of container alpine doesn't exist
 0x400011d6b0})
Container alpine successfully renamed as alpine-newname

cat /etc/warewulf/nodes.conf
nodeprofiles:
  default: {}
  gpu:
    container name: alpine
nodes:
  gpn01:
    profiles:
      - default
      - gpu

anderbubble avatar Nov 24 '24 05:11 anderbubble