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

containers: T4473: Fix create container with not exist network #1376

Merged
merged 1 commit into from Jun 28, 2022

Conversation

sever-sever
Copy link
Member

Change Summary

Fix for a setting container without or wrong network declaration

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):

Related Task(s)

Component(s) name

container

Proposed changes

How to test

Create a container with a nonexistent network
Current behavior:

set container name alp01 image alpine
set container name alp01 network NET02

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/container.py", line 367, in <module>
    verify(c)
  File "/usr/libexec/vyos/conf_mode/container.py", line 135, in verify
    if network_name not in container['network']:
KeyError: 'network'

After Fix:

set container name alp01 image alpine
set container name alp01 network NET02

vyos@r14# commit
[ container ]
Container network "NET02" does not exist!

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

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

Fix for setting container without or wrong network decalaration
@c-po c-po merged commit 2e8fdce into vyos:current Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants