Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
slapos
Commits
0a4e1e23
Commit
0a4e1e23
authored
Jan 28, 2021
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/kvm: Support "wrong" nat-rules in cluster
parent
efbc92e2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
software/kvm/buildout.hash.cfg
software/kvm/buildout.hash.cfg
+1
-1
software/kvm/instance-kvm-cluster.cfg.jinja2.in
software/kvm/instance-kvm-cluster.cfg.jinja2.in
+9
-1
software/kvm/test/test.py
software/kvm/test/test.py
+6
-0
No files found.
software/kvm/buildout.hash.cfg
View file @
0a4e1e23
...
...
@@ -23,7 +23,7 @@ md5sum = 23493c541efef97ac5fe435114910b8e
[template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in
md5sum =
bdf8549a76ec61e125d51a05e611e004
md5sum =
28a00c28a972f42627849b25c2792abb
[template-kvm-resilient]
filename = instance-kvm-resilient.cfg.jinja2
...
...
software/kvm/instance-kvm-cluster.cfg.jinja2.in
View file @
0a4e1e23
...
...
@@ -94,7 +94,15 @@ config-auto-ballooning = {{ dumps(kvm_parameter_dict.get('auto-ballooning', True
{{ setconfig('disk-cache', kvm_parameter_dict.get('disk-cache', '')) }}
{{ setconfig('disk-device-path', kvm_parameter_dict.get('disk-device-path', '')) }}
{% set nat_rules_list = kvm_parameter_dict.get('nat-rules', []) -%}
{# Note: dirty_nat_rules_list is cleaned up later, as the UI generated by JSON schema #}
{# gives freedom to the user to enter values separated by spaces and newlines #}
{# but on UI level they are only supported when separated by newlines, which #}
{# leads to cryptic failures of the cluster #}
{% set dirty_nat_rules_list = kvm_parameter_dict.get('nat-rules', []) -%}
{% set nat_rules_list = [] %}
{% for nat_rule in dirty_nat_rules_list %}
{% do nat_rules_list.extend(nat_rule.split()) %}
{% endfor %}
{{ setconfig('nat-rules', nat_rules_list | join(' ')) }}
config-publish-nat-url = True
config-use-nat = {{ dumps(use_nat) }}
...
...
software/kvm/test/test.py
View file @
0a4e1e23
...
...
@@ -993,3 +993,9 @@ class TestNatRulesKvmCluster(InstanceTestCase):
self
.
assertIn
(
'hostfwd=tcp:%s:10300-:300'
%
(
self
.
_ipv4_address
,),
host_fwd_entry
)
@
skipUnlessKvm
class
TestNatRulesKvmClusterComplex
(
TestNatRulesKvmCluster
):
__partition_reference__
=
'nrkcc'
nat_rules
=
[
"100"
,
"200 300"
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment