generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 22
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 #228 from cybozu-go/refactor-1
Reimplementation
- Loading branch information
Showing
192 changed files
with
11,256 additions
and
12,599 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/bin | ||
/testbin | ||
/config | ||
/docs | ||
/e2e | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,4 @@ | |
# ignore binaries | ||
/bin | ||
/build | ||
|
||
# ignore tmp files (created by make kubebuilder) | ||
/tmp | ||
/testbin |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# How to develop MOCO | ||
|
||
## Running tests | ||
|
||
MOCO has the following 4 kinds of tests: | ||
|
||
1. Tests that do not depend on MySQL or Kubernetes | ||
2. `pkg/dbop` tests that depend on MySQL version | ||
3. Tests that depend on Kubernetes and therefore run by controller-runtime's envtest | ||
4. End-to-end tests | ||
|
||
To run these tests, use the following make targets respectively: | ||
|
||
1. `make test` | ||
2. `make test-dbop` | ||
3. `make envtest` | ||
4. Read [`e2e/README.md`](e2e/README.md) | ||
|
||
## Generated files | ||
|
||
Some files in the repository are auto-generated. | ||
|
||
- [`docs/crd_mysqlcluster.md`](docs/crd_mysqlcluster.md) is generated by `make apidoc`. | ||
- Some files under `config` are generated by `make manifests`. | ||
- `api/**/*.deepcopy.go` are generated by `make generate`. | ||
|
||
CI checks and fails if they need to be rebuilt. | ||
|
||
## Testing with unreleased moco-agent | ||
|
||
MOCO depends on [moco-agent][] that is released from a different repository. | ||
The dependency is therefore managed in `go.mod` file. | ||
|
||
To run e2e tests with an unreleased moco-agent, follow the instructions in | ||
[`e2e/README.md`](e2e/README.md). | ||
|
||
## Updating moco-agent | ||
|
||
Run `go get github.com/cybozu-go/moco-agent@latest`. | ||
|
||
## Updating fluent-bit | ||
|
||
Edit `FluentBitImage` in [`version.go`](versoin.go). | ||
|
||
[moco-agent]: https://github.com/cybozu-go/moco-agent |
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,20 +1,17 @@ | ||
# Build the moco-controller binary | ||
FROM quay.io/cybozu/golang:1.16-focal as builder | ||
|
||
WORKDIR /workspace | ||
|
||
# Copy the go source | ||
COPY ./ . | ||
|
||
# Build | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o moco-controller ./cmd/moco-controller/main.go | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o moco-controller ./cmd/moco-controller | ||
|
||
# stage2 | ||
FROM scratch | ||
LABEL org.opencontainers.image.source https://github.com/cybozu-go/moco | ||
|
||
WORKDIR / | ||
COPY --from=builder /workspace/moco-controller ./ | ||
COPY --from=builder /work/moco-controller ./ | ||
USER 10000:10000 | ||
|
||
ENTRYPOINT ["/moco-controller"] |
Oops, something went wrong.