Skip to content

Commit

Permalink
Update code to work with new Kubernetes 1.12.2 dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson committed Nov 22, 2018
1 parent 8190265 commit 1705e84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/client/unstructured_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (uc *unstructuredClient) Create(_ context.Context, obj runtime.Object) erro
if err != nil {
return err
}
i, err := r.Create(u)
i, err := r.Create(u, metav1.CreateOptions{})
if err != nil {
return err
}
Expand All @@ -64,7 +64,7 @@ func (uc *unstructuredClient) Update(_ context.Context, obj runtime.Object) erro
if err != nil {
return err
}
i, err := r.Update(u)
i, err := r.Update(u, metav1.UpdateOptions{})
if err != nil {
return err
}
Expand Down Expand Up @@ -142,7 +142,7 @@ func (uc *unstructuredClient) UpdateStatus(_ context.Context, obj runtime.Object
if err != nil {
return err
}
i, err := r.UpdateStatus(u)
i, err := r.UpdateStatus(u, metav1.UpdateOptions{})
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/manager/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (cm *controllerManager) startLeaderElection() (err error) {
RenewDeadline: 10 * time.Second,
RetryPeriod: 2 * time.Second,
Callbacks: leaderelection.LeaderCallbacks{
OnStartedLeading: func(_ <-chan struct{}) {
OnStartedLeading: func(_ context.Context) {
cm.start()
},
OnStoppedLeading: func() {
Expand All @@ -284,6 +284,6 @@ func (cm *controllerManager) startLeaderElection() (err error) {
}

// Start the leader elector process
go l.Run()
go l.Run(context.Background())
return nil
}
4 changes: 2 additions & 2 deletions pkg/runtime/scheme/scheme_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var _ = Describe("Scheme", func() {
Build()
Expect(err).NotTo(HaveOccurred())

Expect(s.AllKnownTypes()).To(HaveLen(13))
Expect(s.AllKnownTypes()).To(HaveLen(15))
Expect(s.AllKnownTypes()[gv.WithKind("Pod")]).To(Equal(reflect.TypeOf(corev1.Pod{})))
Expect(s.AllKnownTypes()[gv.WithKind("PodList")]).To(Equal(reflect.TypeOf(corev1.PodList{})))

Expand Down Expand Up @@ -71,7 +71,7 @@ var _ = Describe("Scheme", func() {
Build()

Expect(err).NotTo(HaveOccurred())
Expect(s.AllKnownTypes()).To(HaveLen(21))
Expect(s.AllKnownTypes()).To(HaveLen(25))

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

0 comments on commit 1705e84

Please sign in to comment.