Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY go.sum go.sum
RUN go mod download

# Copy the go source
COPY cmd/main.go cmd/main.go
COPY cmd/ cmd/
COPY api/ api/
COPY internal/ internal/
COPY pkg/ pkg/
Expand All @@ -23,12 +23,14 @@ COPY pkg/ pkg/
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o mirror-agent ./cmd/mirror-agent

# 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@sha256:963fa6c544fe5ce420f1f54fb88b6fb01479f054c8056d0f74cc2c6000df5240
WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=builder /workspace/mirror-agent .
USER 65532:65532

ENTRYPOINT ["/manager"]
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ test: manifests generate fmt vet envtest ## Run tests.
# Prometheus and CertManager are installed by default; skip with:
# - PROMETHEUS_INSTALL_SKIP=true
# - CERT_MANAGER_INSTALL_SKIP=true
# Explicit -timeout: the features' worst-case wait ceilings sum past the go-test default of 10m.
.PHONY: test-e2e
test-e2e: generate fmt vet kind gofail-enable ## Run the e2e tests. Expected an isolated environment using Kind.
ETCD_VERSION="$(E2E_ETCD_VERSION)" PATH="$(LOCALBIN):$(PATH)" go test ./test/e2e/ -v
ETCD_VERSION="$(E2E_ETCD_VERSION)" PATH="$(LOCALBIN):$(PATH)" go test ./test/e2e/ -v -timeout 30m
$(MAKE) gofail-disable

.PHONY: gofail-enable
Expand Down Expand Up @@ -125,8 +126,9 @@ verify: verify-mod-tidy lint ## Run static checks against the code.
##@ Build

.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
build: manifests generate fmt vet ## Build manager and mirror-agent binaries.
go build -o bin/manager cmd/main.go
go build -o bin/mirror-agent ./cmd/mirror-agent

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
Expand Down
9 changes: 9 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ resources:
kind: EtcdCluster
path: go.etcd.io/etcd-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: etcd.io
group: operator
kind: EtcdMirror
path: go.etcd.io/etcd-operator/api/v1alpha1
version: v1alpha1
version: "3"
953 changes: 953 additions & 0 deletions api/v1alpha1/etcdmirror_types.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func addKnownTypes(s *runtime.Scheme) error {
s.AddKnownTypes(GroupVersion,
&EtcdCluster{},
&EtcdClusterList{},
&EtcdMirror{},
&EtcdMirrorList{},
)
metav1.AddToGroupVersion(s, GroupVersion)
return nil
Expand Down
Loading