-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from VictoriaMetrics/upgraded-sdk-version
Upgraded sdk and go version, changed folders structure.
- Loading branch information
Showing
48 changed files
with
2,466 additions
and
12,933 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
- name: Setup Go | ||
uses: actions/setup-go@master | ||
with: | ||
go-version: 1.13 | ||
go-version: 1.15 | ||
id: go | ||
- name: Dependencies | ||
env: | ||
|
@@ -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.19.0/operator-sdk-v0.19.0-x86_64-linux-gnu" | ||
curl -L -o operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/v1.0.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 | ||
|
@@ -59,5 +59,5 @@ jobs: | |
password: ${{secrets.REPO_KEY}} | ||
repository: victoriametrics/operator | ||
tag_with_ref: true | ||
dockerfile: build/Dockerfile | ||
dockerfile: Dockerfile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
- name: Setup Go | ||
uses: actions/setup-go@master | ||
with: | ||
go-version: 1.13 | ||
go-version: 1.15 | ||
id: go | ||
- name: Dependencies | ||
env: | ||
|
@@ -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.19.0/operator-sdk-v0.19.0-x86_64-linux-gnu" | ||
curl -L -o operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/v1.0.0/operator-sdk-v0.19.0-x86_64-linux-gnu" | ||
chmod +x operator-sdk | ||
sudo mv operator-sdk /bin/ | ||
|
@@ -59,7 +59,7 @@ jobs: | |
password: ${{secrets.REPO_KEY}} | ||
tag_with_ref: true | ||
repository: victoriametrics/operator | ||
dockerfile: build/Dockerfile | ||
dockerfile: Dockerfile | ||
|
||
|
||
- name: Upload Release Asset | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,12 @@ | ||
# Build the manager binary | ||
FROM golang:1.13 as builder | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest | ||
|
||
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 | ||
ENV OPERATOR=/usr/local/bin/manager \ | ||
USER_UID=1001 \ | ||
USER_NAME=vm-operator | ||
|
||
# Copy the go source | ||
COPY main.go main.go | ||
COPY api/ api/ | ||
COPY controllers/ controllers/ | ||
# install operator binary | ||
COPY bin/manager ${OPERATOR} | ||
|
||
# Build | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go | ||
ENTRYPOINT ["/usr/local/bin/manager"] | ||
|
||
# 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"] | ||
USER ${USER_UID} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Build the manager binary | ||
FROM golang:1.15 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 internal/ internal/ | ||
# Build | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -trimpath -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.