Skip to content

Commit 1705e84

Browse files
committed
Update code to work with new Kubernetes 1.12.2 dependencies
1 parent 8190265 commit 1705e84

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pkg/client/unstructured_client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (uc *unstructuredClient) Create(_ context.Context, obj runtime.Object) erro
4646
if err != nil {
4747
return err
4848
}
49-
i, err := r.Create(u)
49+
i, err := r.Create(u, metav1.CreateOptions{})
5050
if err != nil {
5151
return err
5252
}
@@ -64,7 +64,7 @@ func (uc *unstructuredClient) Update(_ context.Context, obj runtime.Object) erro
6464
if err != nil {
6565
return err
6666
}
67-
i, err := r.Update(u)
67+
i, err := r.Update(u, metav1.UpdateOptions{})
6868
if err != nil {
6969
return err
7070
}
@@ -142,7 +142,7 @@ func (uc *unstructuredClient) UpdateStatus(_ context.Context, obj runtime.Object
142142
if err != nil {
143143
return err
144144
}
145-
i, err := r.UpdateStatus(u)
145+
i, err := r.UpdateStatus(u, metav1.UpdateOptions{})
146146
if err != nil {
147147
return err
148148
}

pkg/manager/internal.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func (cm *controllerManager) startLeaderElection() (err error) {
268268
RenewDeadline: 10 * time.Second,
269269
RetryPeriod: 2 * time.Second,
270270
Callbacks: leaderelection.LeaderCallbacks{
271-
OnStartedLeading: func(_ <-chan struct{}) {
271+
OnStartedLeading: func(_ context.Context) {
272272
cm.start()
273273
},
274274
OnStoppedLeading: func() {
@@ -284,6 +284,6 @@ func (cm *controllerManager) startLeaderElection() (err error) {
284284
}
285285

286286
// Start the leader elector process
287-
go l.Run()
287+
go l.Run(context.Background())
288288
return nil
289289
}

pkg/runtime/scheme/scheme_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var _ = Describe("Scheme", func() {
3737
Build()
3838
Expect(err).NotTo(HaveOccurred())
3939

40-
Expect(s.AllKnownTypes()).To(HaveLen(13))
40+
Expect(s.AllKnownTypes()).To(HaveLen(15))
4141
Expect(s.AllKnownTypes()[gv.WithKind("Pod")]).To(Equal(reflect.TypeOf(corev1.Pod{})))
4242
Expect(s.AllKnownTypes()[gv.WithKind("PodList")]).To(Equal(reflect.TypeOf(corev1.PodList{})))
4343

@@ -71,7 +71,7 @@ var _ = Describe("Scheme", func() {
7171
Build()
7272

7373
Expect(err).NotTo(HaveOccurred())
74-
Expect(s.AllKnownTypes()).To(HaveLen(21))
74+
Expect(s.AllKnownTypes()).To(HaveLen(25))
7575

7676
// Types from b1
7777
Expect(s.AllKnownTypes()[gv1.WithKind("Pod")]).To(Equal(reflect.TypeOf(corev1.Pod{})))

0 commit comments

Comments
 (0)