Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit d106e89

Browse files
author
Yifan Gu
committed
vendor: Add etcd-operator-vendor patch file.
Patch the vendor during the build. This is a temporal fix for client-go vendoring conflicts.
1 parent 1f14a99 commit d106e89

File tree

2 files changed

+78
-3
lines changed

2 files changed

+78
-3
lines changed

Makefile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,25 @@ GOPATH_BIN:=$(shell echo ${GOPATH} | awk 'BEGIN { FS = ":" }; { print $1 }')/bin
88
LDFLAGS=-X github.com/kubernetes-incubator/bootkube/pkg/version.Version=$(shell $(CURDIR)/build/git-version.sh)
99

1010
all: \
11+
patch \
1112
_output/bin/linux/bootkube \
1213
_output/bin/darwin/bootkube \
13-
_output/bin/linux/checkpoint
14+
_output/bin/linux/checkpoint \
15+
unpatch
1416

15-
release: clean check \
16-
_output/release/bootkube.tar.gz
17+
patch:
18+
@echo "Patching etcd-operator vendor, this is a temporal fix for client-go vendor conflicts"
19+
@git apply etcd-operator-vendor.patch
20+
21+
unpatch:
22+
@git apply -R etcd-operator-vendor.patch
23+
24+
release: \
25+
clean \
26+
patch \
27+
check \
28+
_output/release/bootkube.tar.gz \
29+
unpatch
1730

1831
check:
1932
@find . -name vendor -prune -o -name '*.go' -exec gofmt -s -d {} +

etcd-operator-vendor.patch

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
diff --git a/vendor/github.com/coreos/etcd-operator/pkg/spec/cluster.go b/vendor/github.com/coreos/etcd-operator/pkg/spec/cluster.go
2+
index dbafdff..cbe1fd2 100644
3+
--- a/vendor/github.com/coreos/etcd-operator/pkg/spec/cluster.go
4+
+++ b/vendor/github.com/coreos/etcd-operator/pkg/spec/cluster.go
5+
@@ -21,8 +21,7 @@ import (
6+
"strings"
7+
"time"
8+
9+
- "k8s.io/client-go/pkg/api/meta/metatypes"
10+
- "k8s.io/client-go/pkg/api/unversioned"
11+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12+
"k8s.io/client-go/pkg/api/v1"
13+
)
14+
15+
@@ -45,17 +44,17 @@ func TPRName() string {
16+
}
17+
18+
type Cluster struct {
19+
- unversioned.TypeMeta `json:",inline"`
20+
- Metadata v1.ObjectMeta `json:"metadata,omitempty"`
21+
- Spec ClusterSpec `json:"spec"`
22+
- Status ClusterStatus `json:"status"`
23+
+ metav1.TypeMeta `json:",inline"`
24+
+ Metadata v1.ObjectMeta `json:"metadata,omitempty"`
25+
+ Spec ClusterSpec `json:"spec"`
26+
+ Status ClusterStatus `json:"status"`
27+
}
28+
29+
-func (c *Cluster) AsOwner() metatypes.OwnerReference {
30+
+func (c *Cluster) AsOwner() metav1.OwnerReference {
31+
trueVar := true
32+
// TODO: In 1.6 this is gonna be "k8s.io/kubernetes/pkg/apis/meta/v1"
33+
- // Both api.OwnerReference and metatypes.OwnerReference are combined into that.
34+
- return metatypes.OwnerReference{
35+
+ // Both api.OwnerReference and metav1.OwnerReference are combined into that.
36+
+ return metav1.OwnerReference{
37+
APIVersion: c.APIVersion,
38+
Kind: c.Kind,
39+
Name: c.Metadata.Name,
40+
diff --git a/vendor/github.com/coreos/etcd-operator/pkg/spec/etcd_cluster_list.go b/vendor/github.com/coreos/etcd-operator/pkg/spec/etcd_cluster_list.go
41+
index 4d8bfd7..c4996bc 100644
42+
--- a/vendor/github.com/coreos/etcd-operator/pkg/spec/etcd_cluster_list.go
43+
+++ b/vendor/github.com/coreos/etcd-operator/pkg/spec/etcd_cluster_list.go
44+
@@ -17,15 +17,15 @@ package spec
45+
import (
46+
"encoding/json"
47+
48+
- "k8s.io/client-go/pkg/api/unversioned"
49+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
50+
)
51+
52+
// ClusterList is a list of etcd clusters.
53+
type ClusterList struct {
54+
- unversioned.TypeMeta `json:",inline"`
55+
+ metav1.TypeMeta `json:",inline"`
56+
// Standard list metadata
57+
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
58+
- Metadata unversioned.ListMeta `json:"metadata,omitempty"`
59+
+ Metadata metav1.ListMeta `json:"metadata,omitempty"`
60+
// Items is a list of third party objects
61+
Items []Cluster `json:"items"`
62+
}

0 commit comments

Comments
 (0)