Fixed percentage behavior in instr

fixed syntax, wrote a test

fixed a test

.

1

Update staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go

Co-Authored-By: Joel Speed <Joel.speed@hotmail.co.uk>

added test

.

fix

fix test

fixed a test

gofmt

lint

fix

function name

validation fix

.

godocs added

.
This commit is contained in:
Renato Viana
2020-03-22 23:41:45 +00:00
parent 4db3a096ce
commit 316eff8dee
10 changed files with 143 additions and 16 deletions

View File

@@ -415,7 +415,7 @@ func (dsc *DaemonSetsController) getUnavailableNumbers(ds *apps.DaemonSet, nodeL
numUnavailable++
}
}
maxUnavailable, err := intstrutil.GetValueFromIntOrPercent(ds.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable, desiredNumberScheduled, true)
maxUnavailable, err := intstrutil.GetScaledValueFromIntOrPercent(ds.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable, desiredNumberScheduled, true)
if err != nil {
return -1, -1, fmt.Errorf("invalid value for MaxUnavailable: %v", err)
}