Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T4978: Default values of port rewrite default container values #1838

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented Feb 21, 2023

Change Summary

As we have the same variable name default_values for container name, port and volume, it rewrites default container parameters with default port parameters
Fix it. VyOS 1.3.3
(cherry picked from commit 679efe8)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe): cherry-pick

Related Task(s)

Component(s) name

containers

Proposed changes

How to test

VyOS configuration:

set container name multitool description 'Network multitool container'
set container name multitool image 'wbitt/network-multitool:fedora'
set container name multitool network cntr-net
set container name multitool port http destination '80'
set container name multitool port http source '80'
set container name nrpe allow-host-networks
set container name nrpe image 'incitem/almalinux9:nrpe'
set container network cntr-net description 'VyOS Container Network'
set container network cntr-net prefix '172.253.253.0/24'

Before fix:

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/container.py", line 408, in <module>
    generate(c)
  File "/usr/libexec/vyos/conf_mode/container.py", line 350, in generate
    run_args = generate_run_arguments(name, container_config)
  File "/usr/libexec/vyos/conf_mode/container.py", line 237, in generate_run_arguments
    memory = container_config['memory']
KeyError: 'memory'



[[container]] failed
Commit failed
[edit]
vyos@r1#

After fix:

vyos@r1# run show container 
CONTAINER ID  IMAGE                                     COMMAND               CREATED         STATUS             PORTS                 NAMES
c0a85cc574b6  docker.io/wbitt/network-multitool:fedora  nginx -g daemon o...  10 minutes ago  Up 10 minutes ago  0.0.0.0:80->80/tcp    multitool
b726c75d57c1  docker.io/incitem/almalinux9:nrpe                               10 minutes ago  Up 10 minutes ago                        nrpe
[edit]
vyos@r1# 

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

As we have the same variable name 'default_values' for container
name, port and volume, it rewrites default container parameters
with default port parameters
Fix it

(cherry picked from commit 679efe8)
@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team February 21, 2023 13:03
@incitem
Copy link

incitem commented Feb 21, 2023

This fixes T4978 for me.

@c-po c-po merged commit 06fde32 into vyos:equuleus Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants