Skip to content

Commit 03597e1

Browse files
Eric Stroczynskireinvantveer
Eric Stroczynski
authored and
reinvantveer
committed
deps: bump operator-sdk deps to k8s v1.19 (operator-framework#4294)
This commit bumps operator-sdk binary dependencies to k8s v1.19 go.mod,go.sum: update controller-runtime, controller-tools, api, operator-lib, and operator-registry to their k8s v1.19 equivalents *: make API changes Signed-off-by: reinvantveer <[email protected]>
1 parent 3aa4ca5 commit 03597e1

File tree

20 files changed

+102
-100
lines changed

20 files changed

+102
-100
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
entries:
2+
- description: >
3+
Bumped `operator-sdk` binary dependencies to their k8s v1.19 equivalents.
4+
kind: change

go.mod

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ require (
1111
github.com/markbates/inflect v1.0.4
1212
github.com/onsi/ginkgo v1.14.1
1313
github.com/onsi/gomega v1.10.2
14-
github.com/operator-framework/api v0.3.20
15-
github.com/operator-framework/operator-lib v0.2.1-0.20201119204525-6700ae54da56
16-
github.com/operator-framework/operator-registry v1.14.3
14+
github.com/operator-framework/api v0.4.0
15+
github.com/operator-framework/operator-lib v0.3.0
16+
github.com/operator-framework/operator-registry v1.15.3
1717
github.com/prometheus/client_golang v1.7.1
1818
github.com/sergi/go-diff v1.0.0
1919
github.com/sirupsen/logrus v1.7.0
@@ -32,9 +32,9 @@ require (
3232
k8s.io/client-go v0.19.4
3333
k8s.io/kubectl v0.19.4
3434
rsc.io/letsencrypt v0.0.3 // indirect
35-
sigs.k8s.io/controller-runtime v0.7.0-alpha.7
36-
sigs.k8s.io/controller-tools v0.3.0
37-
sigs.k8s.io/kubebuilder/v2 v2.3.2-0.20201204230216-593f2e80cdf6
35+
sigs.k8s.io/controller-runtime v0.7.0
36+
sigs.k8s.io/controller-tools v0.4.1
37+
sigs.k8s.io/kubebuilder/v2 v2.3.2-0.20201211222127-503ba3b7e4ad
3838
sigs.k8s.io/yaml v1.2.0
3939
)
4040

go.sum

+14-21
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,6 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG
295295
github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=
296296
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
297297
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
298-
github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE=
299-
github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
300298
github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs=
301299
github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
302300
github.com/go-logr/zapr v0.1.0 h1:h+WVe9j6HAA01niTJPA/kKH0i7e0rLZBCwauQFcRE54=
@@ -709,13 +707,13 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS
709707
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
710708
github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
711709
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
712-
github.com/operator-framework/api v0.3.7-0.20200602203552-431198de9fc2/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
713-
github.com/operator-framework/api v0.3.20 h1:2Ks8GXXl/H2sV9ll2iQBUO65ABQ5VuzN3IKEZCJWljo=
714-
github.com/operator-framework/api v0.3.20/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
715-
github.com/operator-framework/operator-lib v0.2.1-0.20201119204525-6700ae54da56 h1:RFuLAujDg2trSdvasocuc4MM/QS8eKRYmTerKQxIrv0=
716-
github.com/operator-framework/operator-lib v0.2.1-0.20201119204525-6700ae54da56/go.mod h1:7JYMD1tU8z+dvtttqwPC59lOTEGAQRdGr+VlxkGJW2k=
717-
github.com/operator-framework/operator-registry v1.14.3 h1:WiIYJy9cfnbzvlwoO5ikgqHnj/WwKLqItJlTz5EeEzQ=
718-
github.com/operator-framework/operator-registry v1.14.3/go.mod h1:0x4Kkl/1LaK5g/6XgEiJrHF/jEAW3QKYg91M4sYuN0o=
710+
github.com/operator-framework/api v0.3.22/go.mod h1:GVNiB6AQucwdZz3ZFXNv9HtcLOzcFnr6O/QldzKG93g=
711+
github.com/operator-framework/api v0.4.0 h1:OeuGMXScjwosNKXttH3uorywr7APT5luTNPWy3zvqXs=
712+
github.com/operator-framework/api v0.4.0/go.mod h1:xXYReW8+PpSBHMxsf0e7uhtfQTLqIM1iz4X6zUs20+c=
713+
github.com/operator-framework/operator-lib v0.3.0 h1:eGJv0k7dEHIT9vfArWPo6U4eVurAOqhYUzXiHEaZq9g=
714+
github.com/operator-framework/operator-lib v0.3.0/go.mod h1:LTp5UQd8ivq4MXqm/W/XHulHQ0RRoZXsAj73sNMAQxc=
715+
github.com/operator-framework/operator-registry v1.15.3 h1:C+u+zjDh6yQAKN+DbUvPeLjojZtJftvp/J28rRqiWWU=
716+
github.com/operator-framework/operator-registry v1.15.3/go.mod h1:CI7cu5ANoSQB54XWr/hXefm1PbKNJztSrhGBEDLCNCg=
719717
github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k=
720718
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
721719
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
@@ -830,7 +828,6 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU
830828
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
831829
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
832830
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
833-
github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
834831
github.com/spf13/cobra v0.0.7/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
835832
github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8=
836833
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
@@ -898,8 +895,6 @@ github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wK
898895
gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE=
899896
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
900897
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
901-
go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
902-
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
903898
go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0=
904899
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
905900
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
@@ -1015,13 +1010,10 @@ golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLL
10151010
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
10161011
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
10171012
golang.org/x/net v0.0.0-20191021144547-ec77196f6094/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
1018-
golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
10191013
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
10201014
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
10211015
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
10221016
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
1023-
golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4=
1024-
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
10251017
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
10261018
golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
10271019
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
@@ -1141,6 +1133,7 @@ golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapK
11411133
golang.org/x/tools v0.0.0-20200403190813-44a64ad78b9b h1:AFZdJUT7jJYXQEC29hYH/WZkoV7+KhwxQGmdZ19yYoY=
11421134
golang.org/x/tools v0.0.0-20200403190813-44a64ad78b9b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
11431135
golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
1136+
golang.org/x/tools v0.0.0-20200616195046-dc31b401abb5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
11441137
golang.org/x/tools v0.0.0-20201014231627-1610a49f37af h1:VIUWFyOgzG3c0t9KYop5Ybp4m56LupfOnFYX7Ipnz+I=
11451138
golang.org/x/tools v0.0.0-20201014231627-1610a49f37af/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
11461139
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -1355,14 +1348,14 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT
13551348
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.9 h1:rusRLrDhjBp6aYtl9sGEvQJr6faoHoDLd0YcUBTZguI=
13561349
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.9/go.mod h1:dzAXnQbTRyDlZPJX2SUPEqvnB+j7AJjtlox7PEwigU0=
13571350
sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo=
1358-
sigs.k8s.io/controller-runtime v0.7.0-alpha.6 h1:ieFqEijQyDEZVIGwI5sYkk7VTa8Itim0kU/TCOnCkto=
1359-
sigs.k8s.io/controller-runtime v0.7.0-alpha.6/go.mod h1:03b1n6EtlDvuBPPEOHadJUusruwLWgoT4BDCybMibnA=
1360-
sigs.k8s.io/controller-runtime v0.7.0-alpha.7 h1:KtMmb2Ef/S38GNbf0Jpa+FWXqnxFYeWAyhipMmmPCcQ=
1361-
sigs.k8s.io/controller-runtime v0.7.0-alpha.7/go.mod h1:pJ3YBrJiAqMAZKi6UVGuE98ZrroV1p+pIhoHsMm9wdU=
1351+
sigs.k8s.io/controller-runtime v0.7.0 h1:bU20IBBEPccWz5+zXpLnpVsgBYxqclaHu1pVDl/gEt8=
1352+
sigs.k8s.io/controller-runtime v0.7.0/go.mod h1:pJ3YBrJiAqMAZKi6UVGuE98ZrroV1p+pIhoHsMm9wdU=
13621353
sigs.k8s.io/controller-tools v0.3.0 h1:y3YD99XOyWaXkiF1kd41uRvfp/64teWcrEZFuHxPhJ4=
13631354
sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI=
1364-
sigs.k8s.io/kubebuilder/v2 v2.3.2-0.20201204230216-593f2e80cdf6 h1:SE+xhj4aauOCSeZKjRizd6VwHgkVfJABJpVk/xqYTiI=
1365-
sigs.k8s.io/kubebuilder/v2 v2.3.2-0.20201204230216-593f2e80cdf6/go.mod h1:J/D/179LBZhQOhRvmMRNbje/Bk+PjbN0/fzUupmO7+U=
1355+
sigs.k8s.io/controller-tools v0.4.1 h1:VkuV0MxlRPmRu5iTgBZU4UxUX2LiR99n3sdQGRxZF4w=
1356+
sigs.k8s.io/controller-tools v0.4.1/go.mod h1:G9rHdZMVlBDocIxGkK3jHLWqcTMNvveypYJwrvYKjWU=
1357+
sigs.k8s.io/kubebuilder/v2 v2.3.2-0.20201211222127-503ba3b7e4ad h1:QCCQLxLLZsNKgp49jG0rErcSz9oa/4J5WU7lnaEA99A=
1358+
sigs.k8s.io/kubebuilder/v2 v2.3.2-0.20201211222127-503ba3b7e4ad/go.mod h1:J/D/179LBZhQOhRvmMRNbje/Bk+PjbN0/fzUupmO7+U=
13661359
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
13671360
sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
13681361
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=

hack/generate/samples/internal/go/v2/memcached_with_webhooks.go

+4-7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ func (mh *MemcachedGoWithWebhooks) Prepare() {
5959
func (mh *MemcachedGoWithWebhooks) Run() {
6060
log.Infof("creating the project")
6161
err := mh.ctx.Init(
62+
// TODO(estroz): change this to 3 when stabilized.
63+
"--project-version", "3-alpha",
6264
"--plugins", "go/v2",
6365
"--repo", "github.com/example/memcached-operator",
6466
"--domain",
@@ -176,13 +178,8 @@ func (mh *MemcachedGoWithWebhooks) implementingWebhooks() {
176178
// Add imports
177179
err = kbtestutils.InsertCode(webhookPath,
178180
"import (",
179-
"\n\t\"errors\"")
180-
pkg.CheckError("adding errors import", err)
181-
182-
err = kbtestutils.InsertCode(webhookPath,
183-
"\n\t\"errors\"",
184-
"\n\t\"k8s.io/apimachinery/pkg/runtime\"")
185-
pkg.CheckError("adding k8s.io/apimachinery/pkg/runtime import", err)
181+
"\"errors\"\n\n\"k8s.io/apimachinery/pkg/runtime\"")
182+
pkg.CheckError("adding webhook imports", err)
186183
}
187184

188185
// implementingController will customize the Controller

hack/generate/samples/internal/go/v3/memcached_with_webhooks.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ func (mh *MemcachedGoWithWebhooks) Prepare() {
5959
func (mh *MemcachedGoWithWebhooks) Run() {
6060
log.Infof("creating the project")
6161
err := mh.ctx.Init(
62-
// TODO(estroz): change this to go/v3 is stabilized.
62+
// TODO(estroz): change this to 3 when stabilized.
63+
"--project-version", "3-alpha",
64+
// TODO(estroz): change this to go/v3 when stabilized.
6365
"--plugins", "go/v3-alpha",
6466
"--repo", "github.com/example/memcached-operator",
6567
"--domain",
@@ -168,11 +170,11 @@ func (mh *MemcachedGoWithWebhooks) implementingWebhooks() {
168170
err := kbtestutils.InsertCode(webhookPath,
169171
"// TODO(user): fill in your defaulting logic.\n}",
170172
webhooksFragment)
171-
pkg.CheckError("replacing reconcile", err)
173+
pkg.CheckError("replacing webhook validate implementation", err)
172174

173175
err = testutils.ReplaceInFile(webhookPath,
174176
"// TODO(user): fill in your defaulting logic.", "if r.Spec.Size == 0 {\n\t\tr.Spec.Size = 3\n\t}")
175-
pkg.CheckError("replacing default webhook implementation", err)
177+
pkg.CheckError("replacing webhook default implementation", err)
176178

177179
// Add imports
178180
err = kbtestutils.InsertCode(webhookPath,
@@ -420,7 +422,7 @@ const watchCustomizedFragment = `return ctrl.NewControllerManagedBy(mgr).
420422

421423
const webhooksFragment = `
422424
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
423-
// +kubebuilder:webhook:path=/validate-cache-example-com-v1alpha1-memcached,mutating=false,failurePolicy=fail,sideEffects=None,groups=cache.example.com,resources=memcacheds,verbs=create;update,versions=v1alpha1,name=vmemcached.kb.io,admissionReviewVersions={v1beta1}
425+
// +kubebuilder:webhook:path=/validate-cache-example-com-v1alpha1-memcached,mutating=false,failurePolicy=fail,sideEffects=None,groups=cache.example.com,resources=memcacheds,verbs=create;update,versions=v1alpha1,name=vmemcached.kb.io,admissionReviewVersions={v1,v1beta1}
424426
425427
var _ webhook.Validator = &Memcached{}
426428

internal/ansible/controller/reconcile_test.go

+17-17
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestReconcile(t *testing.T) {
6262
Runner: &fake.Runner{
6363
JobEvents: []eventapi.JobEvent{},
6464
},
65-
Client: fakeclient.NewFakeClient(),
65+
Client: fakeclient.NewClientBuilder().Build(),
6666
Result: reconcile.Result{},
6767
Request: reconcile.Request{
6868
NamespacedName: types.NamespacedName{
@@ -84,7 +84,7 @@ func TestReconcile(t *testing.T) {
8484
},
8585
},
8686
},
87-
Client: fakeclient.NewFakeClient(&unstructured.Unstructured{
87+
Client: fakeclient.NewClientBuilder().WithObjects(&unstructured.Unstructured{
8888
Object: map[string]interface{}{
8989
"metadata": map[string]interface{}{
9090
"name": "reconcile",
@@ -93,7 +93,7 @@ func TestReconcile(t *testing.T) {
9393
"apiVersion": "operator-sdk/v1beta1",
9494
"kind": "Testing",
9595
},
96-
}),
96+
}).Build(),
9797
Result: reconcile.Result{
9898
RequeueAfter: 5 * time.Second,
9999
},
@@ -153,7 +153,7 @@ func TestReconcile(t *testing.T) {
153153
},
154154
},
155155
},
156-
Client: fakeclient.NewFakeClient(&unstructured.Unstructured{
156+
Client: fakeclient.NewClientBuilder().WithObjects(&unstructured.Unstructured{
157157
Object: map[string]interface{}{
158158
"metadata": map[string]interface{}{
159159
"name": "reconcile",
@@ -163,7 +163,7 @@ func TestReconcile(t *testing.T) {
163163
"kind": "Testing",
164164
"spec": map[string]interface{}{},
165165
},
166-
}),
166+
}).Build(),
167167
Request: reconcile.Request{
168168
NamespacedName: types.NamespacedName{
169169
Name: "reconcile",
@@ -227,7 +227,7 @@ func TestReconcile(t *testing.T) {
227227
},
228228
},
229229
},
230-
Client: fakeclient.NewFakeClient(&unstructured.Unstructured{
230+
Client: fakeclient.NewClientBuilder().WithObjects(&unstructured.Unstructured{
231231
Object: map[string]interface{}{
232232
"metadata": map[string]interface{}{
233233
"name": "reconcile",
@@ -237,7 +237,7 @@ func TestReconcile(t *testing.T) {
237237
"kind": "Testing",
238238
"spec": map[string]interface{}{},
239239
},
240-
}),
240+
}).Build(),
241241
Request: reconcile.Request{
242242
NamespacedName: types.NamespacedName{
243243
Name: "reconcile",
@@ -260,7 +260,7 @@ func TestReconcile(t *testing.T) {
260260
},
261261
Finalizer: "testing.io",
262262
},
263-
Client: fakeclient.NewFakeClient(&unstructured.Unstructured{
263+
Client: fakeclient.NewClientBuilder().WithObjects(&unstructured.Unstructured{
264264
Object: map[string]interface{}{
265265
"metadata": map[string]interface{}{
266266
"name": "reconcile",
@@ -273,7 +273,7 @@ func TestReconcile(t *testing.T) {
273273
"kind": "Testing",
274274
"spec": map[string]interface{}{},
275275
},
276-
}),
276+
}).Build(),
277277
Result: reconcile.Result{
278278
RequeueAfter: 3 * time.Second,
279279
},
@@ -331,7 +331,7 @@ func TestReconcile(t *testing.T) {
331331
},
332332
Finalizer: "testing.io",
333333
},
334-
Client: fakeclient.NewFakeClient(&unstructured.Unstructured{
334+
Client: fakeclient.NewClientBuilder().WithObjects(&unstructured.Unstructured{
335335
Object: map[string]interface{}{
336336
"metadata": map[string]interface{}{
337337
"name": "reconcile",
@@ -345,7 +345,7 @@ func TestReconcile(t *testing.T) {
345345
"kind": "Testing",
346346
"spec": map[string]interface{}{},
347347
},
348-
}),
348+
}).Build(),
349349
Result: reconcile.Result{},
350350
Request: reconcile.Request{
351351
NamespacedName: types.NamespacedName{
@@ -368,7 +368,7 @@ func TestReconcile(t *testing.T) {
368368
},
369369
Finalizer: "testing.io",
370370
},
371-
Client: fakeclient.NewFakeClient(&unstructured.Unstructured{
371+
Client: fakeclient.NewClientBuilder().WithObjects(&unstructured.Unstructured{
372372
Object: map[string]interface{}{
373373
"metadata": map[string]interface{}{
374374
"name": "reconcile",
@@ -399,7 +399,7 @@ func TestReconcile(t *testing.T) {
399399
},
400400
},
401401
},
402-
}),
402+
}).Build(),
403403
Result: reconcile.Result{
404404
RequeueAfter: 5 * time.Second,
405405
},
@@ -449,7 +449,7 @@ func TestReconcile(t *testing.T) {
449449
},
450450
},
451451
},
452-
Client: fakeclient.NewFakeClient(&unstructured.Unstructured{
452+
Client: fakeclient.NewClientBuilder().WithObjects(&unstructured.Unstructured{
453453
Object: map[string]interface{}{
454454
"metadata": map[string]interface{}{
455455
"name": "reconcile",
@@ -475,7 +475,7 @@ func TestReconcile(t *testing.T) {
475475
},
476476
},
477477
},
478-
}),
478+
}).Build(),
479479
Result: reconcile.Result{
480480
RequeueAfter: 5 * time.Second,
481481
},
@@ -500,7 +500,7 @@ func TestReconcile(t *testing.T) {
500500
},
501501
},
502502
},
503-
Client: fakeclient.NewFakeClient(&unstructured.Unstructured{
503+
Client: fakeclient.NewClientBuilder().WithObjects(&unstructured.Unstructured{
504504
Object: map[string]interface{}{
505505
"metadata": map[string]interface{}{
506506
"name": "reconcile",
@@ -509,7 +509,7 @@ func TestReconcile(t *testing.T) {
509509
"apiVersion": "operator-sdk/v1beta1",
510510
"kind": "Testing",
511511
},
512-
}),
512+
}).Build(),
513513
Result: reconcile.Result{
514514
RequeueAfter: 5 * time.Second,
515515
},

0 commit comments

Comments
 (0)