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 ipxe scripts over data uris in ipxe script urls #194

Closed
wants to merge 1 commit into from

Conversation

displague
Copy link
Member

Description

from #192 (comment)

Why is this needed

Fixes: #110

How Has This Been Tested?

Tests are failing, I haven't looked into how to fix this yet. I think the existing mocks may not be sufficient.

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

set packet_facility test.facility
set packet_plan test.slug

echo my data uri script
Copy link
Member Author

Choose a reason for hiding this comment

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

The test fails, with this line being a chain-url line, referencing the unexpanded data uri.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you paste the test failure here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm rerunning the test to capture the log output.

Copy link
Member Author

Choose a reason for hiding this comment

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

--- FAIL: TestIpxeScript (0.00s)
    --- FAIL: TestIpxeScript/installer:_ipxe_data_url (0.00s)
        main_test.go:172:
            	Error Trace:	main_test.go:172
            	Error:      	Not equal:
            	            	expected: "#!ipxe\n\n\nparams\nparam body Device connected to DHCP system\nparam type provisioning.104.01\nimgfetch ${tinkerbell}/phone-home##params\nimgfree\n\nset packet_facility test.facility\nset packet_plan test.slug\n\necho my data uri script\n"
            	            	actual  : "#!ipxe\n\n\nparams\nparam body Device connected to DHCP system\nparam type provisioning.104.01\nimgfetch ${tinkerbell}/phone-home##params\nimgfree\n\nset packet_facility test.facility\nset packet_plan test.slug\nchain --autofree data:text/plain;charset=utf-8;base64,ZWNobyBteSBkYXRhIHVyaSBzY3JpcHQ=\n"

            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -11,4 +11,3 @@
            	            	 set packet_plan test.slug
            	            	+chain --autofree data:text/plain;charset=utf-8;base64,ZWNobyBteSBkYXRhIHVyaSBzY3JpcHQ=

            	            	-echo my data uri script
            	            	-
            	Test:       	TestIpxeScript/installer:_ipxe_data_url
{"level":"error","ts":1637329705.027709,"caller":"custom_ipxe/main.go:54","msg":"validating ipxe config","service":"github.com/tinkerbell/boots","error":"ipxe config URL or Script must be defined"}
FAIL

@jeremytanner
Copy link
Member

@displague still working this one?

@displague
Copy link
Member Author

@jeremytanner I would like to see this work continued for #110. I am stalled on it.

@jacobweinstock do you see what I'd like to have here (based on the test)? Is this the right place for this change and tests?

@jacobweinstock
Copy link
Member

Hey @displague, apologies for the lack of response here. I will put this on my priority list for this week/next and update here when I have something concrete to provide. Again, sorry for the delay.

@jacobweinstock
Copy link
Member

:( still haven't got around to this quite yet.

tstromberg
tstromberg previously approved these changes Nov 2, 2021
Copy link
Contributor

@tstromberg tstromberg left a comment

Choose a reason for hiding this comment

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

Minor comments.

installers/custom_ipxe/main_test.go Show resolved Hide resolved
@@ -30,6 +31,9 @@ func ipxeScript(j job.Job, s *ipxe.Script) {
}
} else if strings.HasPrefix(j.UserData(), "#!ipxe") {
cfg = &packet.InstallerData{Script: j.UserData()}
} else if dataURL, err := dataurl.DecodeString(j.IPXEScriptURL()); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

optional: at this level of complexity, this would be better off being refactored as a switch{} statement. Feel free to leave this for a future refactor.

@tstromberg
Copy link
Contributor

PR overall looks good - is it just stuck on there being a failing test?

@crayzeigh crayzeigh added the kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. label Feb 8, 2022
@crayzeigh
Copy link

Based on comment history it looks like this one is still awaiting @jacobweinstock to prioritize and review. Assigning failing test label based on description

@cprivitere
Copy link

@displague more rebasing for you

@jacobweinstock
Copy link
Member

@displague, looks like this is still in draft and has some merge conflicts. will wait for updates before reviewing?

@jacobweinstock
Copy link
Member

The code base has moved on quite a bit. Feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When an IPXe URL is a data-url, expand the url into ipxe content
6 participants