Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

operator sync creates registry auth Secret as Opaque/config.json, incompatible with func-operator (expects dockerconfigjson)

Đang mở
#4,081 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@gauron99 đang làm issue này rồi.

Từ ngày 14/10/2026.

  • #4082 của @gauron99 — đang mở

Đá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.EnsureDockerRegistrySecretExist
  • pkg/operator/sync.go:86-102 — creates <functionName>-registry-auth and sets desiredSpec.Registry.AuthSecretRef
  • pkg/k8s/secrets.go:99-102 — EnsureDockerRegistrySecretExist creates the Secret as:
    Type: corev1.SecretTypeOpaque,
    secret.Data["config.json"] = dockerConfigJSONContent
    

func-operator side (rejects it):

  • internal/controller/function_deploy.go (persistRegistryAuthSecret) requires authSecret.Type == corev1.SecretTypeDockerConfigJson and data key corev1.DockerConfigJsonKey (.dockerconfigjson).

Reproduce

  1. On a cluster with func-operator installed, with registry credentials available (e.g. you've docker login'd), func deploy a function so operator sync creates a Function CR with registry.authSecretRef pointing at the func-created -registry-auth Opaque secret.
  2. Trigger an operator redeploy of that function (e.g. the deployed image's middleware is outdated, so the operator rebuilds).
  3. 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.
  • EnsureDockerRegistrySecretExist producing an Opaque/config.json secret (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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của knative/func

Tất cả issue của knative/func

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.