operator sync creates registry auth Secret as Opaque/config.json, incompatible with func-operator (expects dockerconfigjson)
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Summary
When func deploy runs in operator mode (auto-creating/updating a Function CR), it creates the registry auth Secret as type: Opaque with data key config.json, and points the CR's spec.registry.authSecretRef at it. However func-operator reads that authSecretRef and requires type: kubernetes.io/dockerconfigjson with key .dockerconfigjson. The types don't match, so when the operator later needs that secret (e.g. on a redeploy/rebuild), it fails with:
failed to persist registry auth secret temporarily: invalid registry auth secret type, must be of type kubernetes.io/dockerconfigjson
The operator can never consume the very secret func created for it.
Where
func side (creates the secret + wires the CR):
pkg/operator/sync.go:41—ensureRegistrySecret = k8s.EnsureDockerRegistrySecretExistpkg/operator/sync.go:86-102— creates<functionName>-registry-authand setsdesiredSpec.Registry.AuthSecretRefpkg/k8s/secrets.go:99-102—EnsureDockerRegistrySecretExistcreates the Secret as:Type: corev1.SecretTypeOpaque, secret.Data["config.json"] = dockerConfigJSONContent
func-operator side (rejects it):
internal/controller/function_deploy.go(persistRegistryAuthSecret) requiresauthSecret.Type == corev1.SecretTypeDockerConfigJsonand data keycorev1.DockerConfigJsonKey(.dockerconfigjson).
Reproduce
- On a cluster with func-operator installed, with registry credentials available (e.g. you've
docker login'd),func deploya function so operator sync creates aFunctionCR withregistry.authSecretRefpointing at the func-created-registry-authOpaque secret. - Trigger an operator redeploy of that function (e.g. the deployed image's middleware is outdated, so the operator rebuilds).
- The operator reconcile fails:
invalid registry auth secret type, must be of type kubernetes.io/dockerconfigjson.
Expected
The Secret func creates for spec.registry.authSecretRef should be in the format func-operator consumes — type: kubernetes.io/dockerconfigjson with key .dockerconfigjson — so the operator can use the credentials func provisioned. (Alternatively the two projects agree on a single format; today they disagree.)
Notes
- Found while building e2e coverage for func-operator's middleware-rebuild path on OpenShift. The func-operator detection worked correctly (
Middleware outdated, redeploying current=v0.21.3 available=v0.22.0); the rebuild then failed on the secret type. EnsureDockerRegistrySecretExistproducing anOpaque/config.jsonsecret (rather than a dockerconfigjson-typed one) is itself a little surprising given the name.
- 主要言語
- Go
- スター
- 366
- フォーク
- 226
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
knative/func のほかの issue
-
KEDA deployer: default minReplicaCount prevents scale-to-zero対応中かも @Tushar-Khandelwal-2004 が 115 日前に担当しました。 オープンlifecycle/stale
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
knative/func#3924 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
git/gitlab: default project webhooks to SSL verification when creating hooks対応中かも @Vi-shub が 162 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
mcp: config add/remove handlers bypass readonly guard対応中かも @Elvand-Lie が 164 日前に担当しました。 オープンkind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
knative/func#3704 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
kind/documentation
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
kind/cleanup
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
status:needs-review type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Gentleman-Programming/engram#2079 ·
メンテナーはふだん 1 日以内に返信
-
bug triage/pending
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
limitlessprojects/Go-Hybrid#1377 ·
メンテナーはふだん 1 日以内に返信
-
bug report
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 3 日以内に返信