Skip to content

Commit a19905b

Browse files
committed
Merge branch 'v2'
2 parents e92175b + 98a4dc9 commit a19905b

File tree

320 files changed

+22102
-8114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

320 files changed

+22102
-8114
lines changed

.circleci/config.yml

Lines changed: 81 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
docker_layer_caching: true
1515

1616
environment:
17-
GO_VERSION: '1.11.4'
17+
GO_VERSION: '1.13'
1818
K8S_VERSION: 'v1.12.0'
1919
VAULT_VERSION: '1.0.0'
2020
KUBECONFIG: '/home/circleci/.kube/config'
@@ -29,7 +29,6 @@ jobs:
2929

3030
steps:
3131
- checkout
32-
3332
- run:
3433
name: Setup golang
3534
command: |
@@ -39,100 +38,103 @@ jobs:
3938
"https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" \
4039
&& sudo tar -C /usr/local -xzf go.linux-amd64.tar.gz
4140
echo 'export PATH="$GOPATH/bin:$PATH"' >> "${BASH_ENV}"
42-
4341
- run:
4442
name: Run fmt
4543
command: |
4644
make check-fmt
47-
4845
- run:
4946
name: Run golint
5047
command: |
5148
make lint
52-
5349
- run:
5450
name: Run misspell
5551
command: |
56-
make check-misspell
57-
52+
make check-misspell
5853
- run:
5954
name: Run ineffassign
6055
command: |
61-
make ineffassign
62-
63-
- run:
64-
name: Setup kubectl
65-
command: |
66-
curl \
67-
-Lo kubectl \
68-
"https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl" \
69-
&& chmod +x kubectl \
70-
&& sudo mv kubectl /usr/local/bin/
71-
mkdir -p "${HOME}/.kube"
72-
touch "${HOME}/.kube/config"
73-
74-
- run:
75-
name: Setup minikube
76-
command: |
77-
curl \
78-
-Lo minikube \
79-
"https://github.com/kubernetes/minikube/releases/download/${MINIKUBE_VERSION}/minikube-linux-amd64" \
80-
&& chmod +x minikube \
81-
&& sudo mv minikube /usr/local/bin/
82-
83-
- run:
84-
name: Start minikube
85-
command: |
86-
sudo -E minikube start --vm-driver=none --cpus 2 --memory 4096 --kubernetes-version="${K8S_VERSION}"
87-
56+
make ineffassign
8857
- run:
89-
name: Install Helm
58+
name: Check generators for unwanted diffs
9059
command: |
91-
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh
92-
chmod 700 get_helm.sh
93-
./get_helm.sh
94-
95-
helm init
96-
helm repo add banzaicloud-stable http://kubernetes-charts.banzaicloud.com/branch/master
97-
helm repo update
98-
99-
- run:
100-
name: Start Minio
101-
command: |
102-
kubectl create -f hack/minio.yaml
103-
kubectl wait --for=condition=available deployment/minio-deployment --timeout=120s
104-
minio="$(kubectl get pod -l app=minio -o 'jsonpath={.items[0].metadata.name}')"
105-
kubectl wait --for=condition=Ready pod "${minio}" --timeout=120s
106-
107-
- run:
108-
name: Setup minio cli
109-
command: |
110-
kubectl create -f hack/minio-mc.yaml
111-
kubectl wait --for=condition=available deployment/minio-mc-deployment --timeout=120s
112-
mc_pod="$(kubectl get pod -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
113-
kubectl wait --for=condition=Ready pod "${mc_pod}" --timeout=120s
114-
kubectl exec "${mc_pod}" -- \
115-
mc config host add minio \
116-
'http://minio-service.default.svc.cluster.local:9000' \
117-
'minio_access_key' \
118-
'minio_secret_key'
119-
120-
- run:
121-
name: Create test bucket
122-
command: |
123-
mc_pod="$(kubectl get pod -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
124-
kubectl exec "${mc_pod}" -- \
125-
mc mb --region 'test_region' minio/logs
126-
127-
- run:
128-
name: Build docker image
129-
command: |
130-
make docker DOCKER_TAG=local
131-
60+
make check-diff
13261
- run:
13362
name: Test
13463
command: |
135-
hack/test.sh
64+
make test
65+
#- run:
66+
# name: Setup kubectl
67+
# command: |
68+
# curl \
69+
# -Lo kubectl \
70+
# "https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl" \
71+
# && chmod +x kubectl \
72+
# && sudo mv kubectl /usr/local/bin/
73+
# mkdir -p "${HOME}/.kube"
74+
# touch "${HOME}/.kube/config"
75+
#
76+
#- run:
77+
# name: Setup minikube
78+
# command: |
79+
# curl \
80+
# -Lo minikube \
81+
# "https://github.com/kubernetes/minikube/releases/download/${MINIKUBE_VERSION}/minikube-linux-amd64" \
82+
# && chmod +x minikube \
83+
# && sudo mv minikube /usr/local/bin/
84+
#
85+
#- run:
86+
# name: Start minikube
87+
# command: |
88+
# sudo -E minikube start --vm-driver=none --cpus 2 --memory 4096 --kubernetes-version="${K8S_VERSION}"
89+
#
90+
#- run:
91+
# name: Install Helm
92+
# command: |
93+
# curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh
94+
# chmod 700 get_helm.sh
95+
# ./get_helm.sh
96+
#
97+
# helm init
98+
# helm repo add banzaicloud-stable http://kubernetes-charts.banzaicloud.com/branch/master
99+
# helm repo update
100+
#
101+
#- run:
102+
# name: Start Minio
103+
# command: |
104+
# kubectl create -f hack/minio.yaml
105+
# kubectl wait --for=condition=available deployment/minio-deployment --timeout=120s
106+
# minio="$(kubectl get pod -l app=minio -o 'jsonpath={.items[0].metadata.name}')"
107+
# kubectl wait --for=condition=Ready pod "${minio}" --timeout=120s
108+
#
109+
#- run:
110+
# name: Setup minio cli
111+
# command: |
112+
# kubectl create -f hack/minio-mc.yaml
113+
# kubectl wait --for=condition=available deployment/minio-mc-deployment --timeout=120s
114+
# mc_pod="$(kubectl get pod -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
115+
# kubectl wait --for=condition=Ready pod "${mc_pod}" --timeout=120s
116+
# kubectl exec "${mc_pod}" -- \
117+
# mc config host add minio \
118+
# 'http://minio-service.default.svc.cluster.local:9000' \
119+
# 'minio_access_key' \
120+
# 'minio_secret_key'
121+
#
122+
#- run:
123+
# name: Create test bucket
124+
# command: |
125+
# mc_pod="$(kubectl get pod -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
126+
# kubectl exec "${mc_pod}" -- \
127+
# mc mb --region 'test_region' minio/logs
128+
#
129+
#- run:
130+
# name: Build docker image
131+
# command: |
132+
# make docker DOCKER_TAG=local
133+
#
134+
#- run:
135+
# name: Test
136+
# command: |
137+
# hack/test.sh
136138

