From 24d45151e191b5b6a4166e66de2724b62f0724e3 Mon Sep 17 00:00:00 2001 From: Furkat Gofurov Date: Thu, 26 Dec 2024 17:34:52 +0200 Subject: [PATCH] Fix local tilt setup Signed-off-by: Furkat Gofurov --- ...er-turtles-exp-etcdrestore-components.yaml | 2 +- exp/etcdrestore/Dockerfile | 52 ------------------- .../config/default/manager_image_patch.yaml | 3 +- tilt/project/Tiltfile | 2 +- 4 files changed, 3 insertions(+), 56 deletions(-) delete mode 100644 exp/etcdrestore/Dockerfile diff --git a/charts/rancher-turtles/templates/rancher-turtles-exp-etcdrestore-components.yaml b/charts/rancher-turtles/templates/rancher-turtles-exp-etcdrestore-components.yaml index 3eef9349..b76d38a1 100644 --- a/charts/rancher-turtles/templates/rancher-turtles-exp-etcdrestore-components.yaml +++ b/charts/rancher-turtles/templates/rancher-turtles-exp-etcdrestore-components.yaml @@ -589,7 +589,7 @@ spec: - args: - --leader-elect command: - - ./etcd-snapshot-restore + - /manager env: - name: POD_NAMESPACE valueFrom: diff --git a/exp/etcdrestore/Dockerfile b/exp/etcdrestore/Dockerfile deleted file mode 100644 index bc11e7e3..00000000 --- a/exp/etcdrestore/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Build the etcdrestore binary -# Run this with docker build --build-arg builder_image= -ARG builder_image - -# Ignore Hadolint rule "Always tag the version of an image explicitly." -# It's an invalid finding since the image is explicitly set in the Makefile. -# https://github.com/hadolint/hadolint/wiki/DL3006 -# hadolint ignore=DL3006 -FROM ${builder_image} as builder - -WORKDIR /workspace - -# Run this with docker build --build-arg goproxy=$(go env GOPROXY) to override the goproxy -ARG goproxy=https://proxy.golang.org -# Run this with docker build --build-arg package=./exp/etcdrestore -ENV GOPROXY=$goproxy - -# Copy the sources -COPY ./ ./ - -# Build -ARG ldflags - -# Do not force rebuild of up-to-date packages (do not use -a) and use the compiler cache folder -RUN --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=cache,target=/go/pkg/mod \ - CGO_ENABLED=0 GOOS=linux \ - sh -c "cd exp/etcdrestore && ls && go build -trimpath -ldflags \"${ldflags} -extldflags '-static'\" -o manager ${package}" - -# Production image -FROM gcr.io/distroless/static:nonroot -WORKDIR / -COPY --from=builder /workspace/exp/etcdrestore/manager . -# Use uid of nonroot user (65532) because kubernetes expects numeric user when applying pod security policies -USER 65532 -ENTRYPOINT ["/manager"] diff --git a/exp/etcdrestore/config/default/manager_image_patch.yaml b/exp/etcdrestore/config/default/manager_image_patch.yaml index 132cd663..50ff8703 100644 --- a/exp/etcdrestore/config/default/manager_image_patch.yaml +++ b/exp/etcdrestore/config/default/manager_image_patch.yaml @@ -8,5 +8,4 @@ spec: spec: containers: - image: ghcr.io/rancher/turtles-etcd-snapshot-restore:dev - name: manager - command: ["./etcd-snapshot-restore"] \ No newline at end of file + name: manager \ No newline at end of file diff --git a/tilt/project/Tiltfile b/tilt/project/Tiltfile index b9131e93..24c6afa6 100644 --- a/tilt/project/Tiltfile +++ b/tilt/project/Tiltfile @@ -272,7 +272,7 @@ def get_port_forwards(debug): tilt_helper_dockerfile_header = """ # Tilt image -FROM golang:1.20.4 as tilt-helper +FROM golang:1.22.10 as tilt-helper # Support live reloading with Tilt RUN go install github.com/go-delve/delve/cmd/dlv@latest RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/tilt-dev/rerun-process-wrapper/master/restart.sh && \