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

Fix Default Route check when not using DHCP #876

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tayterz2
Copy link

@tayterz2 tayterz2 commented Nov 2, 2024

Problem:
#725 introduces a bug wherein if an automated deployment using userdata.yaml is initiated and does not use DHCP, the installation fails with the error "No default route found. Please check the router setting on the DHCP server" regardless of the "Gateway" settings. This is because the check is performed before a static network is set up.

Solution:
Add a couple of "if" checks to determine if this is a DHCP installation. If not, skip the default route check.

Related Issue:
#725 #734

Test plan:
Using this userdata.yaml file on a second ISO or PXE, successfully perform an automated install:

#cloud-config
token: token
os:
  ssh_authorized_keys:
    - ssh-rsa ...        # replace with your public key
  password: p@ssword   # replace with a your password
  ntp_servers:
    - 0.suse.pool.ntp.org
    - 1.suse.pool.ntp.org
install:
  mode: create
  automatic: true
  networks:
  management_interface:
    interfaces:
      - name: ens0
      - name: ens3
    method: static
    ip: 1.2.3.4
    gateway: 1.2.3.1
    subnet_mask: 255.255.255.0
  vipMode: static
  vip: 2.3.4.5

@mingshuoqiu
Copy link
Contributor

The code looks good to me. Can give different commit title for 2 commits or simply squash 2 commits into a single one? Thanks

Copy link
Member

@starbops starbops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending us the patch. However, I wonder if this will fix the problem. Please describe the steps to reproduce the case. A new GH issue for it would be nice (it helps us better understand the scope of the issue regarding the context and additional details provided). I want to reproduce the problem and validate if the fix suggested by this PR works.

Many thanks.

@tayterz2
Copy link
Author

@starbops - GH issue GH-7280 created.

Copy link

mergify bot commented Dec 30, 2024

This pull request is now in conflict. Could you fix it @tayterz2? 🙏

@tayterz2 tayterz2 force-pushed the master branch 2 times, most recently from 840cc96 to 0f2aa50 Compare December 30, 2024 18:06
@tayterz2
Copy link
Author

The code looks good to me. Can give different commit title for 2 commits or simply squash 2 commits into a single one? Thanks

Done - merged into a single commit. Temporarily broke everything, but fixed now!

Thanks!
Taylor

@tayterz2 tayterz2 requested a review from starbops December 30, 2024 18:24
@tayterz2
Copy link
Author

Resolves harvester/harvester#7280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants