Skip to content

Commit

Permalink
Merge pull request #45 from VictoriaMetrics/operator-0.19
Browse files Browse the repository at this point in the history
migration to operator-sdk 0.19 version.
  • Loading branch information
f41gh7 authored Jul 25, 2020
2 parents faf56b4 + 8bb86e7 commit 666c389
Show file tree
Hide file tree
Showing 217 changed files with 5,485 additions and 31,503 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
go get golang.org/x/lint/golint
go get github.com/kisielk/errcheck
go get github.com/golangci/golangci-lint/cmd/[email protected]
curl -L -o operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/v0.18.1/operator-sdk-v0.18.1-x86_64-linux-gnu"
curl -L -o operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/v0.19.0/operator-sdk-v0.19.0-x86_64-linux-gnu"
chmod +x operator-sdk
sudo mv operator-sdk /bin/
- name: setup KIND for e2e tests
Expand All @@ -43,7 +43,7 @@ jobs:
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
make lint
make test
make build-app
make build
- name: run e2e tests
run: |
kubectl cluster-info
Expand All @@ -59,12 +59,5 @@ jobs:
password: ${{secrets.REPO_KEY}}
repository: victoriametrics/operator
tag_with_ref: true
dockerfile: cmd/manager/Dockerfile
dockerfile: build/Dockerfile

- name: run e2e with docker
env:
E2E_IMAGE: ${{ env.GITHUB_REF_SLUG }}
run: |
kubectl cluster-info
kubectl get pods -n kube-system
make e2e
15 changes: 4 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
go get -u golang.org/x/lint/golint
go get -u github.com/kisielk/errcheck
go get github.com/golangci/golangci-lint/cmd/[email protected]
curl -L -o operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/v0.18.1/operator-sdk-v0.18.1-x86_64-linux-gnu"
curl -L -o operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/v0.19.0/operator-sdk-v0.19.0-x86_64-linux-gnu"
chmod +x operator-sdk
sudo mv operator-sdk /bin/
Expand All @@ -42,8 +42,8 @@ jobs:
run: |
make lint
make test
make build-app
sh scripts/bundle.sh
make build
make release-package
- name: run e2e tests local
run: |
kubectl cluster-info
Expand All @@ -59,15 +59,8 @@ jobs:
password: ${{secrets.REPO_KEY}}
tag_with_ref: true
repository: victoriametrics/operator
dockerfile: cmd/manager/Dockerfile
dockerfile: build/Dockerfile

- name: run e2e with docker
env:
E2E_IMAGE: ${{ env.GITHUB_REF_SLUG }}
run: |
kubectl cluster-info
kubectl get pods -n kube-system
make e2e

- name: Upload Release Asset
id: upload-release-asset
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Temporary Build Files
.idea
bin/
build/_output
bundle_crd.zip
operator.zip
bundle.Dockerfile
coverage.txt
doc-print
build/_test
# Created by https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
### Emacs ###
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

for developing you need:
- golang 1.13+
- operator-sdk 1.18.1
- operator-sdk 1.19.0
- docker
- minikube or kind for e2e tests
- golangci-lint
- operator-courier



Expand All @@ -18,10 +17,10 @@ Use `make build` - it will generate new crds and build binary

for running locally you need minikube and run two commands:
```bash
kubectl apply -f deploy/crds
make install
make run
```
or you can run it from IDE with ```cmd/manager/main.go```
or you can run it from IDE with ```main.go```

## publish changes

Expand Down
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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/

# 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:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
USER nonroot:nonroot

ENTRYPOINT ["/manager"]
Loading

0 comments on commit 666c389

Please sign in to comment.