Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0c3d52f4 authored by Pierre Neyron's avatar Pierre Neyron :bicyclist:
Browse files

[bindg5k] Allow node with no NIC predictable name (name = ethX)

In that case, do not create CNAME predictable name -> eth name.

Required for estats.
parent 46e755e9
No related branches found
No related tags found
No related merge requests found
......@@ -227,8 +227,8 @@ def get_node_records(cluster_uid, node_uid, network_adapters)
new_record.label = "#{cluster_uid}-#{node_id}"
new_record.label += "-#{net_uid}" unless net_hash['mounted'] && /^eth[0-9]$/.match(net_uid)
records << new_record
if /^eth[0-9]$/.match(net_uid) && net_hash['pname'] != nil && !net_hash['pname'].empty?
check_interface_name(node_uid, net_uid, net_hash)
if /^eth[0-9]$/.match(net_uid) && !net_hash['pname'].nil? && !net_hash['pname'].empty? &&
net_hash['pname'] != net_uid
cname_record = DNS::Zone::RR::CNAME.new
cname_record.label = "#{cluster_uid}-#{node_id}-#{net_hash['pname']}"
cname_record.domainname = "#{cluster_uid}-#{node_id}-#{net_uid}"
......@@ -242,8 +242,8 @@ def get_node_records(cluster_uid, node_uid, network_adapters)
new_record_ipv6.label += "-#{net_uid}" unless net_hash['mounted'] && /^eth[0-9]$/.match(net_uid)
new_record_ipv6.label += '-ipv6'
records << new_record_ipv6
if /^eth[0-9]$/.match(net_uid) && net_hash['pname'] != nil && !net_hash['pname'].empty?
check_interface_name(node_uid, net_uid, net_hash)
if /^eth[0-9]$/.match(net_uid) && !net_hash['pname'].nil? && !net_hash['pname'].empty? &&
net_hash['pname'] != net_uid
cname_record_ipv6 = DNS::Zone::RR::CNAME.new
cname_record_ipv6.label = "#{cluster_uid}-#{node_id}-#{net_hash['pname']}-ipv6"
cname_record_ipv6.domainname = "#{cluster_uid}-#{node_id}-#{net_uid}-ipv6"
......@@ -280,12 +280,6 @@ def get_node_records(cluster_uid, node_uid, network_adapters)
return records
end
def check_interface_name(node_uid, net_uid, net_hash)
if net_uid == net_hash['pname']
raise "Error - #{node_uid} : incorrect 'pname' value for #{net_uid} (current value is '#{net_hash['pname']}'). Please put a predictable name instead."
end
end
def get_node_kavlan_records(_cluster_uid, node_uid, network_adapters, kavlan_adapters)
records = []
......@@ -301,7 +295,7 @@ def get_node_kavlan_records(_cluster_uid, node_uid, network_adapters, kavlan_ada
new_record.address = net_hash['ip']
new_record.label = "#{node_uid}-#{net_uid}" #sol-23-eth0-kavlan-1
records << new_record
if !/^fpga[0-9]$/.match(net_uid_eth)
if !/^fpga[0-9]$/.match(net_uid_eth) && net_hash['pname'] != net_uid
cname_record = DNS::Zone::RR::CNAME.new
cname_record.label = "#{node_uid}-#{net_hash['pname']}"
cname_record.domainname = "#{node_uid}-#{net_uid}" #sol-23-eno1-kavlan-1
......@@ -314,7 +308,7 @@ def get_node_kavlan_records(_cluster_uid, node_uid, network_adapters, kavlan_ada
new_record_ipv6.label = "#{node_uid}-#{net_uid}" #sol-23-eth0-kavlan-1
new_record_ipv6.label += '-ipv6'
records << new_record_ipv6
if !/^fpga[0-9]$/.match(net_uid_eth)
if !/^fpga[0-9]$/.match(net_uid_eth) && net_hash['pname'] != net_uid
cname_record_ipv6 = DNS::Zone::RR::CNAME.new
cname_record_ipv6.label = "#{node_uid}-#{net_hash['pname']}-ipv6"
cname_record_ipv6.domainname = "#{node_uid}-#{net_uid}-ipv6" #sol-23-eno1-kavlan-1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment