Skip to content
Merged

Crd #81

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
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)

11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-aws
# This expects that the context passed to the docker build command is
# the cluster-api-provider-aws directory.
# e.g. docker build -t <tag> -f <this_Dockerfile> <path_to_cluster-api-aws>
COPY . .
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY vendor/ vendor/

RUN GOPATH="/go" CGO_ENABLED=0 GOOS=linux go install -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/machine-controller
RUN GOPATH="/go" CGO_ENABLED=0 GOOS=linux go install -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/vendor/sigs.k8s.io/cluster-api/cmd/controller-manager

RUN GOPATH="/go" CGO_ENABLED=0 GOOS=linux go build -o /go/bin/machine-controller-manager -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/manager
RUN GOPATH="/go" CGO_ENABLED=0 GOOS=linux go build -o /go/bin/manager -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/vendor/sigs.k8s.io/cluster-api/cmd/manager

# Final container
FROM openshift/origin-base
RUN yum install -y ca-certificates openssh

COPY --from=builder /go/bin/machine-controller /go/bin/controller-manager .
COPY --from=builder /go/bin/manager /go/bin/machine-controller-manager /
Loading