Skip to content

Commit

Permalink
fix: IPv4 - IC-OS Tools: Prefer 'domain' over 'domain_name' to match …
Browse files Browse the repository at this point in the history
…all other arg names
  • Loading branch information
garym-dfinity committed Feb 13, 2024
1 parent b31be67 commit b5e0d67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ic-os/setupos/config/config.ini
Expand Up @@ -38,4 +38,4 @@ ipv6_gateway=2a00:fb01:400:200::1
# Domain Name (required with IPv4)
# ----------------------------------
# Define the domain name for your node. Ensure proper configuration of A and AAAA records for this domain.
# domain_name=node1.example.com
# domain=node1.example.com
10 changes: 5 additions & 5 deletions ic-os/utils/bare_metal_deployment/deploy.py
Expand Up @@ -90,7 +90,7 @@ class Args:
inject_image_ipv4_prefix_length: Optional[str] = None

# If present - decompress `upload_img` and inject this into config.ini
inject_image_domain_name: Optional[str] = None
inject_image_domain: Optional[str] = None

# Path to the setupos-inject-configuration tool. Necessary if any inject* args are present
inject_configuration_tool: Optional[str] = None
Expand Down Expand Up @@ -127,7 +127,7 @@ def __post_init__(self):
ipv4_args = [self.inject_image_ipv4_address,
self.inject_image_ipv4_gateway,
self.inject_image_ipv4_prefix_length,
self.inject_image_domain_name]
self.inject_image_domain]
assert all(ipv4_args) or not any(ipv4_args), \
"All ipv4 flags must be present or none"
assert self.file_share_ssh_key is None \
Expand Down Expand Up @@ -174,7 +174,7 @@ class Ipv4Args:
address: str
gateway: str
prefix_length: str
domain_name: str
domain: str


def parse_from_row(row: List[str], network_image_url: str) -> BMCInfo:
Expand Down Expand Up @@ -507,7 +507,7 @@ def is_executable(p: Path) -> bool:
ipv4_part = f"--ipv4-address {ipv4_args.address} "
ipv4_part += f"--ipv4-gateway {ipv4_args.gateway} "
ipv4_part += f"--ipv4-prefix-length {ipv4_args.prefix_length} "
ipv4_part += f"--domain-name {ipv4_args.domain_name} "
ipv4_part += f"--domain {ipv4_args.domain} "

invoke.run(f"{setupos_inject_configuration_path} {image_part} {prefix_part} {gateway_part} {ipv4_part}", echo=True)

Expand Down Expand Up @@ -550,7 +550,7 @@ def main():
ipv4_args = Ipv4Args(args.inject_image_ipv4_address,
args.inject_image_ipv4_gateway,
args.inject_image_ipv4_prefix_length,
args.inject_image_domain_name)
args.inject_image_domain)

if args.upload_img or args.inject_image_ipv6_prefix:
file_share_endpoint = create_file_share_endpoint(args.file_share_url, args.file_share_username)
Expand Down
2 changes: 1 addition & 1 deletion ic-os/utils/bare_metal_deployment/zh2-dll01.yaml
Expand Up @@ -6,4 +6,4 @@ inject_image_ipv6_gateway: 2a00:fb01:400:200::1
inject_image_ipv4_address: 212.71.124.178
inject_image_ipv4_gateway: 212.71.124.177
inject_image_ipv4_prefix_length: 28
inject_image_domain_name: bare_metal_deployment.icp5.io
inject_image_domain: bare-metal-deployment.icp5.io
10 changes: 5 additions & 5 deletions rs/ic_os/setupos-inject-configuration/src/main.rs
Expand Up @@ -54,7 +54,7 @@ struct NetworkConfig {
ipv4_prefix_length: Option<u8>,

#[arg(long)]
domain_name: Option<String>,
domain: Option<String>,

#[arg(long)]
mgmt_mac: Option<String>,
Expand Down Expand Up @@ -184,7 +184,7 @@ async fn write_config(path: &Path, cfg: &NetworkConfig) -> Result<(), Error> {
ipv4_address,
ipv4_gateway,
ipv4_prefix_length,
domain_name,
domain,
} = cfg;

if let (Some(ipv6_prefix), Some(ipv6_gateway)) = (ipv6_prefix, ipv6_gateway) {
Expand All @@ -194,13 +194,13 @@ async fn write_config(path: &Path, cfg: &NetworkConfig) -> Result<(), Error> {
writeln!(&mut f, "ipv6_gateway={}", ipv6_gateway)?;
}

if let (Some(ipv4_address), Some(ipv4_gateway), Some(ipv4_prefix_length), Some(domain_name)) =
(ipv4_address, ipv4_gateway, ipv4_prefix_length, domain_name)
if let (Some(ipv4_address), Some(ipv4_gateway), Some(ipv4_prefix_length), Some(domain)) =
(ipv4_address, ipv4_gateway, ipv4_prefix_length, domain)
{
writeln!(&mut f, "ipv4_address={}", ipv4_address)?;
writeln!(&mut f, "ipv4_gateway={}", ipv4_gateway)?;
writeln!(&mut f, "ipv4_prefix_length={}", ipv4_prefix_length)?;
writeln!(&mut f, "domain_name={}", domain_name)?;
writeln!(&mut f, "domain={}", domain)?;
}

if let Some(mgmt_mac) = mgmt_mac {
Expand Down

0 comments on commit b5e0d67

Please sign in to comment.