Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 11 additions & 8 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def validate_auth():

tilt_helper_dockerfile_header = """
# Tilt image
FROM golang:1.20 as tilt-helper
FROM golang:1.23.6 as tilt-helper
# Support live reloading with Tilt
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/restart.sh && \
wget --output-document /start.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/start.sh && \
Expand All @@ -109,10 +109,13 @@ RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com

tilt_dockerfile_header = """
FROM gcr.io/distroless/base:debug as tilt
WORKDIR /
WORKDIR /app
COPY --from=tilt-helper /start.sh .
COPY --from=tilt-helper /restart.sh .
COPY manager .
RUN ["/busybox/chmod", "+x", "/app/start.sh", "/app/restart.sh", "/app/manager"]
RUN ["/busybox/chown", "-R", "65532:65532", "/app"]
USER 65532:65532
"""

# Build CAPDO and add feature gates
Expand All @@ -135,16 +138,16 @@ def capdo():
# Set up a local_resource build of the provider's manager binary.
local_resource(
"manager",
cmd = 'mkdir -p .tiltbuild;CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags \'-extldflags "-static"\' -o .tiltbuild/manager',
deps = ["api", "cloud", "config", "controllers", "exp", "feature", "pkg", "go.mod", "go.sum", "main.go"]
cmd = 'mkdir -p .tiltbuild;CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags \'-extldflags "-static"\' -o .tiltbuild/manager ./cmd',
deps = ["api", "cloud", "config", "internal", "cmd", "util", "version", "go.mod", "go.sum"]
)

dockerfile_contents = "\n".join([
tilt_helper_dockerfile_header,
tilt_dockerfile_header,
])

entrypoint = ["sh", "/start.sh", "/manager"]
entrypoint = ["sh", "/app/start.sh", "/app/manager"]
extra_args = settings.get("extra_args")
if extra_args:
entrypoint.extend(extra_args)
Expand All @@ -159,8 +162,8 @@ def capdo():
entrypoint = entrypoint,
only = "manager",
live_update = [
sync(".tiltbuild/manager", "/manager"),
run("sh /restart.sh"),
sync(".tiltbuild/manager", "/app/manager"),
run("sh /app/restart.sh"),
],
ignore = ["templates"]
)
Expand Down Expand Up @@ -203,7 +206,7 @@ include_user_tilt_files()
load("ext://cert_manager", "deploy_cert_manager")

if settings.get("deploy_cert_manager"):
deploy_cert_manager()
deploy_cert_manager(version=settings.get("cert_manager_version"))

deploy_capi()

Expand Down
5 changes: 3 additions & 2 deletions scripts/kind-with-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ set -o errexit
set -o nounset
set -o pipefail


REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
KUBECTL=$REPO_ROOT/hack/tools/bin/kubectl

# desired kind cluster name; default is "capdo"
KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-capdo}"
# Note: Use available kindest/node image versions from https://hub.docker.com/r/kindest/node/tags
KUBERNETES_VERSION="${KUBERNETES_VERSION:-v1.31.14}"

if [[ "$(kind get clusters)" =~ .*"${KIND_CLUSTER_NAME}".* ]]; then
echo "cluster already exists, moving on"
Expand All @@ -39,7 +40,7 @@ if [ "${running}" != 'true' ]; then
fi

# create a cluster with the local registry enabled in containerd
cat <<EOF | kind create cluster --name "${KIND_CLUSTER_NAME}" --config=-
cat <<EOF | kind create cluster --name "${KIND_CLUSTER_NAME}" --image "kindest/node:${KUBERNETES_VERSION}" --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
containerdConfigPatches:
Expand Down