@@ -17,7 +17,7 @@ limitations under the License.
17
17
package fuzzer
18
18
19
19
import (
20
- fuzz "github.com/google/gofuzz "
20
+ "sigs.k8s.io/randfill "
21
21
22
22
corev1 "k8s.io/api/core/v1"
23
23
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -46,8 +46,8 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
46
46
}
47
47
}
48
48
49
- func fuzzInitConfiguration (obj * kubeadm.InitConfiguration , c fuzz .Continue ) {
50
- c .FuzzNoCustom (obj )
49
+ func fuzzInitConfiguration (obj * kubeadm.InitConfiguration , c randfill .Continue ) {
50
+ c .FillNoCustom (obj )
51
51
52
52
// Pinning values for fields that get defaults if fuzz value is empty string or nil (thus making the round trip test fail)
53
53
@@ -71,16 +71,16 @@ func fuzzInitConfiguration(obj *kubeadm.InitConfiguration, c fuzz.Continue) {
71
71
kubeadm .SetDefaultTimeouts (& obj .Timeouts )
72
72
}
73
73
74
- func fuzzNodeRegistration (obj * kubeadm.NodeRegistrationOptions , c fuzz .Continue ) {
75
- c .FuzzNoCustom (obj )
74
+ func fuzzNodeRegistration (obj * kubeadm.NodeRegistrationOptions , c randfill .Continue ) {
75
+ c .FillNoCustom (obj )
76
76
77
77
// Pinning values for fields that get defaults if fuzz value is empty string or nil (thus making the round trip test fail)
78
78
obj .IgnorePreflightErrors = nil
79
79
obj .ImagePullSerial = ptr .To (true )
80
80
}
81
81
82
- func fuzzClusterConfiguration (obj * kubeadm.ClusterConfiguration , c fuzz .Continue ) {
83
- c .FuzzNoCustom (obj )
82
+ func fuzzClusterConfiguration (obj * kubeadm.ClusterConfiguration , c randfill .Continue ) {
83
+ c .FillNoCustom (obj )
84
84
85
85
// Pinning values for fields that get defaults if fuzz value is empty string or nil (thus making the round trip test fail)
86
86
obj .CertificatesDir = "foo"
@@ -100,33 +100,33 @@ func fuzzClusterConfiguration(obj *kubeadm.ClusterConfiguration, c fuzz.Continue
100
100
obj .CACertificateValidityPeriod = & metav1.Duration {Duration : constants .CACertificateValidityPeriod }
101
101
}
102
102
103
- func fuzzDNS (obj * kubeadm.DNS , c fuzz .Continue ) {
104
- c .FuzzNoCustom (obj )
103
+ func fuzzDNS (obj * kubeadm.DNS , c randfill .Continue ) {
104
+ c .FillNoCustom (obj )
105
105
obj .Disabled = false
106
106
}
107
107
108
- func fuzzComponentConfigMap (obj * kubeadm.ComponentConfigMap , c fuzz .Continue ) {
108
+ func fuzzComponentConfigMap (obj * kubeadm.ComponentConfigMap , c randfill .Continue ) {
109
109
// This is intentionally empty because component config does not exists in the public api
110
110
// (empty mean all ComponentConfigs fields nil, and this is necessary for getting roundtrip passing)
111
111
}
112
112
113
- func fuzzLocalEtcd (obj * kubeadm.LocalEtcd , c fuzz .Continue ) {
114
- c .FuzzNoCustom (obj )
113
+ func fuzzLocalEtcd (obj * kubeadm.LocalEtcd , c randfill .Continue ) {
114
+ c .FillNoCustom (obj )
115
115
116
116
// Pinning values for fields that get defaults if fuzz value is empty string or nil (thus making the round trip test fail)
117
117
obj .DataDir = "foo"
118
118
}
119
119
120
- func fuzzNetworking (obj * kubeadm.Networking , c fuzz .Continue ) {
121
- c .FuzzNoCustom (obj )
120
+ func fuzzNetworking (obj * kubeadm.Networking , c randfill .Continue ) {
121
+ c .FillNoCustom (obj )
122
122
123
123
// Pinning values for fields that get defaults if fuzz value is empty string or nil (thus making the round trip test fail)
124
124
obj .DNSDomain = "foo"
125
125
obj .ServiceSubnet = "bar"
126
126
}
127
127
128
- func fuzzJoinConfiguration (obj * kubeadm.JoinConfiguration , c fuzz .Continue ) {
129
- c .FuzzNoCustom (obj )
128
+ func fuzzJoinConfiguration (obj * kubeadm.JoinConfiguration , c randfill .Continue ) {
129
+ c .FillNoCustom (obj )
130
130
131
131
// Pinning values for fields that get defaults if fuzz value is empty string or nil (thus making the round trip test fail)
132
132
obj .CACertPath = "foo"
@@ -143,20 +143,20 @@ func fuzzJoinConfiguration(obj *kubeadm.JoinConfiguration, c fuzz.Continue) {
143
143
kubeadm .SetDefaultTimeouts (& obj .Timeouts )
144
144
}
145
145
146
- func fuzzJoinControlPlane (obj * kubeadm.JoinControlPlane , c fuzz .Continue ) {
147
- c .FuzzNoCustom (obj )
146
+ func fuzzJoinControlPlane (obj * kubeadm.JoinControlPlane , c randfill .Continue ) {
147
+ c .FillNoCustom (obj )
148
148
}
149
149
150
- func fuzzResetConfiguration (obj * kubeadm.ResetConfiguration , c fuzz .Continue ) {
151
- c .FuzzNoCustom (obj )
150
+ func fuzzResetConfiguration (obj * kubeadm.ResetConfiguration , c randfill .Continue ) {
151
+ c .FillNoCustom (obj )
152
152
153
153
// Pinning values for fields that get defaults if fuzz value is empty string or nil (thus making the round trip test fail)
154
154
obj .CertificatesDir = "/tmp"
155
155
kubeadm .SetDefaultTimeouts (& obj .Timeouts )
156
156
}
157
157
158
- func fuzzUpgradeConfiguration (obj * kubeadm.UpgradeConfiguration , c fuzz .Continue ) {
159
- c .FuzzNoCustom (obj )
158
+ func fuzzUpgradeConfiguration (obj * kubeadm.UpgradeConfiguration , c randfill .Continue ) {
159
+ c .FillNoCustom (obj )
160
160
161
161
// Pinning values for fields that get defaults if fuzz value is empty string or nil (thus making the round trip test fail)
162
162
obj .Node .EtcdUpgrade = ptr .To (true )
0 commit comments