ha: key doorRefusal literals from the main merge
Main's app copies code (6209ce43) builds doorRefusal positionally; the capacity Retry-After field added on this branch needs keyed literals. No behaviour change.
2 files changed,
+7
−7
internal/console/appcopies.go+3 −3internal/console/copiespublication.go+4 −4
CI cancelled — superseded by a newer push — run details
Intent
Human
<task-notification> <task-id>ba0l9oysd</task-id> <tool-use-id>toolu_01CFicjGMBnyCCydXYeknjFy</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/de069047-3c6a-40e7-ae66-85194f066976/tasks/ba0l9oysd.output</output-file> <status>completed</status> <summary>Background command "Wait for T4 implementer" completed (exit code 0)</summary> </task-notification>
diff --git a/internal/console/appcopies.go b/internal/console/appcopies.go| index 6d9320946..874f839e7 100644 |
| --- a/internal/console/appcopies.go |
| +++ b/internal/console/appcopies.go |
| @@ -120,10 +120,10 @@ func (s *Server) handleAPICopies(w http.ResponseWriter, r *http.Request) { |
| // a count against the complete inventory. A canonical target checks a |
| // publication for an explicitly configured app, including removal at count 1. |
| func (s *Server) copiesRefusal(ctx context.Context, acct *Account, app string, n int, target *release.Manifest) *doorRefusal { |
| - refuse := func(msg string) *doorRefusal { return &doorRefusal{http.StatusConflict, msg} } |
| - unread := func() *doorRefusal { return &doorRefusal{http.StatusServiceUnavailable, copiesUnread} } |
| + refuse := func(msg string) *doorRefusal { return &doorRefusal{Status: http.StatusConflict, Msg: msg} } |
| + unread := func() *doorRefusal { return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: copiesUnread} } |
| if n < 1 { |
| - return &doorRefusal{http.StatusBadRequest, copiesBounds} |
| + return &doorRefusal{Status: http.StatusBadRequest, Msg: copiesBounds} |
| } |
| if n > 1 { |
| if ref := s.demoMutationRefusal(acct, app); ref != nil { |
diff --git a/internal/console/copiespublication.go b/internal/console/copiespublication.go| index 6551a1423..cf820de4b 100644 |
| --- a/internal/console/copiespublication.go |
| +++ b/internal/console/copiespublication.go |
| @@ -43,7 +43,7 @@ func (s *Server) captureCopiesAdmission(r *http.Request, acct *Account, app stri |
| } |
| func copiesUnavailable() *doorRefusal { |
| - return &doorRefusal{http.StatusServiceUnavailable, copiesUnread} |
| + return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: copiesUnread} |
| } |
| func (s *Server) copiesStillApp(ctx context.Context, acct *Account, app string) *doorRefusal { |
| @@ -59,7 +59,7 @@ func (s *Server) copiesStillApp(ctx context.Context, acct *Account, app string) |
| return copiesUnavailable() |
| } |
| if !admitted.valid || admitted.account != acct.ID || admitted.app != app || !ok || inc != admitted.incarnation { |
| - return &doorRefusal{http.StatusConflict, copiesUnread} |
| + return &doorRefusal{Status: http.StatusConflict, Msg: copiesUnread} |
| } |
| return nil |
| } |
| @@ -165,10 +165,10 @@ func (s *Server) copiesRecordRefusal(ctx context.Context, acct *Account, rec pro |
| n := appconfig.CopiesOf(&cfg.manifest) |
| if n > 1 { |
| if rec.Demo != nil || (s.cfg.Demo.Fleet != "" && rec.Region == registry.PlacementTarget(s.cfg.Demo.Fleet)) || !rec.DerivesPaths() || rec.HA || rec.Role != "" || rec.Pool != "" || len(rec.Replicas) != 0 { |
| - return &doorRefusal{http.StatusConflict, copiesManaged} |
| + return &doorRefusal{Status: http.StatusConflict, Msg: copiesManaged} |
| } |
| if rec.Move != nil || rec.Seed.BlocksRun() { |
| - return &doorRefusal{http.StatusConflict, copiesMoving} |
| + return &doorRefusal{Status: http.StatusConflict, Msg: copiesMoving} |
| } |
| } |
| ver := rec.Pin |