Kubebuilder makes it a bit annoying to figure out the versions you need properly. As of this writing, v0.2.0-beta.2 was working against Kubernetes 1.14.1.
To use this with Go Modules, put the following in your Go.mod:
module sigs.k8s.io/cluster-api
go 1.12
require (
k8s.io/api kubernetes-1.14.1
k8s.io/apimachinery kubernetes-1.14.1
k8s.io/client-go kubernetes-1.14.1
sigs.k8s.io/controller-runtime v0.2.0-beta.2
)
replace (
k8s.io/api kubernetes-1.14.1
k8s.io/apimachinery kubernetes-1.14.1
k8s.io/client-go kubernetes-1.14.1
)
"sigs.k8s.io/controller-runtime/pkg/runtime/scheme"
=>"sigs.k8s.io/controller-runtime/pkg/runtime/scheme"
"k8s.io/client-go/util/integer"
=>"k8s.io/utils/integer"
- In
List
calls, the object struct now comes before theListOptions
. - In
List
calls, the ListOptions object changed to use convenience functions. e.g.
listOpts := client.ListOptions{Namespace: ms.Namespace}
r.Client.List(context.Background(), &v1alpha1.MachineDeploymentList{}, listOpts)
vs
listOpts := client.InNamespace(ms.Namespace)
r.Client.List(context.Background(), &v1alpha1.MachineDeploymentList{}, listOpts)
manager.GetRecorder(name)
=>manager.GetEventRecorderFor(name)