mirror of
https://github.com/kubernetes/kubectl.git
synced 2026-05-28 04:35:50 -04:00
Merge pull request #89482 from renatoviana12/master
fixed percentage behaviour in instr Kubernetes-commit: 1a66eb7b8aba8d5e66d855d6b8b31fdeab648778
This commit is contained in:
commit
2f48c65137
4 changed files with 14 additions and 14 deletions
6
Godeps/Godeps.json
generated
6
Godeps/Godeps.json
generated
|
|
@ -760,11 +760,11 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api",
|
||||
"Rev": "18112a7b933b"
|
||||
"Rev": "2c3c141c931c"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery",
|
||||
"Rev": "10b38829b621"
|
||||
"Rev": "d4f471b82f0a"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/cli-runtime",
|
||||
|
|
@ -772,7 +772,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/client-go",
|
||||
"Rev": "758467711e07"
|
||||
"Rev": "becbabb36002"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/code-generator",
|
||||
|
|
|
|||
12
go.mod
12
go.mod
|
|
@ -34,10 +34,10 @@ require (
|
|||
github.com/stretchr/testify v1.4.0
|
||||
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4
|
||||
gopkg.in/yaml.v2 v2.2.8
|
||||
k8s.io/api v0.0.0-20201003235837-18112a7b933b
|
||||
k8s.io/apimachinery v0.0.0-20201003235655-10b38829b621
|
||||
k8s.io/api v0.0.0-20201005155906-2c3c141c931c
|
||||
k8s.io/apimachinery v0.0.0-20201006035708-d4f471b82f0a
|
||||
k8s.io/cli-runtime v0.0.0-20201004001941-bc95ff91653e
|
||||
k8s.io/client-go v0.0.0-20201004000108-758467711e07
|
||||
k8s.io/client-go v0.0.0-20201004200234-becbabb36002
|
||||
k8s.io/component-base v0.0.0-20201004000625-609bde980a40
|
||||
k8s.io/klog/v2 v2.2.0
|
||||
k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488
|
||||
|
|
@ -48,10 +48,10 @@ require (
|
|||
)
|
||||
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.0.0-20201003235837-18112a7b933b
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20201003235655-10b38829b621
|
||||
k8s.io/api => k8s.io/api v0.0.0-20201005155906-2c3c141c931c
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20201006035708-d4f471b82f0a
|
||||
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20201004001941-bc95ff91653e
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20201004000108-758467711e07
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20201004200234-becbabb36002
|
||||
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20201003235514-f6667ec3dafb
|
||||
k8s.io/component-base => k8s.io/component-base v0.0.0-20201004000625-609bde980a40
|
||||
k8s.io/metrics => k8s.io/metrics v0.0.0-20201004001828-029a41d5e49d
|
||||
|
|
|
|||
6
go.sum
6
go.sum
|
|
@ -503,10 +503,10 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh
|
|||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
k8s.io/api v0.0.0-20201003235837-18112a7b933b/go.mod h1:aE9OxkIvJAf55JfJy/0UlrF0nZT2ZDhmsWnNzhbAySI=
|
||||
k8s.io/apimachinery v0.0.0-20201003235655-10b38829b621/go.mod h1:6s3VNb000AUbBIxR7q3WHlbBwfpEGqIJsCG5gIX+0LI=
|
||||
k8s.io/api v0.0.0-20201005155906-2c3c141c931c/go.mod h1:aE9OxkIvJAf55JfJy/0UlrF0nZT2ZDhmsWnNzhbAySI=
|
||||
k8s.io/apimachinery v0.0.0-20201006035708-d4f471b82f0a/go.mod h1:6s3VNb000AUbBIxR7q3WHlbBwfpEGqIJsCG5gIX+0LI=
|
||||
k8s.io/cli-runtime v0.0.0-20201004001941-bc95ff91653e/go.mod h1:6TfA4NjrL55kCpvC1ctcwvJx1NpamdfUqvfWrOr9ETc=
|
||||
k8s.io/client-go v0.0.0-20201004000108-758467711e07/go.mod h1:zltjMDhkwCKG2AvwcACaWC+fwiTEB0qElpbFMvxx+/g=
|
||||
k8s.io/client-go v0.0.0-20201004200234-becbabb36002/go.mod h1:zltjMDhkwCKG2AvwcACaWC+fwiTEB0qElpbFMvxx+/g=
|
||||
k8s.io/code-generator v0.0.0-20201003235514-f6667ec3dafb/go.mod h1:oioc17TXBB973K4R+ytm5k9jY1BktboxJc7qu3i29V0=
|
||||
k8s.io/component-base v0.0.0-20201004000625-609bde980a40/go.mod h1:WUOeHeahPXuwTMTTZxsAJUyXuIRVbvgNTCVvlzwewJU=
|
||||
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||
|
|
|
|||
|
|
@ -208,11 +208,11 @@ func findOldReplicaSets(deployment *appsv1.Deployment, rsList []*appsv1.ReplicaS
|
|||
// 2 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1), then new(+1), then old(-1)
|
||||
// 1 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1)
|
||||
func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error) {
|
||||
surge, err := intstrutil.GetValueFromIntOrPercent(intstrutil.ValueOrDefault(maxSurge, intstrutil.FromInt(0)), int(desired), true)
|
||||
surge, err := intstrutil.GetScaledValueFromIntOrPercent(intstrutil.ValueOrDefault(maxSurge, intstrutil.FromInt(0)), int(desired), true)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
unavailable, err := intstrutil.GetValueFromIntOrPercent(intstrutil.ValueOrDefault(maxUnavailable, intstrutil.FromInt(0)), int(desired), false)
|
||||
unavailable, err := intstrutil.GetScaledValueFromIntOrPercent(intstrutil.ValueOrDefault(maxUnavailable, intstrutil.FromInt(0)), int(desired), false)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue