Skip to content

Commit

Permalink
Merge branch 'v2'
Browse files Browse the repository at this point in the history
  • Loading branch information
tarokkk committed Sep 22, 2019
2 parents e92175b + 98a4dc9 commit a19905b
Show file tree
Hide file tree
Showing 320 changed files with 22,102 additions and 8,114 deletions.
161 changes: 81 additions & 80 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
docker_layer_caching: true

environment:
GO_VERSION: '1.11.4'
GO_VERSION: '1.13'
K8S_VERSION: 'v1.12.0'
VAULT_VERSION: '1.0.0'
KUBECONFIG: '/home/circleci/.kube/config'
Expand All @@ -29,7 +29,6 @@ jobs:

steps:
- checkout

- run:
name: Setup golang
command: |
Expand All @@ -39,100 +38,103 @@ jobs:
"https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" \
&& sudo tar -C /usr/local -xzf go.linux-amd64.tar.gz
echo 'export PATH="$GOPATH/bin:$PATH"' >> "${BASH_ENV}"
- run:
name: Run fmt
command: |
make check-fmt
- run:
name: Run golint
command: |
make lint
- run:
name: Run misspell
command: |
make check-misspell
make check-misspell
- run:
name: Run ineffassign
command: |
make ineffassign
- run:
name: Setup kubectl
command: |
curl \
-Lo kubectl \
"https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl" \
&& chmod +x kubectl \
&& sudo mv kubectl /usr/local/bin/
mkdir -p "${HOME}/.kube"
touch "${HOME}/.kube/config"
- run:
name: Setup minikube
command: |
curl \
-Lo minikube \
"https://github.com/kubernetes/minikube/releases/download/${MINIKUBE_VERSION}/minikube-linux-amd64" \
&& chmod +x minikube \
&& sudo mv minikube /usr/local/bin/
- run:
name: Start minikube
command: |
sudo -E minikube start --vm-driver=none --cpus 2 --memory 4096 --kubernetes-version="${K8S_VERSION}"
make ineffassign
- run:
name: Install Helm
name: Check generators for unwanted diffs
command: |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh
helm init
helm repo add banzaicloud-stable http://kubernetes-charts.banzaicloud.com/branch/master
helm repo update
- run:
name: Start Minio
command: |
kubectl create -f hack/minio.yaml
kubectl wait --for=condition=available deployment/minio-deployment --timeout=120s
minio="$(kubectl get pod -l app=minio -o 'jsonpath={.items[0].metadata.name}')"
kubectl wait --for=condition=Ready pod "${minio}" --timeout=120s
- run:
name: Setup minio cli
command: |
kubectl create -f hack/minio-mc.yaml
kubectl wait --for=condition=available deployment/minio-mc-deployment --timeout=120s
mc_pod="$(kubectl get pod -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
kubectl wait --for=condition=Ready pod "${mc_pod}" --timeout=120s
kubectl exec "${mc_pod}" -- \
mc config host add minio \
'http://minio-service.default.svc.cluster.local:9000' \
'minio_access_key' \
'minio_secret_key'
- run:
name: Create test bucket
command: |
mc_pod="$(kubectl get pod -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
kubectl exec "${mc_pod}" -- \
mc mb --region 'test_region' minio/logs
- run:
name: Build docker image
command: |
make docker DOCKER_TAG=local
make check-diff
- run:
name: Test
command: |
hack/test.sh
make test
#- run:
# name: Setup kubectl
# command: |
# curl \
# -Lo kubectl \
# "https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl" \
# && chmod +x kubectl \
# && sudo mv kubectl /usr/local/bin/
# mkdir -p "${HOME}/.kube"
# touch "${HOME}/.kube/config"
#
#- run:
# name: Setup minikube
# command: |
# curl \
# -Lo minikube \
# "https://github.com/kubernetes/minikube/releases/download/${MINIKUBE_VERSION}/minikube-linux-amd64" \
# && chmod +x minikube \
# && sudo mv minikube /usr/local/bin/
#
#- run:
# name: Start minikube
# command: |
# sudo -E minikube start --vm-driver=none --cpus 2 --memory 4096 --kubernetes-version="${K8S_VERSION}"
#
#- run:
# name: Install Helm
# command: |
# curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh
# chmod 700 get_helm.sh
# ./get_helm.sh
#
# helm init
# helm repo add banzaicloud-stable http://kubernetes-charts.banzaicloud.com/branch/master
# helm repo update
#
#- run:
# name: Start Minio
# command: |
# kubectl create -f hack/minio.yaml
# kubectl wait --for=condition=available deployment/minio-deployment --timeout=120s
# minio="$(kubectl get pod -l app=minio -o 'jsonpath={.items[0].metadata.name}')"
# kubectl wait --for=condition=Ready pod "${minio}" --timeout=120s
#
#- run:
# name: Setup minio cli
# command: |
# kubectl create -f hack/minio-mc.yaml
# kubectl wait --for=condition=available deployment/minio-mc-deployment --timeout=120s
# mc_pod="$(kubectl get pod -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
# kubectl wait --for=condition=Ready pod "${mc_pod}" --timeout=120s
# kubectl exec "${mc_pod}" -- \
# mc config host add minio \
# 'http://minio-service.default.svc.cluster.local:9000' \
# 'minio_access_key' \
# 'minio_secret_key'
#
#- run:
# name: Create test bucket
# command: |
# mc_pod="$(kubectl get pod -l app=minio-mc -o 'jsonpath={.items[0].metadata.name}')"
# kubectl exec "${mc_pod}" -- \
# mc mb --region 'test_region' minio/logs
#
#- run:
# name: Build docker image
# command: |
# make docker DOCKER_TAG=local
#
#- run:
# name: Test
# command: |
# hack/test.sh

workflows:
version: 2
Expand All @@ -143,8 +145,8 @@ workflows:
jobs:
- helm/lint-chart:
filters:
tags:
ignore: /.*/
tags:
ignore: /.*/

- helm/publish-chart:
context: helm
Expand All @@ -153,4 +155,3 @@ workflows:
ignore: /.*/
tags:
only: /chart\/.*\/\d+.\d+.\d+.*/

27 changes: 0 additions & 27 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

34 changes: 0 additions & 34 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

50 changes: 26 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
FROM golang:1.11-alpine as golang

RUN apk add --update --no-cache ca-certificates curl git make
RUN go get -u github.com/golang/dep/cmd/dep

ADD Gopkg.toml /go/src/github.com/banzaicloud/logging-operator/Gopkg.toml
ADD Gopkg.lock /go/src/github.com/banzaicloud/logging-operator/Gopkg.lock

WORKDIR /go/src/github.com/banzaicloud/logging-operator
RUN dep ensure -v -vendor-only
ADD . /go/src/github.com/banzaicloud/logging-operator
RUN go install ./cmd/manager


FROM alpine:3.8

RUN apk add --no-cache ca-certificates

COPY --from=golang /go/bin/manager /usr/local/bin/logging-operator

RUN adduser -D logging-operator
USER logging-operator

ENTRYPOINT ["/usr/local/bin/logging-operator"]
# Build the manager binary
FROM golang:1.13 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY pkg/ pkg/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:latest
WORKDIR /
COPY --from=builder /workspace/manager .
ENTRYPOINT ["/manager"]
Loading

0 comments on commit a19905b

Please sign in to comment.