Skip to content

fix: honor provider build tags in Dockerfile.standalone - #67

Merged
mkousteris merged 1 commit into
workable-1.3.1from
create-workable-1.3.1
Sep 2, 2026
Merged

fix: honor provider build tags in Dockerfile.standalone#67
mkousteris merged 1 commit into
workable-1.3.1from
create-workable-1.3.1

Conversation

@mkousteris

Copy link
Copy Markdown

Problem

workable-1.3.1's image was built via .github/workflows/ci.yml's publish-artifacts job, which uses docker/build-push-action with file: Dockerfile.standalone — a plain docker build, not the Makefile-driven Dockerfile/Dockerfile.ubi path our CI never touches.

Dockerfile.standalone ran:

RUN go build -o external-secrets main.go

with no -tags flag at all.

Since upstream's v1.x provider-separation refactor (design/007-provider-versioning-strategy.md), every provider's registration is gated behind a Go build constraint — pkg/register/vault.go:

//go:build vault || all_providers
package register
...
func init() { esv1.Register(vault.NewProvider(), ...) }

(documented in AGENTS.md: "Makefile honors PROVIDER ?= all_providers and passes it as go build -tags"). A bare go build with no tags excludes every file in pkg/register, so nothing registers, and every store fails:

{"level":"error","logger":"controllers.ClusterSecretStore","msg":"unable to validate store","error":"could not get provider client: failed to find registered store backend for type: vault, name: <store>"}

Reproduced on workablestg9-eks after deploying this image — every ClusterSecretStore shows InvalidProviderConfig/Ready: False with exactly this error, despite valid Vault config.

Same root cause, same error shape as a real upstream bug: external-secrets/external-secrets#5807 (webhook provider missing from a make run dev build), fixed upstream in external-secrets/external-secrets#5851 — but that fix only touched Makefile/Tiltfile, never Dockerfile.standalone. This file's own header comment ("for building without external dependencies") confirms it's a real, intended build path — it just predates (or was missed by) the build-tag system and has carried this gap since.

Fix

Add ARG PROVIDER=all_providers (matching the Makefile's own default) and pass it through as -tags, so:

  • A plain docker build -f Dockerfile.standalone . keeps working exactly as before (all providers included, matching current expectations).
  • --build-arg PROVIDER=vault (or any other provider name/list) builds a slimmer binary when that's wanted.

Testing plan

  • Build --build-arg PROVIDER=vault and confirm vault backend registers (controller starts, ClusterSecretStore/SecretStore reconcile to Ready)
  • Build with no --build-arg (default) and confirm behavior matches current default (all providers present)
  • Re-run workable-1.3.1 image build once merged, redeploy to workablestg9-eks, confirm ClusterSecretStore resources go Ready: True

Worth reporting upstream?

This gap exists in external-secrets/external-secrets's own Dockerfile.standalone too (unchanged from our fork, confirmed via diff at the same tag) — worth a matching upstream PR once verified here, since anyone building that file on v1.x+ hits the same issue.

go build -o external-secrets main.go had no -tags flag. Since v1.x,
every provider registration lives behind a Go build constraint
(pkg/register/<name>.go: //go:build <name> || all_providers, see
AGENTS.md), so a bare go build compiles an empty pkg/register and
zero providers register at runtime. Every ClusterSecretStore/SecretStore
then fails reconciliation with:

  could not get provider client: failed to find registered store
  backend for type: vault, name: <store>

Same root cause, same error shape as external-secrets#5807
(webhook provider, `make run` dev build), fixed there for the Makefile/
Tiltfile default in external-secrets#5851 - but that
fix never touched Dockerfile.standalone, which still builds with no
tags at all.

Adds ARG PROVIDER=all_providers (matching the Makefile's own default)
and passes it through as -tags, so a plain `docker build -f
Dockerfile.standalone .` keeps working out of the box, while
`--build-arg PROVIDER=vault` (or any other provider name) still lets
you build a slimmer binary.
@mkousteris
mkousteris marked this pull request as ready for review September 2, 2026 09:59
@mkousteris
mkousteris requested a review from a team as a code owner September 2, 2026 09:59
@mkousteris
mkousteris merged commit 232755a into workable-1.3.1 Sep 2, 2026
7 checks passed
@mkousteris
mkousteris deleted the create-workable-1.3.1 branch September 2, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants