settings.py flaps between reconciles: needsMigrationSetting depends on map iteration order

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

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

Từ ngày 5/10/2026.

  • #1692 của @fontaineajulien — đang mở

Đánh giá

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

Hướng nghiên cứu

Đọc controllers/repo_manager/secret.go, bắt đầu với needsMigrationSetting() và cách hàm này sử dụng MigrationSettingsList(). Kiểm tra các bài kiểm thử liên quan trước khi thực hiện thay đổi. Công việc được xem là hoàn tất khi settings.py được tạo ổn định qua các lần reconcile và mọi thiết lập được đặt thành true đều được ghi lại.

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

Mô tả

Version
Operator 1.3.0. The same code is on main.

Describe the bug
needsMigrationSetting() in controllers/repo_manager/secret.go builds part of settings.py by ranging over MigrationSettingsList(), which is a Go map, and it returns at the first setting that is false.

Go randomizes map iteration order. With redirect_to_object_storage: true and hide_guarded_distributions: false, REDIRECT_TO_OBJECT_STORAGE = True is written on some reconciles and missing on others. With both settings true, the two lines swap order.

So the <name>-server Secret changes between reconciles. The operator logs The Data from Secret pulp-server has been modified! Reconciling ... and Reprovisioning pulpcore pods to get the new settings ..., and rolls the api, content and worker Deployments. The rollout triggers more reconciles, each with roughly a 50% chance of flipping the Secret again, so the loop sustains itself. We saw it run for minutes after a single CR change, and once it ran for days, creating tens of thousands of ReplicaSets.

There is a second effect. Depending on the order, a true setting can be dropped from settings.py entirely, so REDIRECT_TO_OBJECT_STORAGE is sometimes not applied.

To Reproduce

  1. Set redirect_to_object_storage: true and leave hide_guarded_distributions unset.
  2. Change anything on the CR to trigger a reconcile.
  3. Watch the operator logs and kubectl get rs.

Expected behavior
settings.py is identical on every reconcile, and each true setting is written.

Additional context
Fix: iterate over sorted keys, and continue instead of return on a false setting. PR to follow.

Ngôn ngữ chính
Go
Star
88
Fork
69
Merge trung bình
3 ngày 3 giờ
Pull request đã merge (30 ngày)
1

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 pulp/pulp-operator

Tất cả issue của pulp/pulp-operator

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.