Skip to content

Commit 1036293

Browse files
committed
update tests to account for =
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
1 parent c015d65 commit 1036293

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

pkg/analysis/statussubresource/testdata/src/a/a.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,14 @@ type FooBarSpec struct {
4747
type FooBarStatus struct {
4848
Name string `json:"name"`
4949
}
50+
51+
// Test that it works with 'root=true' as well
52+
// +kubebuilder:object:root=true
53+
// +kubebuilder:subresource:status
54+
type FooBarBaz struct { // want "root object type \"FooBarBaz\" is marked to enable the status subresource with marker \"kubebuilder:subresource:status\" but has no status field"
55+
Spec FooBarBazSpec `json:"spec"`
56+
}
57+
58+
type FooBarBazSpec struct {
59+
Name string `json:"name"`
60+
}

pkg/analysis/statussubresource/testdata/src/a/a.go.golden

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,14 @@ type FooBarSpec struct {
4848
type FooBarStatus struct {
4949
Name string `json:"name"`
5050
}
51+
52+
// Test that it works with 'root=true' as well
53+
// +kubebuilder:object:root=true
54+
// +kubebuilder:subresource:status
55+
type FooBarBaz struct { // want "root object type \"FooBarBaz\" is marked to enable the status subresource with marker \"kubebuilder:subresource:status\" but has no status field"
56+
Spec FooBarBazSpec `json:"spec"`
57+
}
58+
59+
type FooBarBazSpec struct {
60+
Name string `json:"name"`
61+
}

0 commit comments

Comments
 (0)