Skip to content

feat: convert the output error to yaml#1

Closed
abdalazizmoh wants to merge 1 commit into
DevOpsHiveHQ:mainfrom
abdalazizmoh:feat/convert-output-to-yaml
Closed

feat: convert the output error to yaml#1
abdalazizmoh wants to merge 1 commit into
DevOpsHiveHQ:mainfrom
abdalazizmoh:feat/convert-output-to-yaml

Conversation

@abdalazizmoh

@abdalazizmoh abdalazizmoh commented May 16, 2023

Copy link
Copy Markdown

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
Copy Markdown
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