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

Add support for a list of k8s objects #221

Merged
merged 1 commit into from
Apr 14, 2020
Merged

Add support for a list of k8s objects #221

merged 1 commit into from
Apr 14, 2020

Conversation

tqorange
Copy link
Contributor

This PR adds support for yaml files with a list of k8s objects in them, for example:

apiVersion: v1
kind: List
items:
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: cf-one
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: cf-two

}
for _, test := range tests {
filePath, _ := filepath.Abs("../fixtures/" + test)
fileContents, _ := ioutil.ReadFile(filePath)
config := NewDefaultConfig()
config.FileName = test
results, _ := Validate(fileContents, config)
if len(results[0].Errors) == 0 {
errorCount := 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this was intentional, but this was only checking the first result. My fixture yaml initially failed this test.

@tqorange tqorange changed the title Add support for a list k8s objects Add support for a list of k8s objects Mar 11, 2020
@garethr
Copy link
Collaborator

garethr commented Apr 14, 2020

Thanks, much appreciated. I'll get this into the next release.

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