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

feat: convert the output error to yaml #1

Conversation

abdalazizmoh
Copy link

@abdalazizmoh abdalazizmoh commented May 16, 2023

Hi 👋

This PR is for converting Json error output to Yaml format to be more readable

Build the tool

go build -o 'dist/kubeconformvalidator' .

Testing using /example directory :

kustomize build --enable-alpha-plugins --enable-exec ./example

The output display in Yaml format:

2023/05/17 20:32:03 Kubeconform validation failed: resources:
- filename: stdin
  kind: Service
  msg: 'problem validating schema. Check JSON formatting: jsonschema: ''/spec/ports/0/port''
    does not validate with https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master-standalone/service-v1.json#/properties/spec/properties/ports/items/properties/port/type:
    expected integer, but got string'
  name: validated-core-resource
  status: statusInvalid
  validationErrors:
  - msg: expected integer, but got string
    path: /spec/ports/0/port
  version: v1
: failed to process results
Error: couldn't execute function: exit status 1 

Thanks

@abdalazizmoh abdalazizmoh force-pushed the feat/convert-output-to-yaml branch from 9a36769 to 477feb4 Compare May 17, 2023 17:46
@aabouzaid
Copy link
Collaborator

Closing this in favor of #2

@aabouzaid aabouzaid closed this Jul 23, 2023
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.

2 participants