Skip to content

Commit 736c3ab

Browse files
authored
Merge pull request kubernetes#2536 from wojtek-t/strenghten_kep_validation
Enforce KEP number and fixup extraneous markdown documents
2 parents dd19a2d + 2b92fc9 commit 736c3ab

File tree

10 files changed

+10
-35
lines changed

10 files changed

+10
-35
lines changed

api/proposal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type Proposal struct {
4848
Name string `json:"name,omitempty"`
4949

5050
Title string `json:"title" yaml:"title" validate:"required"`
51-
Number string `json:"kep-number" yaml:"kep-number"`
51+
Number string `json:"kep-number" yaml:"kep-number" validate:"required"`
5252
Authors []string `json:"authors" yaml:",flow"`
5353
OwningSIG string `json:"owningSig" yaml:"owning-sig" validate:"required"`
5454
ParticipatingSIGs []string `json:"participatingSigs" yaml:"participating-sigs,flow,omitempty"`

hack/.notableofcontents

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
keps/README.md
2-
keps/sig-apps/README.md
3-
keps/sig-autoscaling/README.md
4-
keps/provider-aws/README.md
5-
keps/sig-cli/kep-faq.md
6-
keps/sig-cluster-lifecycle/clusterapi/README.md
7-
keps/sig-cluster-lifecycle/kubeadm/0023-documentation-for-images.md
8-
keps/sig-cluster-lifecycle/kubeadm/README.md
9-
keps/sig-network/README.md
2+
keps/sig-cli/FAQ.md
3+
keps/sig-cluster-lifecycle/clusterapi/FAQ.md
4+
keps/sig-cluster-lifecycle/kubeadm/970-kubeadm-config/documentation-for-images.md
5+

keps/provider-aws/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

keps/sig-apps/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

keps/sig-autoscaling/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

keps/sig-network/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkg/kepval/repository.go

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ import (
3030

3131
const (
3232
// TODO: Make this configurable and set in a client instead
33-
DefaultPRRDir = "prod-readiness"
34-
kepMetadata = "kep.yaml"
33+
DefaultPRRDir = "prod-readiness"
34+
kepMetadata = "kep.yaml"
35+
kepsReadmePath = "enhancements/keps/README.md"
3536
)
3637

3738
var files = []string{}
@@ -145,10 +146,7 @@ var walkFn = func(path string, info os.FileInfo, err error) error {
145146
return nil
146147
}
147148

148-
// TODO(#2220): Return an error as soon as all KEPs are migrated to directory-based
149-
// KEP format.
150-
files = append(files, path)
151-
return nil
149+
return fmt.Errorf("incorrect KEP format: %s", path)
152150
}
153151

154152
// TODO: Consider replacing with a .kepignore file
@@ -159,12 +157,5 @@ func ignore(dir, name string) bool {
159157
return true
160158
}
161159

162-
if name == "0023-documentation-for-images.md" ||
163-
name == "0004-cloud-provider-template.md" ||
164-
name == "README.md" ||
165-
name == "kep-faq.md" {
166-
return true
167-
}
168-
169-
return false
160+
return strings.HasSuffix(filepath.Join(dir, name), kepsReadmePath) || name == "FAQ.md"
170161
}

0 commit comments

Comments
 (0)