File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,13 @@ import (
1010 "github.com/grafana/loki/v3/pkg/util"
1111)
1212
13+ // PrepareDownscaleHandler is a special handler called by the rollout operator
14+ // immediately before the pod is downscaled. It can stop a downscale by
15+ // responding with a non 2xx status code.
16+ func (s * Service ) PrepareDownscaleHandler (_ http.ResponseWriter , _ * http.Request ) {
17+ s .partitionInstanceLifecycler .SetRemoveOwnerOnShutdown (true )
18+ }
19+
1320// PrepareDelayedDownscaleHandler is a special handler called by the rollout
1421// operator to prepare for a delayed downscale. This allows the service to
1522// perform any number of actions in preparation of being scaled down at the
Original file line number Diff line number Diff line change @@ -2404,7 +2404,11 @@ func (t *Loki) initDataObjConsumer() (services.Service, error) {
24042404 serverutil .RecoveryHTTPMiddleware ,
24052405 )
24062406 t .Server .HTTP .
2407- Methods (http .MethodGet , http .MethodPost , http .MethoDelete ).
2407+ Methods (http .MethodGet , http .MethodPost , http .MethodDelete ).
2408+ Path ("/dataobj-consumer/prepare-downscale" ).
2409+ Handler (httpMiddleware .Wrap (http .HandlerFunc (t .dataObjConsumer .PrepareDownscaleHandler )))
2410+ t .Server .HTTP .
2411+ Methods (http .MethodGet , http .MethodPost , http .MethodDelete ).
24082412 Path ("/dataobj-consumer/prepare-delayed-downscale" ).
24092413 Handler (httpMiddleware .Wrap (http .HandlerFunc (t .dataObjConsumer .PrepareDelayedDownscaleHandler )))
24102414
You can’t perform that action at this time.
0 commit comments