Skip to content

Resolve validation error #3634

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

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

Conversation

Horiodino
Copy link

This PR enhances the limayaml.Validate() function to collect and return all validation errors found in a Lima template, instead of stopping at the first encountered error.

Fixes: #3606

Updated the validation logic to accumulate multiple validation errors.

}

func Validate(y *LimaYAML, warn bool) error {
errs := &ValidationErrors{}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's better to use errors.Join?

Signed-off-by: Horiodino <[email protected]>

updatec test-cases

Signed-off-by: Horiodino <[email protected]>

using err.join

Signed-off-by: Horiodino <[email protected]>
@Horiodino Horiodino force-pushed the resolve-validation-error branch from e095c93 to 7c55bd8 Compare June 17, 2025 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

limayaml.Validate() only returns the first validation error
2 participants