Skip to content

Commit 9761ba6

Browse files
committed
Add kubectl-etcd plugin
Signed-off-by: Andrei Kvapil <[email protected]>
1 parent d7a6f5a commit 9761ba6

File tree

6 files changed

+755
-60
lines changed

6 files changed

+755
-60
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.22.3 AS builder
2+
FROM golang:1.22.2 AS builder
33
ARG TARGETOS TARGETARCH
44

55
WORKDIR /workspace
@@ -11,7 +11,7 @@ COPY go.mod go.sum ./
1111
RUN go mod download
1212

1313
# Copy the go source
14-
COPY cmd/main.go ./cmd/
14+
COPY cmd/manager/ ./cmd/manager/
1515
COPY api/ ./api/
1616
COPY internal/ ./internal/
1717

@@ -20,7 +20,7 @@ COPY internal/ ./internal/
2020
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
2121
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
2222
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
23-
RUN CGO_ENABLED=0 GOOS="${TARGETOS:-linux}" GOARCH="${TARGETARCH}" go build -a -o manager cmd/main.go
23+
RUN CGO_ENABLED=0 GOOS="${TARGETOS:-linux}" GOARCH="${TARGETARCH}" go build -a -o manager cmd/manager/main.go
2424

2525
# Use distroless as minimal base image to package the manager binary
2626
# Refer to https://github.com/GoogleContainerTools/distroless for more details

Makefile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ mod-tidy: ## Run go mod tidy against code.
6969

7070
.PHONY: test
7171
test: manifests generate fmt vet envtest ## Run tests.
72-
echo "Check for kubernetes version $(ENVTEST_K8S_VERSION_TRIMMED_V) in $(ENVTEST)"
73-
@$(ENVTEST) list | grep -q $(ENVTEST_K8S_VERSION_TRIMMED_V)
7472
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION_TRIMMED_V) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
7573

7674
# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
@@ -113,7 +111,10 @@ helm-crd-copy: yq kustomize ## Copy CRDs from kustomize to helm-chart
113111

114112
.PHONY: build
115113
build: manifests generate fmt vet ## Build manager binary.
116-
go build -o bin/manager cmd/main.go
114+
go build -o bin/manager cmd/manager/main.go
115+
116+
build-plugin:
117+
go build -o bin/kubectl-etcd cmd/kubectl-etcd/main.go
117118

118119
.PHONY: run
119120
run: manifests generate fmt vet ## Run a controller from your host.
@@ -157,9 +158,9 @@ KIND_CLUSTER_NAME ?= etcd-operator-kind
157158
NAMESPACE ?= etcd-operator-system
158159

159160
# renovate: datasource=github-tags depName=prometheus-operator/prometheus-operator
160-
PROMETHEUS_OPERATOR_VERSION ?= v0.74.0
161+
PROMETHEUS_OPERATOR_VERSION ?= v0.73.2
161162
# renovate: datasource=github-tags depName=jetstack/cert-manager
162-
CERT_MANAGER_VERSION ?= v1.14.5
163+
CERT_MANAGER_VERSION ?= v1.14.4
163164

164165
ifndef ignore-not-found
165166
ignore-not-found = false
@@ -241,20 +242,20 @@ YQ = $(LOCALBIN)/yq
241242
# renovate: datasource=github-tags depName=kubernetes-sigs/kustomize
242243
KUSTOMIZE_VERSION ?= v5.3.0
243244
# renovate: datasource=github-tags depName=kubernetes-sigs/controller-tools
244-
CONTROLLER_TOOLS_VERSION ?= v0.15.0
245+
CONTROLLER_TOOLS_VERSION ?= v0.14.0
245246
ENVTEST_VERSION ?= latest
246247
# renovate: datasource=github-tags depName=golangci/golangci-lint
247-
GOLANGCI_LINT_VERSION ?= v1.58.1
248+
GOLANGCI_LINT_VERSION ?= v1.57.2
248249
# renovate: datasource=github-tags depName=kubernetes-sigs/kind
249-
KIND_VERSION ?= v0.23.0
250+
KIND_VERSION ?= v0.22.0
250251
# renovate: datasource=github-tags depName=helm/helm
251-
HELM_VERSION ?= v3.15.0
252+
HELM_VERSION ?= v3.14.4
252253
# renovate: datasource=github-tags depName=losisin/helm-values-schema-json
253-
HELM_SCHEMA_VERSION ?= v1.3.0
254+
HELM_SCHEMA_VERSION ?= v1.2.4
254255
# renovate: datasource=github-tags depName=norwoodj/helm-docs
255256
HELM_DOCS_VERSION ?= v1.13.1
256257
# renovate: datasource=github-tags depName=mikefarah/yq
257-
YQ_VERSION ?= v4.44.1
258+
YQ_VERSION ?= v4.43.1
258259

259260
## Tool install scripts
260261
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"

0 commit comments

Comments
 (0)