File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,10 @@ limitations under the License.
19
19
package v1alpha1
20
20
21
21
import (
22
+ "reflect"
22
23
"testing"
23
24
25
+ fuzz "github.com/google/gofuzz"
24
26
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
25
27
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
26
28
@@ -39,5 +41,28 @@ func TestFuzzyConversion(t *testing.T) {
39
41
}
40
42
41
43
func ExtensionConfigFuzzFuncs (_ runtimeserializer.CodecFactory ) []interface {} {
42
- return []interface {}{}
44
+ return []interface {}{
45
+ hubExtensionConfigStatus ,
46
+ spokeExtensionConfigStatus ,
47
+ }
48
+ }
49
+
50
+ func hubExtensionConfigStatus (in * addonsv1.ExtensionConfigStatus , c fuzz.Continue ) {
51
+ c .FuzzNoCustom (in )
52
+ // Drop empty structs with only omit empty fields.
53
+ if in .Deprecated != nil {
54
+ if in .Deprecated .V1Beta1 == nil || reflect .DeepEqual (in .Deprecated .V1Beta1 , & addonsv1.ExtensionConfigV1Beta1DeprecatedStatus {}) {
55
+ in .Deprecated = nil
56
+ }
57
+ }
58
+ }
59
+
60
+ func spokeExtensionConfigStatus (in * ExtensionConfigStatus , c fuzz.Continue ) {
61
+ c .FuzzNoCustom (in )
62
+ // Drop empty structs with only omit empty fields.
63
+ if in .V1Beta2 != nil {
64
+ if reflect .DeepEqual (in .V1Beta2 , & ExtensionConfigV1Beta2Status {}) {
65
+ in .V1Beta2 = nil
66
+ }
67
+ }
43
68
}
You can’t perform that action at this time.
0 commit comments