Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubebuilder pvc cleanup #133

Closed
wants to merge 64 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
b35c9b7
Update vendor for kubebuilder.
AMecea Aug 14, 2018
00b22ea
Cleanup for kubebuilder.
AMecea Aug 14, 2018
4a1ea43
Add backups types.go
AMecea Aug 14, 2018
04e27da
Fix types unittests.
AMecea Aug 16, 2018
0e92dd3
Run tests on drone.
AMecea Aug 16, 2018
0251bf3
Add mysqlcluster controller.
AMecea Aug 29, 2018
f97fa4d
Update vendor for mysql cluster.
AMecea Aug 29, 2018
af783fc
Move logic from apis to wrappers.
AMecea Aug 29, 2018
a1b34e8
Code Review
MerceaOtniel Aug 30, 2018
97feafd
Update vendor to kubernetes 1.11
AMecea Sep 7, 2018
049a264
Add golangci-lint linter.
AMecea Sep 7, 2018
da9e1a5
Use kubernetes defaults, fix tests, fix linting, rename stoppkg -> st…
AMecea Sep 7, 2018
fba1c39
Upgrade drone to 1.11
MerceaOtniel Sep 7, 2018
037c417
Make status subresource.
AMecea Sep 12, 2018
a3dc537
Move wrappers and syncer to controller/internal.
AMecea Sep 12, 2018
82fe4ec
Create a util/constants package with constants.
AMecea Sep 12, 2018
76a934b
Move pakcages. Update kubebuilder to v1.0.4
AMecea Sep 12, 2018
70a3a79
Update Gopkg.toml
AMecea Sep 12, 2018
5d48310
Modify sync function
MerceaOtniel Sep 12, 2018
2b9de80
Implement the interface
MerceaOtniel Sep 13, 2018
f214611
Add vendor file
MerceaOtniel Sep 14, 2018
1ba0d7d
Fix compile and linting problems
MerceaOtniel Sep 14, 2018
b9cbe87
Add orchestrator-mysql controller.
AMecea Aug 29, 2018
3de59ae
Add orchestartor to mysql controller syncer.
AMecea Aug 29, 2018
1b67c38
Make cluster read only.
AMecea Aug 29, 2018
2d43456
Rename orchestrator controller. Use sync.Map. Use wrappers.
AMecea Sep 12, 2018
a582861
Fix linting.
AMecea Sep 12, 2018
8ace4ee
Update cluster, fix tests.
AMecea Sep 13, 2018
bc941d9
Refactor orchestrator reconciler, and tests.
AMecea Sep 14, 2018
d2bc2e4
Add test for orc register/unregister nodes.
AMecea Sep 17, 2018
4fc3b27
Handle better when a node is removed.
AMecea Sep 17, 2018
282c905
Better naming and comments.
AMecea Sep 17, 2018
d7904e8
More comments and better logging. Code review.
AMecea Sep 18, 2018
d44f09a
Better tests description.
AMecea Sep 18, 2018
4aef557
Update Makefile and tests.
AMecea Sep 19, 2018
86cd9e9
Bump controller-runtime to v0.1.3
calind Sep 19, 2018
c227de7
Fix mysqlcluster-controller update status infinite loop
calind Sep 19, 2018
0c59f58
Fix mysqlcluster-controller test messages
calind Sep 19, 2018
e603918
Refactor orchestrator controller tests
calind Sep 20, 2018
25331c1
Add orchestrator controller to manager
calind Sep 20, 2018
415cd3e
Use stop.Channel in main entry point
calind Sep 20, 2018
eb5785c
Split test stages on drone
calind Sep 20, 2018
01a5423
Code review.
AMecea Sep 21, 2018
b0cb49b
Check for an extra reconcile event in tests.
AMecea Sep 21, 2018
937f27f
Add mysql-operator-sidecar.
AMecea Sep 24, 2018
de0a12f
Add mysql driver dependency.
AMecea Sep 24, 2018
ba70dcb
Fix constants import. And update Makefile.
AMecea Sep 19, 2018
0c1c634
Fix linting and remove glog.
AMecea Sep 25, 2018
6150ff0
Move from cmd to pkg/sidecar
AMecea Sep 25, 2018
d5ae8c0
Use SetupSignalHandler from controller-runtime package.
AMecea Sep 28, 2018
3a6412a
Add a finalizer syncer.
AMecea Sep 18, 2018
ad707d7
Add finalizer test.
AMecea Sep 18, 2018
e4e7c6e
Use a runnablefunc to dispatch events.
AMecea Sep 28, 2018
ef09d01
Add pod label syncer.
AMecea Sep 27, 2018
59dc789
Add tests for pod label syncer.
AMecea Sep 28, 2018
b273a2d
Add chart.
AMecea Sep 24, 2018
05a25ef
Add chart generate make tag.
AMecea Sep 25, 2018
711cc28
Make operator to work with the chart.
AMecea Sep 26, 2018
f5eba23
Fix query issues
AMecea Sep 27, 2018
5a46fe8
Use mysql placeholder for queries.
AMecea Oct 8, 2018
ee7221e
Use yq to update the chart.
AMecea Oct 9, 2018
9668a5d
Fix placeholder in queryes for tables names.
AMecea Oct 10, 2018
6707586
Fix spelling, add makefile targets
smanpathak Oct 12, 2018
6222b43
Add PVC cleanup: Using finalizers
smanpathak Oct 16, 2018
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.
143 changes: 9 additions & 134 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,142 +3,17 @@ workspace:
path: src/github.com/presslabs/mysql-operator

