-
Notifications
You must be signed in to change notification settings - Fork 229
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
empty lists cause error about missing metadata #246
Comments
Here's a quick patch to add a test: diff --git a/fixtures/list_empty_valid.yaml b/fixtures/list_empty_valid.yaml
new file mode 100644
index 0000000..2276fbb
--- /dev/null
+++ b/fixtures/list_empty_valid.yaml
@@ -0,0 +1,4 @@
+---
+apiVersion: v1
+kind: List
+items: []
\ No newline at end of file
diff --git a/kubeval/kubeval_test.go b/kubeval/kubeval_test.go
index d8132d7..b9c9be1 100644
--- a/kubeval/kubeval_test.go
+++ b/kubeval/kubeval_test.go
@@ -34,6 +34,7 @@ func TestValidateValidInputs(t *testing.T) {
"extra_property.yaml",
"full_domain_group.yaml",
"unconventional_keys.yaml",
+ "list_empty_valid.yaml",
"list_valid.yaml",
"same-object-different-namespace.yaml",
"same-object-different-namespace-default.yaml", |
@docwhat This page seems to say that the metadata field is mandatory? https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields |
Unfortunately, this isn't clearly documented. My thinking is thus: Based on kubernetes/kubectl#837,
All the Lists are not persisted; there is no List object stored in the cluster. |
@docwhat hitting this issue now , you know if your fix is going to be merged ? |
You'd have to ask the Authors. I'm just a external user like yourself. 😜 |
When a
kind: List
is empty (items
contains no objects) thenkubeval
incorrectly complains about a missingmetadata
key.The text was updated successfully, but these errors were encountered: