File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ func (s *Stagger) ID() string {
7272// Check asserts that since the last successful check is a certain time has passed.
7373func (s * Stagger ) Check (params plugin.Parameters ) (plugin.CheckResult , error ) {
7474 s .grabIndex = noGrab
75- availableIn := make ([]time. Duration , 0 )
75+ availableIn := make ([]float64 , 0 )
7676 for i := range s .Parallel {
7777 lease , err := s .getOrCreateLease (i , & params )
7878 if err != nil {
@@ -83,9 +83,10 @@ func (s *Stagger) Check(params plugin.Parameters) (plugin.CheckResult, error) {
8383 s .grabIndex = i
8484 return plugin .Passed (nil ), nil
8585 }
86- availableIn = append (availableIn , leaseDuration - time .Since (lease .Spec .RenewTime .Time ))
86+ remaining := leaseDuration - time .Since (lease .Spec .RenewTime .Time )
87+ availableIn = append (availableIn , remaining .Seconds ())
8788 }
88- return plugin .Failed (map [string ]any {"availableIn " : availableIn }), nil
89+ return plugin .Failed (map [string ]any {"availableInSec " : availableIn }), nil
8990}
9091
9192func (s * Stagger ) getOrCreateLease (idx int , params * plugin.Parameters ) (coordinationv1.Lease , error ) {
You can’t perform that action at this time.
0 commit comments