pipeline:
build:
image: golang:1.9
environment:
- APP_VERSION=${DRONE_BRANCH/master/latest}
dependencies:
image: golang:1.11
commands:
- make full-test
- make build
- make install-docker
when:
event: push
- make dependencies

build:
image: golang:1.9
environment:
- APP_VERSION=${DRONE_TAG}
lint:
image: golang:1.11
commands:
- make full-test
- make build
- make install-docker
when:
event: tag
- make lint

publish-operator:
group: publish
image: plugins/docker
registry: quay.io
repo: quay.io/presslabs/mysql-operator
username: presslabs+drone
dockerfile: hack/docker/mysql-operator/Dockerfile
context: hack/docker/mysql-operator
tags: ["${DRONE_BRANCH/master/latest}"]
secrets:
- source: QUAY_TOKEN
target: DOCKER_PASSWORD
when:
event: push

publish-operator:
group: publish
image: plugins/docker
registry: quay.io
repo: quay.io/presslabs/mysql-operator
username: presslabs+drone
dockerfile: hack/docker/mysql-operator/Dockerfile
context: hack/docker/mysql-operator
tags: ["${DRONE_TAG}"]
secrets:
- source: QUAY_TOKEN
target: DOCKER_PASSWORD
when:
event: tag

publish-helper:
group: publish
image: plugins/docker
registry: quay.io
repo: quay.io/presslabs/mysql-helper
username: presslabs+drone
dockerfile: hack/docker/mysql-helper/Dockerfile
context: hack/docker/mysql-helper
tags: ["${DRONE_BRANCH/master/latest}"]
secrets:
- source: QUAY_TOKEN
target: DOCKER_PASSWORD
when:
event: push

publish-helper:
group: publish
image: plugins/docker
registry: quay.io
repo: quay.io/presslabs/mysql-helper
username: presslabs+drone
dockerfile: hack/docker/mysql-helper/Dockerfile
context: hack/docker/mysql-helper
tags: ["${DRONE_TAG}"]
secrets:
- source: QUAY_TOKEN
target: DOCKER_PASSWORD
when:
event: tag

publish-helm-chart:
group: publish
image: quay.io/presslabs/kluster-toolbox
pull: true
environment:
- GH_USER=presslabs-bot
test:
image: golang:1.11
commands:
- cd hack/charts
- (cd mysql-operator && helm dep build)
- helm package mysql-operator
- CHART="$(basename *.tgz)" ; MESSAGE="Publish $(basename $CHART .tgz)"
- /usr/local/bin/gh put --skip-existing -m "$MESSAGE" "$CHART" "presslabs/charts/docs/"
secrets:
- GH_PASSWORD
when:
branch: master
event: push

# publish-mysql-helper:
# group: publish
# image: plugins/docker
# mirror: https://mirror.gcr.io
# registry: gcr.io
# repo: gcr.io/pl-infra/mysql-helper
# dockerfile: hack/docker/mysql-helper/Dockerfile
# username: _json_key
# tags: ["${DRONE_BRANCH/master/latest}", "${DRONE_COMMIT_SHA:0:7}"]
# force_tag: true
# build_args:
# - release="${DRONE_COMMIT_SHA:0:7}"
# secrets:
# - source: GOOGLE_CREDENTIALS
# target: DOCKER_PASSWORD
# when:
# event: push

# e2e-tests:
# image: gcr.io/pl-infra/kluster-mysql-helper:latest
# pull: true
# secrets:
# - GOOGLE_CREDENTIALS
# - GOOGLE_PROJECT_ID
# - TITANIUM_TEST_GS_CREDENTIALS
# environment:
# - TITANIUM_IMAGE_TAG=${DRONE_COMMIT_SHA:0:7}
# - OPERATOR_IMAGE=gcr.io/pl-infra/mysql-operator:${DRONE_COMMIT_SHA:0:7}
# - KUBECONFIG=/go/.kube/config
# commands:
# - sleep 1
#
#services:
# minikube:
# image: gcr.io/pl-infra/drone-minikube:v1.9.0
# privileged: true
# secrets:
# - GOOGLE_CREDENTIALS

- make test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ nosetests.xml
coverage.xml
*.cover
.hypothesis/
cover.out

# Translations
*.mo
Expand All @@ -40,7 +41,7 @@ docs/_build/

# ignore bin
bin/
hack/docker/mysql-helper/mysql-helper
hack/docker/mysql-operator-sidecar/mysql-operator-sidecar
hack/docker/mysql-operator/mysql-operator
**/charts/*.tgz

Expand Down
37 changes: 37 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
run:
skip-dirs:
- vendor

linters-settings:
dupl:
threshold: 400
gocyclo:
min-complexity: 10
govet:
check-shadowing: true
lll:
line-length: 170
tab-width: 4
gofmt:
simplify: false

linters:
presets:
- bugs
- unused
- format
- style
- complexity
- performance

# we should re-enable them and make lint pass
disable:
- goimports
- maligned

issues:
max-same-issues: 0
exclude-use-default: false
exclude:
# gosec G104, about unhandled errors. We do that with errcheck already
- "G104: Errors unhandled"
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Build the manager binary
FROM golang:1.10.3 as builder

# Copy in the go src
WORKDIR /go/src/github.com/presslabs/mysql-operator
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY vendor/ vendor/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager github.com/presslabs/mysql-operator/cmd/manager

# Copy the controller-manager into a thin image
FROM ubuntu:latest
WORKDIR /root/
COPY --from=builder /go/src/github.com/presslabs/mysql-operator/manager .
ENTRYPOINT ["./manager"]
Loading