Skip to content

feat: use registry auth secret as image pull secret#124

Open
creydr wants to merge 3 commits intofunctions-dev:mainfrom
creydr:image-pull-secret-support
Open

feat: use registry auth secret as image pull secret#124
creydr wants to merge 3 commits intofunctions-dev:mainfrom
creydr:image-pull-secret-support

Conversation

@creydr
Copy link
Copy Markdown
Collaborator

@creydr creydr commented Apr 30, 2026

Summary

  • When spec.registry.authSecretRef is configured, the operator now adds it to the default ServiceAccount's imagePullSecrets during deploy, so function pods can pull images from private registries at runtime.
  • Adds serviceaccounts to the operator's RBAC permissions.
  • Includes unit tests (envtest) covering the core logic: adding the secret, idempotency, and preserving existing pull secrets.
  • Includes an e2e test that verifies the SA gets patched during a middleware-update redeploy, using a dummy dockerconfigjson secret against the unauthenticated kind-registry (documented in test comments: per-repository registry auth is not supported by htpasswd, and a second registry adds too much infra overhead).

creydr added 3 commits April 30, 2026 14:19
…eAccount

When a registry auth secret is configured via spec.registry.authSecretRef,
it is now also added to the default ServiceAccount's imagePullSecrets so
that function pods can pull images from private registries at runtime.
Verifies the operator adds spec.registry.authSecretRef to the default
ServiceAccount's imagePullSecrets during a middleware-update redeploy.

Uses a dummy dockerconfigjson secret against the unauthenticated
kind-registry since enabling registry auth would require either
per-repository scoping (unsupported by htpasswd) or a second registry
container, both adding too much infra overhead for this wiring test.
Extract shared string constants (deployerKeda, deployerRaw,
oldFuncCLIVersion) to fix goconst warnings and add nolint:dupl
directives on intentionally duplicated BeforeEach blocks.
@creydr
Copy link
Copy Markdown
Collaborator Author

creydr commented Apr 30, 2026

Hint: this leads to patching the default service account in the functions namespace (adding pullImageSecret refs). I am not sure if this distracts GitOps 🤔

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.

1 participant