137139
workflows:
138140
version: 2
@@ -143,8 +145,8 @@ workflows:
143145
jobs:
144146
- helm/lint-chart:
145147
filters:
146-
tags:
147-
ignore: /.*/
148+
tags:
149+
ignore: /.*/
148150

149151
- helm/publish-chart:
150152
context: helm
@@ -153,4 +155,3 @@ workflows:
153155
ignore: /.*/
154156
tags:
155157
only: /chart\/.*\/\d+.\d+.\d+.*/
156-

.github/ISSUE_TEMPLATE/bug_report.md

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

.github/ISSUE_TEMPLATE/feature_request.md

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

.github/PULL_REQUEST_TEMPLATE.md

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

Dockerfile

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
FROM golang:1.11-alpine as golang
2-
3-
RUN apk add --update --no-cache ca-certificates curl git make
4-
RUN go get -u github.com/golang/dep/cmd/dep
5-
6-
ADD Gopkg.toml /go/src/github.com/banzaicloud/logging-operator/Gopkg.toml
7-
ADD Gopkg.lock /go/src/github.com/banzaicloud/logging-operator/Gopkg.lock
8-
9-
WORKDIR /go/src/github.com/banzaicloud/logging-operator
10-
RUN dep ensure -v -vendor-only
11-
ADD . /go/src/github.com/banzaicloud/logging-operator
12-
RUN go install ./cmd/manager
13-
14-
15-
FROM alpine:3.8
16-
17-
RUN apk add --no-cache ca-certificates
18-
19-
COPY --from=golang /go/bin/manager /usr/local/bin/logging-operator
20-
21-
RUN adduser -D logging-operator
22-
USER logging-operator
23-
24-
ENTRYPOINT ["/usr/local/bin/logging-operator"]
1+
# Build the manager binary
2+
FROM golang:1.13 as builder
3+
4+
WORKDIR /workspace
5+
# Copy the Go Modules manifests
6+
COPY go.mod go.mod
7+
COPY go.sum go.sum
8+
# cache deps before building and copying source so that we don't need to re-download as much
9+
# and so that source changes don't invalidate our downloaded layer
10+
RUN go mod download
11+
12+
# Copy the go source
13+
COPY main.go main.go
14+
COPY api/ api/
15+
COPY controllers/ controllers/
16+
COPY pkg/ pkg/
17+
18+
# Build
19+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
20+
21+
# Use distroless as minimal base image to package the manager binary
22+
# Refer to https://github.com/GoogleContainerTools/distroless for more details
23+
FROM gcr.io/distroless/static:latest
24+
WORKDIR /
25+
COPY --from=builder /workspace/manager .
26+
ENTRYPOINT ["/manager"]

0 commit comments

Comments
 (0)