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

skip incomplete or broken YAML - warn user #678

Merged
merged 14 commits into from
Jun 7, 2022
Merged

Conversation

intrand
Copy link
Contributor

@intrand intrand commented Nov 23, 2021

This PR:

  • changes visitFile() (WalkFunc for filepath.Walk()) to log parsing failures and continue (eg, patch files; fixes Polaris fails to parse/ignore Kustomization yaml JSONPatch files #667)
  • removes error logging of failed parsing - upper functions are now responsible for bubbling up the parse error and reporting it
  • corrects test for parsing resources to work again :)

@intrand intrand requested a review from makoscafee as a code owner November 23, 2021 17:00
@intrand intrand self-assigned this Nov 23, 2021
@CLAassistant
Copy link

CLAassistant commented Nov 23, 2021

CLA assistant check
All committers have signed the CLA.

@lucasreed lucasreed removed their request for review April 26, 2022 18:04
@TheMatrix97
Copy link

TheMatrix97 commented Jun 7, 2022

Hey! Can we merge this PR? I think it's a pretty interesing feature or provide some mecanism to ignore some paths

@fairwinds-insights
Copy link

Fairwinds Insights CI Report

View the Full Report

✅ No new Action Items detected!

logrus.Errorf("Error parsing YAML: (%v)", err)
return err
}
return resources.addResourceFromString(spec)
Copy link
Contributor

Choose a reason for hiding this comment

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

this will only add Resource from the first spec and ignore others.

@makoscafee
Copy link
Contributor

@intrand mind signing the CLA?

@intrand
Copy link
Contributor Author

intrand commented Jun 7, 2022

signed. looks like there's still a test that's failing @makoscafee

@makoscafee makoscafee enabled auto-merge (squash) June 7, 2022 15:58
@makoscafee makoscafee merged commit 3b865fc into master Jun 7, 2022
@makoscafee makoscafee deleted the intrand/non-k8s branch June 7, 2022 16:02
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.

Polaris fails to parse/ignore Kustomization yaml JSONPatch files
6 participants