Skip to content

Commit 30047c8

Browse files
authored
Merge pull request #65 from dweomer/initial-move-to-k3s-io
initial move to k3s-io
2 parents 31fbd94 + 34f0ce3 commit 30047c8

File tree

19 files changed

+160
-135
lines changed

19 files changed

+160
-135
lines changed

.drone.yml

Lines changed: 67 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
kind: pipeline
3+
type: docker
34
name: amd64
45

56
platform:
@@ -8,9 +9,11 @@ platform:
89

910
steps:
1011
- name: build
11-
image: rancher/dapper:v0.4.2
12+
image: rancher/dapper:v0.5.0
13+
environment:
14+
ARCH: "${DRONE_STAGE_ARCH}"
1215
commands:
13-
- dapper ci
16+
- dapper --file Dockerfile --target dapper ci
1417
volumes:
1518
- name: docker
1619
path: /var/run/docker.sock
@@ -20,40 +23,42 @@ steps:
2023
settings:
2124
api_key:
2225
from_secret: github_token
23-
prerelease: true
2426
checksum:
2527
- sha256
2628
checksum_file: CHECKSUMsum-amd64.txt
2729
checksum_flatten: true
2830
files:
29-
- "dist/artifacts/*"
31+
- dist/artifacts/*
32+
prerelease: true
3033
when:
34+
event:
35+
- tag
3136
instance:
32-
- drone-publish.rancher.io
37+
- drone-publish.k3s.io
3338
ref:
3439
- refs/head/master
3540
- refs/tags/*
36-
event:
37-
- tag
3841

3942
- name: docker-publish
4043
image: plugins/docker
4144
settings:
42-
dockerfile: package/Dockerfile
45+
build_args:
46+
ARCH: amd64
47+
username:
48+
from_secret: docker_username
4349
password:
4450
from_secret: docker_password
45-
repo: "rancher/kine"
51+
target: release
52+
repo: rancher/kine
4653
tag: "${DRONE_TAG}-amd64"
47-
username:
48-
from_secret: docker_username
4954
when:
55+
event:
56+
- tag
5057
instance:
51-
- drone-publish.rancher.io
58+
- drone-publish.k3s.io
5259
ref:
5360
- refs/head/master
5461
- refs/tags/*
55-
event:
56-
- tag
5762

5863
volumes:
5964
- name: docker
@@ -62,6 +67,7 @@ volumes:
6267

6368
---
6469
kind: pipeline
70+
type: docker
6571
name: arm64
6672

6773
platform:
@@ -70,9 +76,11 @@ platform:
7076

7177
steps:
7278
- name: build
73-
image: rancher/dapper:v0.4.2
79+
image: rancher/dapper:v0.5.0
80+
environment:
81+
ARCH: "${DRONE_STAGE_ARCH}"
7482
commands:
75-
- dapper ci
83+
- dapper --file Dockerfile --target dapper ci
7684
volumes:
7785
- name: docker
7886
path: /var/run/docker.sock
@@ -82,40 +90,42 @@ steps:
8290
settings:
8391
api_key:
8492
from_secret: github_token
85-
prerelease: true
8693
checksum:
8794
- sha256
8895
checksum_file: CHECKSUMsum-arm64.txt
8996
checksum_flatten: true
9097
files:
91-
- "dist/artifacts/*"
98+
- dist/artifacts/*
99+
prerelease: true
92100
when:
101+
event:
102+
- tag
93103
instance:
94-
- drone-publish.rancher.io
104+
- drone-publish.k3s.io
95105
ref:
96106
- refs/head/master
97107
- refs/tags/*
98-
event:
99-
- tag
100108

101109
- name: docker-publish
102110
image: plugins/docker
103111
settings:
104-
dockerfile: package/Dockerfile
112+
build_args:
113+
ARCH: arm64
114+
username:
115+
from_secret: docker_username
105116
password:
106117
from_secret: docker_password
107-
repo: "rancher/kine"
118+
target: release
119+
repo: rancher/kine
108120
tag: "${DRONE_TAG}-arm64"
109-
username:
110-
from_secret: docker_username
111121
when:
122+
event:
123+
- tag
112124
instance:
113-
- drone-publish.rancher.io
125+
- drone-publish.k3s.io
114126
ref:
115127
- refs/head/master
116128
- refs/tags/*
117-
event:
118-
- tag
119129

120130
volumes:
121131
- name: docker
@@ -124,6 +134,7 @@ volumes:
124134

125135
---
126136
kind: pipeline
137+
type: docker
127138
name: arm
128139

129140
platform:
@@ -132,9 +143,11 @@ platform:
132143

133144
steps:
134145
- name: build
135-
image: rancher/dapper:v0.4.2
146+
image: rancher/dapper:v0.5.0
147+
environment:
148+
ARCH: "${DRONE_STAGE_ARCH}"
136149
commands:
137-
- dapper ci
150+
- dapper --file Dockerfile --target dapper ci
138151
volumes:
139152
- name: docker
140153
path: /var/run/docker.sock
@@ -144,40 +157,42 @@ steps:
144157
settings:
145158
api_key:
146159
from_secret: github_token
147-
prerelease: true
148160
checksum:
149161
- sha256
150162
checksum_file: CHECKSUMsum-arm.txt
151163
checksum_flatten: true
152164
files:
153-
- "dist/artifacts/*"
165+
- dist/artifacts/*
166+
prerelease: true
154167
when:
168+
event:
169+
- tag
155170
instance:
156-
- drone-publish.rancher.io
171+
- drone-publish.k3s.io
157172
ref:
158173
- refs/head/master
159174
- refs/tags/*
160-
event:
161-
- tag
162175

163176
- name: docker-publish
164177
image: plugins/docker
165178
settings:
166-
dockerfile: package/Dockerfile
179+
build_args:
180+
ARCH: arm
181+
username:
182+
from_secret: docker_username
167183
password:
168184
from_secret: docker_password
169-
repo: "rancher/kine"
185+
target: release
186+
repo: rancher/kine
170187
tag: "${DRONE_TAG}-arm"
171-
username:
172-
from_secret: docker_username
173188
when:
189+
event:
190+
- tag
174191
instance:
175-
- drone-publish.rancher.io
192+
- drone-publish.k3s.io
176193
ref:
177194
- refs/head/master
178195
- refs/tags/*
179-
event:
180-
- tag
181196

182197
volumes:
183198
- name: docker
@@ -186,6 +201,7 @@ volumes:
186201

187202
---
188203
kind: pipeline
204+
type: docker
189205
name: manifest
190206

191207
platform:
@@ -194,28 +210,30 @@ platform:
194210

195211
steps:
196212
- name: manifest
197-
image: plugins/manifest:1.0.2
213+
image: plugins/manifest
198214
settings:
199215
username:
200216
from_secret: docker_username
201217
password:
202218
from_secret: docker_password
203219
platforms:
204-
- linux/amd64
205-
- linux/arm64
206-
- linux/arm
220+
- linux/amd64
221+
- linux/arm64
222+
- linux/arm
207223
target: "rancher/kine:${DRONE_TAG}"
208224
template: "rancher/kine:${DRONE_TAG}-ARCH"
209225
when:
226+
event:
227+
- tag
210228
instance:
211-
- drone-publish.rancher.io
229+
- drone-publish.k3s.io
212230
ref:
213231
- refs/head/master
214232
- refs/tags/*
215-
event:
216-
- tag
217233

218234
depends_on:
219235
- amd64
220236
- arm64
221237
- arm
238+
239+
...

Dockerfile

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1-
FROM golang:1.13.7-alpine3.11 AS builder
2-
RUN apk --no-cache add gcc musl-dev
3-
WORKDIR /go/src/github.com/rancher/kine
4-
COPY . .
5-
RUN GO111MODULE=on go build -o /bin/kine
6-
7-
FROM alpine:3.11
8-
COPY --from=builder /bin/kine /bin/kine
9-
ENTRYPOINT ["/bin/kine"]
1+
FROM golang:1.15-alpine3.12 AS dapper
2+
3+
ARG ARCH=amd64
4+
5+
RUN apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates
6+
RUN go get -d golang.org/x/lint/golint && \
7+
git -C /go/src/golang.org/x/lint/golint checkout -b current 06c8688daad7faa9da5a0c2f163a3d14aac986ca && \
8+
go install golang.org/x/lint/golint && \
9+
rm -rf /go/src /go/pkg
10+
RUN mkdir -p /go/src/golang.org/x && \
11+
cd /go/src/golang.org/x && git clone https://github.com/golang/tools && \
12+
git -C /go/src/golang.org/x/tools checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 && \
13+
go install golang.org/x/tools/cmd/goimports
14+
RUN rm -rf /go/src /go/pkg
15+
16+
RUN if [ "${ARCH}" == "amd64" ]; then \
17+
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.27.0; \
18+
fi
19+
20+
ENV DAPPER_RUN_ARGS --privileged
21+
ENV DAPPER_ENV ARCH REPO TAG DRONE_TAG IMAGE_NAME CROSS
22+
ENV DAPPER_SOURCE /go/src/github.com/k3s-io/kine/
23+
ENV DAPPER_OUTPUT ./bin ./dist
24+
ENV DAPPER_DOCKER_SOCKET true
25+
ENV HOME ${DAPPER_SOURCE}
26+
WORKDIR ${DAPPER_SOURCE}
27+
28+
ENTRYPOINT ["./scripts/entry"]
29+
CMD ["ci"]
30+
31+
FROM alpine:3.12 AS release
32+
ARG ARCH=amd64
33+
COPY dist/artifacts/kine-${ARCH} /bin/kine
34+
ENTRYPOINT ["/bin/kine"]

Dockerfile.dapper

Lines changed: 0 additions & 32 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
## Kine (Kine is not etcd)
1+
# Kine (Kine is not etcd)
2+
==========================
3+
4+
_NOTE: this repository has been recently (2020-11-19) moved out of the github.com/rancher org to github.com/k3s-io
5+
supporting the [acceptance of K3s as a CNCF sandbox project](https://github.com/cncf/toc/pull/447)_.
6+
7+
---
28

39
Kine is an etcdshim that translates etcd API to sqlite, Postgres, Mysql, and dqlite
410

5-
### Features
11+
## Features
612
- Can be ran standalone so any k8s (not just k3s) can use Kine
713
- Implements a subset of etcdAPI (not usable at all for general purpose etcd)
814
- Translates etcdTX calls into the desired API (Create, Update, Delete)

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
module github.com/rancher/kine
1+
module github.com/k3s-io/kine
22

3-
go 1.12
3+
go 1.15
44

55
require (
66
github.com/Rican7/retry v0.1.0

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"os"
66

7-
"github.com/rancher/kine/pkg/endpoint"
7+
"github.com/k3s-io/kine/pkg/endpoint"
88
"github.com/rancher/wrangler/pkg/signals"
99
"github.com/sirupsen/logrus"
1010
"github.com/urfave/cli"

pkg/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77
"time"
88

9-
"github.com/rancher/kine/pkg/endpoint"
9+
"github.com/k3s-io/kine/pkg/endpoint"
1010
"go.etcd.io/etcd/clientv3"
1111
)
1212

0 commit comments

Comments
 (0)