Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
4e5878d5
Commit
4e5878d5
authored
1 year ago
by
JORGE SASIAIN
Browse files
Options
Downloads
Patches
Plain Diff
NAT-198: add dns_view option during allocate host
parent
8919a639
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!27
Merge develop into NAT-185
,
!15
Nat 185
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/oss-params-example.json
+6
-3
6 additions, 3 deletions
gso/oss-params-example.json
gso/services/_ipam.py
+8
-2
8 additions, 2 deletions
gso/services/_ipam.py
gso/settings.py
+1
-0
1 addition, 0 deletions
gso/settings.py
with
15 additions
and
5 deletions
gso/oss-params-example.json
+
6
−
3
View file @
4e5878d5
...
...
@@ -14,17 +14,20 @@
"LO"
:
{
"V4"
:
{
"containers"
:
[],
"networks"
:
[
"1.1.0.0/28"
],
"mask"
:
0
},
"V6"
:
{
"containers"
:
[],
"networks"
:
[
"dead:beef::/80"
],
"mask"
:
0
},
"domain_name"
:
".lo"
"domain_name"
:
".lo"
,
"dns_view"
:
"default"
},
"TRUNK"
:
{
"V4"
:
{
"containers"
:
[
"1.1.1.0/24"
],
"networks"
:
[],
"mask"
:
31
},
"V6"
:
{
"containers"
:
[
"dead:beef::/64"
],
"networks"
:
[],
"mask"
:
126
},
"domain_name"
:
".trunk"
"domain_name"
:
".trunk"
,
"dns_view"
:
"default
},
"
GEANT_IP
": {
"
V
4
": {"
containers
": ["
1.1
.
2.0
/
24
"], "
networks
": [], "
mask
": 31},
"
V
6
": {"
containers
": ["
dead:beef::/
64
"], "
networks
": [], "
mask
": 126},
"domain_name"
:
".geantip"
"
domain_name
": "
.geantip
",
"
dns_view
": "
default
}
},
"PROVISIONING_PROXY"
:
{
...
...
This diff is collapsed.
Click to expand it.
gso/services/_ipam.py
+
8
−
2
View file @
4e5878d5
...
...
@@ -240,6 +240,7 @@ def _allocate_host(hostname=None,
addrs
=
None
,
networks
=
None
,
cname_aliases
=
None
,
dns_view
=
"
default
"
,
extattrs
=
{}
)
->
Union
[
HostAddresses
,
str
]:
"""
...
...
@@ -303,7 +304,7 @@ def _allocate_host(hostname=None,
],
"
name
"
:
hostname
,
"
configure_for_dns
"
:
True
,
"
view
"
:
"
default
"
,
"
view
"
:
dns_view
,
"
extattrs
"
:
extattrs
}
...
...
@@ -324,7 +325,7 @@ def _allocate_host(hostname=None,
cname_req_payload
=
{
"
name
"
:
""
,
"
canonical
"
:
hostname
,
"
view
"
:
"
default
"
,
"
view
"
:
dns_view
,
"
extattrs
"
:
extattrs
}
...
...
@@ -380,11 +381,13 @@ def allocate_service_host(hostname=None,
oss_ipv4_networks
=
getattr
(
ipam_params
,
service_type
).
V4
.
networks
oss_ipv6_networks
=
getattr
(
ipam_params
,
service_type
).
V6
.
networks
domain_name
=
getattr
(
ipam_params
,
service_type
).
domain_name
dns_view
=
getattr
(
ipam_params
,
service_type
).
dns_view
assert
(
oss_ipv4_containers
and
oss_ipv6_containers
)
\
or
(
oss_ipv4_networks
and
oss_ipv6_networks
),
\
"
This service is missing either containers or networks configuration.
"
assert
domain_name
,
"
This service is missing domain_name configuration.
"
assert
dns_view
,
"
This service is missing dns_view configuration.
"
if
cname_aliases
:
cname_aliases
=
[
alias
+
domain_name
for
alias
in
cname_aliases
]
...
...
@@ -419,6 +422,7 @@ def allocate_service_host(hostname=None,
host
=
_allocate_host
(
hostname
=
hostname
+
domain_name
,
networks
=
network_tuple
,
cname_aliases
=
cname_aliases
,
dns_view
=
dns_view
,
extattrs
=
extattrs
)
if
"
NETWORK_FULL
"
not
in
host
:
...
...
@@ -455,6 +459,7 @@ def allocate_service_host(hostname=None,
hostname
=
hostname
+
domain_name
,
networks
=
(
str
(
ipv4_network
),
str
(
ipv6_network
)),
cname_aliases
=
cname_aliases
,
dns_view
=
dns_view
,
extattrs
=
extattrs
)
assert
"
NETWORK_FULL
"
not
in
host
...
...
@@ -482,6 +487,7 @@ def allocate_service_host(hostname=None,
hostname
=
hostname
+
domain_name
,
addrs
=
(
str
(
ipv4_addr
),
str
(
ipv6_addr
)),
cname_aliases
=
cname_aliases
,
dns_view
=
dns_view
,
extattrs
=
extattrs
)
assert
"
NETWORK_FULL
"
not
in
host
...
...
This diff is collapsed.
Click to expand it.
gso/settings.py
+
1
−
0
View file @
4e5878d5
...
...
@@ -32,6 +32,7 @@ class ServiceNetworkParams(BaseSettings):
V4
:
V4NetworkParams
V6
:
V6NetworkParams
domain_name
:
str
dns_view
:
str
class
IPAMParams
(
BaseSettings
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment