Skip to content

Commit

Permalink
use Update() instead of Status.Update() as CustomResourceSubresources…
Browse files Browse the repository at this point in the history
… might not be enable
  • Loading branch information
enxebre committed Oct 19, 2018
1 parent 63beccd commit a023a30
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
35 changes: 35 additions & 0 deletions 0001-use-Update-instead-of-Status.Update-as-CustomResourc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 16531c16bfa5030bb5f85d75f20353eeff46ba25 Mon Sep 17 00:00:00 2001
From: Enxebre <[email protected]>
Date: Fri, 19 Oct 2018 09:51:27 +0200
Subject: [PATCH] use Update() instead of Status.Update() as
CustomResourceSubresources might not be enable

---
vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node.go
index cb16730b..f1a4bff3 100644
--- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node.go
+++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node.go
@@ -75,7 +75,7 @@ func (c *ReconcileNode) link(node *corev1.Node) error {
t := metav1.Now()
machine.Status.LastUpdated = &t
machine.Status.NodeRef = objectRef(node)
- if err = c.Client.Status().Update(context.Background(), machine); err != nil {
+ if err = c.Client.Update(context.Background(), machine); err != nil {
glog.Errorf("Error updating machine to link to node: %v\n", err)
} else {
glog.Infof("Successfully linked machine %s to node %s\n",
@@ -121,7 +121,7 @@ func (c *ReconcileNode) unlink(node *corev1.Node) error {
t := metav1.Now()
machine.Status.LastUpdated = &t
machine.Status.NodeRef = nil
- if err = c.Client.Status().Update(context.Background(), machine); err != nil {
+ if err = c.Client.Update(context.Background(), machine); err != nil {
glog.Errorf("Error updating machine %s to unlink node %s: %v\n",
machine.ObjectMeta.Name, node.ObjectMeta.Name, err)
} else {
--
2.15.2 (Apple Git-101.1)

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ vendor:
dep ensure -v -update
patch -p1 < 0001-Delete-annotated-machines-first-when-scaling-down.patch
patch -p1 < 0002-Sort-machines-before-syncing.patch
patch -p1 < 0001-use-Update-instead-of-Status.Update-as-CustomResourc.patch

.PHONY: generate
generate: gendeepcopy generate-mocks
Expand Down
4 changes: 2 additions & 2 deletions vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a023a30

Please sign in to comment.