Skip to content
Open
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
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG DENO_VERSION=2.9.4

FROM golang:1.25 AS builder

ARG TARGETOS
Expand All @@ -16,12 +18,17 @@ COPY internal/ internal/

RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go

FROM gcr.io/distroless/static:nonroot
FROM denoland/deno:bin-${DENO_VERSION} AS deno

# Deno is dynamically linked against glibc, so the final image cannot be distroless/static.
FROM gcr.io/distroless/cc-debian12:nonroot

ENV HOME=/tmp
ENV HOME=/tmp \
NELM_DENO_BINARY_PATH=/usr/local/bin/deno

WORKDIR /

COPY --from=deno /deno /usr/local/bin/deno
COPY --from=builder /nelm-operator/manager .

USER 65532:65532
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ docker-push: ## Push docker image with the manager.
# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=<myregistry/image:<tag>> then the export will fail)
# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
# Limited to amd64/arm64: Deno, which the image bundles for TypeScript charts, publishes no other linux builds.
PLATFORMS ?= linux/arm64,linux/amd64
.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
Expand Down
6 changes: 5 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
var dependencyWatchLabelSelector string

// Controller runtime flags.
flag.StringVar(&cfg.MetricsBindAddress, "metrics-bind-address", "0", "The address the metrics endpoint binds to. Use :8443 for HTTPS or :8080 for HTTP, or leave as 0 to disable.")

Check failure on line 51 in cmd/main.go

View workflow job for this annotation

GitHub Actions / Run on Ubuntu

The line is 180 characters long, which exceeds the maximum of 120 characters. (lll)

Check failure on line 51 in cmd/main.go

View workflow job for this annotation

GitHub Actions / Run on Ubuntu

The line is 180 characters long, which exceeds the maximum of 120 characters. (lll)
flag.StringVar(&cfg.HealthProbeBindAddress, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")

Check failure on line 52 in cmd/main.go

View workflow job for this annotation

GitHub Actions / Run on Ubuntu

The line is 126 characters long, which exceeds the maximum of 120 characters. (lll)

Check failure on line 52 in cmd/main.go

View workflow job for this annotation

GitHub Actions / Run on Ubuntu

The line is 126 characters long, which exceeds the maximum of 120 characters. (lll)
flag.BoolVar(&cfg.LeaderElect, "leader-elect", false, "Enable leader election for controller manager.")
flag.BoolVar(&cfg.MetricsSecure, "metrics-secure", true, "If set, the metrics endpoint is served securely via HTTPS.")
flag.StringVar(&metricsCertDir, "metrics-cert-path", "", "The directory that contains the metrics server certificate.")
Expand All @@ -57,8 +57,8 @@
flag.StringVar(&metricsCertKey, "metrics-cert-key", "tls.key", "The name of the metrics server key file.")

// Operator-specific flags.
flag.StringVar(&cfg.DefaultServiceAccountName, "default-service-account", "", "Service account to use during release deploy.")

Check failure on line 60 in cmd/main.go

View workflow job for this annotation

GitHub Actions / Run on Ubuntu

The line is 127 characters long, which exceeds the maximum of 120 characters. (lll)

Check failure on line 60 in cmd/main.go

View workflow job for this annotation

GitHub Actions / Run on Ubuntu

The line is 127 characters long, which exceeds the maximum of 120 characters. (lll)
flag.IntVar(&cfg.MaxConcurrentReconciles, "max-concurrent-reconciles", 5, "Number of Release CRDs reconciled in parallel.")

Check failure on line 61 in cmd/main.go

View workflow job for this annotation

GitHub Actions / Run on Ubuntu

The line is 124 characters long, which exceeds the maximum of 120 characters. (lll)

Check failure on line 61 in cmd/main.go

View workflow job for this annotation

GitHub Actions / Run on Ubuntu

The line is 124 characters long, which exceeds the maximum of 120 characters. (lll)
flag.DurationVar(&cfg.GracefulShutdownTimeout, "graceful-shutdown-timeout", 600*time.Second, "How long to wait for in-flight reconciles on SIGTERM.")
flag.BoolVar(&cfg.WatchAllNamespaces, "watch-all-namespaces", true, "Watch Release CRDs in all namespaces.")
flag.StringVar(&cfg.WatchNamespace, "watch-namespace", "", "If set, only watch this namespace for Release CRDs.")
Expand All @@ -82,7 +82,7 @@
flag.IntVar(&cfg.NetworkParallelism, "network-parallelism", 30, "Limit of network-related tasks to run in parallel per reconcile.")

// TypeScript / Misc.
flag.StringVar(&cfg.DenoBinaryPath, "deno-binary-path", "", "Path to the Deno binary for TypeScript chart rendering.")
flag.StringVar(&cfg.DenoBinaryPath, "deno-binary-path", "", "Path to the Deno binary for TypeScript chart rendering. Falls back to $NELM_DENO_BINARY_PATH, then to downloading Deno at runtime.")
flag.StringVar(&cfg.TempDir, "temp-dir", "", "Directory for temporary files.")

// Logging.
Expand Down Expand Up @@ -117,6 +117,10 @@
cfg.ReleaseStorageSQLConnection = v
}

if v := os.Getenv("NELM_DENO_BINARY_PATH"); v != "" && cfg.DenoBinaryPath == "" {
cfg.DenoBinaryPath = v
}

cfg.MetricsCertDir = metricsCertDir
cfg.MetricsCertName = metricsCertName
cfg.MetricsCertKey = metricsCertKey
Expand Down
Loading