File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed
pkg/kepval/keps/validations Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,9 @@ func ignore(name string) bool {
74
74
return true
75
75
}
76
76
if name == "0023-documentation-for-images.md" ||
77
- name == "0004-cloud-provider-template.md" {
77
+ name == "0004-cloud-provider-template.md" ||
78
+ name == "README.md" ||
79
+ name == "kep-faq.md" {
78
80
return true
79
81
}
80
82
return false
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Move ExternalDNS out of Kubernetes incubator
3
+ authors :
4
+ - " @njuettner"
5
+ owning-sig : sig-network
6
+ ---
7
+
1
8
# Move ExternalDNS out of Kubernetes incubator
2
9
3
10
## Table of Contents
Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ import (
21
21
"strings"
22
22
)
23
23
24
+ type KeyMustBeSpecified struct {
25
+ key interface {}
26
+ }
27
+
28
+ func (k * KeyMustBeSpecified ) Error () string {
29
+ return fmt .Sprintf ("missing key %[1]v" , k .key )
30
+ }
31
+
24
32
type KeyMustBeString struct {
25
33
key interface {}
26
34
}
@@ -62,7 +70,16 @@ type MustHaveAtLeastOneValue struct {
62
70
func (m * MustHaveAtLeastOneValue ) Error () string {
63
71
return fmt .Sprintf ("%q must have at least one value" , m .key )
64
72
}
73
+
74
+ var mandatoryKeys = []string {"title" , "owning-sig" }
75
+
65
76
func ValidateStructure (parsed map [interface {}]interface {}) error {
77
+ for _ , key := range mandatoryKeys {
78
+ if _ , found := parsed [key ]; ! found {
79
+ return & KeyMustBeSpecified {key }
80
+ }
81
+ }
82
+
66
83
for key , value := range parsed {
67
84
// First off the key has to be a string. fact.
68
85
k , ok := key .(string )
You can’t perform that action at this time.
0 commit comments