FindReferencingConfigMaps and FindReferencingSecrets miss CronJob references

Đang mở Phù hợp với người mới
#6,761 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

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

Từ ngày 15/7/2026.

  • #6762 của @Ram04102007 — đã đóng, không merge
  • #7030 của @Ankitdotraider — đã đóng, không merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go, kubernetes
Lĩnh vực
infrastructure

Hướng nghiên cứu

Tìm FindReferencingConfigMaps và FindReferencingSecrets trong các provider package kubernetes và kubernetes_multicluster, sau đó so sánh các nestedStringSlice probe hiện có của chúng cho pod template. Thêm các probe tương ứng cho các đường dẫn jobTemplate của CronJob được liệt kê trong issue, và xác minh rằng các tham chiếu ConfigMap và Secret từ volume, container và init container được tìm thấy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What's the problem

While looking at the code after #6528 was fixed, I noticed that
FindReferencingConfigMaps and FindReferencingSecrets have the same
gap — they don't handle CronJobs.

Both functions only look through spec.template.spec.*, which works
for Deployments, StatefulSets, and DaemonSets. But CronJobs put their
pod template under spec.jobTemplate.spec.template.spec.*, so any
ConfigMap or Secret referenced inside a CronJob is completely invisible
to these functions.

What breaks

If a CronJob mounts a ConfigMap as a volume or pulls credentials from a
Secret via env, PipeCD won't know about it. That means drift detection
won't catch config changes, and re-deploys won't be triggered when those
configs change.

Paths that are currently missed

FindReferencingConfigMaps:

  • spec.jobTemplate.spec.template.spec.volumes.configMap.name
  • spec.jobTemplate.spec.template.spec.containers.env.valueFrom.configMapKeyRef.name
  • spec.jobTemplate.spec.template.spec.containers.envFrom.configMapRef.name
  • spec.jobTemplate.spec.template.spec.initContainers.env.valueFrom.configMapKeyRef.name
  • spec.jobTemplate.spec.template.spec.initContainers.envFrom.configMapRef.name

FindReferencingSecrets:

  • spec.jobTemplate.spec.template.spec.volumes.secret.secretName
  • spec.jobTemplate.spec.template.spec.containers.env.valueFrom.secretKeyRef.name
  • spec.jobTemplate.spec.template.spec.containers.envFrom.secretRef.name
  • spec.jobTemplate.spec.template.spec.initContainers.env.valueFrom.secretKeyRef.name
  • spec.jobTemplate.spec.template.spec.initContainers.envFrom.secretRef.name

The fix is straightforward — add the missing nestedStringSlice probes
for the jobTemplate paths, same pattern already used for the existing paths.

Affects both kubernetes and kubernetes_multicluster provider packages.

Ngôn ngữ chính
Go
Star
1.4k
Fork
391
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
58

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 pipe-cd/pipecd

Tất cả issue của pipe-cd/pipecd

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.