Skip to content

Commit 5cfe667

Browse files
authored
Merge pull request #835 from Azadehkhojandi/master
minor typo fix in kind string format validation
2 parents f09826b + 23aeb52 commit 5cfe667

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/scaffold/v1/resource/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (r *Resource) Validate() error {
8080
"version must match ^v\\d+(alpha\\d+|beta\\d+)?$ (was %s)", r.Version)
8181
}
8282
if r.Kind != flect.Pascalize(r.Kind) {
83-
return fmt.Errorf("kind must be camelcase (expected %s was %s)", flect.Pascalize(r.Kind), r.Kind)
83+
return fmt.Errorf("kind must be PascalCase (expected %s was %s)", flect.Pascalize(r.Kind), r.Kind)
8484
}
8585

8686
return nil

pkg/scaffold/v1/resource/resource_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var _ = Describe("Resource", func() {
7979
Expect(instance.Validate().Error()).To(ContainSubstring("kind cannot be empty"))
8080
})
8181

82-
It("should fail if the Kind is not camel cased", func() {
82+
It("should fail if the Kind is not pascal cased", func() {
8383
// Base case
8484
instance := &resource.Resource{Group: "crew", Kind: "FirstMate", Version: "v1"}
8585
Expect(instance.Validate()).To(Succeed())
@@ -91,12 +91,12 @@ var _ = Describe("Resource", func() {
9191
instance = &resource.Resource{Group: "crew", Kind: "firstMate", Version: "v1"}
9292
Expect(instance.Validate()).NotTo(Succeed())
9393
Expect(instance.Validate().Error()).To(ContainSubstring(
94-
`kind must be camelcase (expected FirstMate was firstMate)`))
94+
`kind must be PascalCase (expected FirstMate was firstMate)`))
9595

9696
instance = &resource.Resource{Group: "crew", Kind: "firstmate", Version: "v1"}
9797
Expect(instance.Validate()).NotTo(Succeed())
9898
Expect(instance.Validate().Error()).To(ContainSubstring(
99-
`kind must be camelcase (expected Firstmate was firstmate)`))
99+
`kind must be PascalCase (expected Firstmate was firstmate)`))
100100
})
101101

102102
It("should default the Resource by pluralizing the Kind", func() {

0 commit comments

Comments
 (0)