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

Support serving pxelinux artifacts #6

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

Support serving pxelinux artifacts #6

wants to merge 1 commit into from

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Nov 5, 2024

Potentially makes netboot support pxelinux machines that directly ignore the pxe server and go for the tftpserver, thus not sending too much info other that a pxelinux path and client config

This would make it support those clients with minimal changes to other parts and allow to configure the served files

Potentially makes netboot support pxelinux machines that directly ignore
the pxe server and go for the tftpserver, thus not sending too much info
other that a pxelinux path and client config

This would make it support those clients with minimal changes to other
parts and allow to configure the served files

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka Itxaka requested a review from a team November 5, 2024 10:29
@Itxaka
Copy link
Member Author

Itxaka commented Nov 5, 2024

not tested because.... well, no idea what has pxelinux support this days?

server/tftp.go Dismissed Show dismissed Hide dismissed
@Itxaka Itxaka requested a review from Copilot November 5, 2024 14:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 suggestions.

Comments skipped due to low confidence (2)

server/tftp.go:92

  • [nitpick] The variable 'i' is used to store both integer and string values. It should be renamed to something more descriptive for clarity.
_, i, err := extractInfoPxeLinux(path)

server/tftp.go:121

  • The extractInfoPxeLinux function should be covered by tests to ensure its correctness.
func extractInfoPxeLinux(path string) (net.HardwareAddr, string, error) {

return nil, "", errors.New("not found")
}
cleanedMac := strings.Replace(pathElements[1], "01-", "", 1)
mac, _ = net.ParseMAC(cleanedMac)
Copy link
Preview

Copilot AI Nov 5, 2024

Choose a reason for hiding this comment

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

The error from net.ParseMAC is ignored. It should be handled properly to avoid potential issues with invalid MAC addresses.

Suggested change
mac, _ = net.ParseMAC(cleanedMac)
mac, err := net.ParseMAC(cleanedMac); if err != nil { return nil, "", err }

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link
Member Author

Choose a reason for hiding this comment

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

nope, because we may not get a mac in here, and we want to try but dont care if we fail.

examples/boot.go Show resolved Hide resolved
@Itxaka Itxaka requested a review from Copilot November 6, 2024 10:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 suggestion.

if strings.HasPrefix(path, "pxelinux.cfg/") {
_, i, err := extractInfoPxeLinux(path)
if err != nil {
return nil, 0, fmt.Errorf("unknown path %q", path)
Copy link
Preview

Copilot AI Nov 6, 2024

Choose a reason for hiding this comment

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

The error message "unknown path %q" is used for both extractInfoPxeLinux and extractInfo. This could be confusing. Differentiate the error messages for clarity.

Suggested change
return nil, 0, fmt.Errorf("unknown path %q", path)
return nil, 0, fmt.Errorf("unknown pxelinux path %q", path)

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@jimmykarily
Copy link

not tested because.... well, no idea what has pxelinux support this days?

then why add support for it?

@Itxaka
Copy link
Member Author

Itxaka commented Nov 6, 2024

not tested because.... well, no idea what has pxelinux support this days?

then why add support for it?

It's easy, and potentially covers future use of the lib or consumers to support it?

I know that s390x machines only support pxelinux booting so.... Maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants