Skip to content

Commit 7c4b96a

Browse files
author
Phillip Wittrock
authored
Merge pull request #86 from apelisse/master
Embbed more example types for docs
2 parents 8e358a7 + 3b62c36 commit 7c4b96a

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

pkg/gen/apis/example_test.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

23-
func Example() {}
24-
25-
// FooSpec defines the desired state of Foo
26-
type FooSpec struct {
27-
// +kubebuilder:validation:Maximum=10
28-
// +kubebuilder:validation:ExclusiveMinimum=3
29-
Count int `json:"count"`
30-
}
31-
32-
// FooStatus defines the observed state of Foo
33-
type FooStatus struct{}
34-
35-
// +genclient
36-
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
37-
38-
// Foo
39-
// +k8s:openapi-gen=true
40-
// +kubebuilder:resource:path=foos
41-
type Foo struct {
42-
metav1.TypeMeta `json:",inline"`
43-
metav1.ObjectMeta `json:"metadata,omitempty"`
44-
45-
Spec FooSpec `json:"spec,omitempty"`
46-
Status FooStatus `json:"status,omitempty"`
23+
func Example() {
24+
// FooSpec defines the desired state of Foo
25+
type FooSpec struct {
26+
// +kubebuilder:validation:Maximum=10
27+
// +kubebuilder:validation:ExclusiveMinimum=3
28+
Count int `json:"count"`
29+
}
30+
31+
// FooStatus defines the observed state of Foo
32+
type FooStatus struct{}
33+
34+
// +genclient
35+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
36+
37+
// Foo
38+
// +k8s:openapi-gen=true
39+
// +kubebuilder:resource:path=foos
40+
type Foo struct {
41+
metav1.TypeMeta `json:",inline"`
42+
metav1.ObjectMeta `json:"metadata,omitempty"`
43+
44+
Spec FooSpec `json:"spec,omitempty"`
45+
Status FooStatus `json:"status,omitempty"`
46+
}
4747
}

0 commit comments

Comments
 (0)