operator sync creates registry auth Secret as Opaque/config.json, incompatible with func-operator (expects dockerconfigjson)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 365
- Fork
- 224
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của knative/func
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
KEDA deployer: default minReplicaCount prevents scale-to-zeroCó thể đã có người làm @Tushar-Khandelwal-2004 đã nhận 112 ngày trước. Đang mởlifecycle/stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
knative/func#3924 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
git/gitlab: default project webhooks to SSL verification when creating hooksCó thể đã có người làm @Vi-shub đã nhận 159 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
mcp: config add/remove handlers bypass readonly guardCó thể đã có người làm @Elvand-Lie đã nhận 161 ngày trước. Đang mởkind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
knative/func#3704 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/cleanup
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
test(fabric): load the TestLoad fixture through config.Service instead of a raw koanf decodeĐang mởcleanup hacktoberfest priority: low skill: good first issue testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
hyperledger-labs/fabric-smart-client#2197 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
NTR: [tRNA kinase activity]Đang mởNew term request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
geneontology/go-ontology#32791 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
aws/amazon-ecs-agent#5177 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
release-followup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày