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

Refactor E2E image loads #2287

Closed
rainest opened this issue Feb 22, 2022 · 0 comments · Fixed by #3035
Closed

Refactor E2E image loads #2287

rainest opened this issue Feb 22, 2022 · 0 comments · Fixed by #3035

Comments

@rainest
Copy link
Contributor

rainest commented Feb 22, 2022

Problem Statement

As designed the image loader effectively uses errors for downstream control flow. This:

if b, err := loadimage.NewBuilder().WithImage(imageLoad); err == nil {
	addons = append(addons, b.Build())
}

handles the imageLoad == '' condition by relying on the builder returning an error, when it could have used a conditional on imageLoad's value.

Proposed Solution

Use a conditional instead, and fail on any error.

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

Successfully merging a pull request may close this issue.

2 participants