Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry: use new intstr functions #117629

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/registry/apps/deployment/storage/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func validNewDeployment() *apps.Deployment {
Strategy: apps.DeploymentStrategy{
Type: apps.RollingUpdateDeploymentStrategyType,
RollingUpdate: &apps.RollingUpdateDeployment{
MaxSurge: intstr.FromInt(1),
MaxUnavailable: intstr.FromInt(1),
MaxSurge: intstr.FromInt32(1),
MaxUnavailable: intstr.FromInt32(1),
},
},
Template: api.PodTemplateSpec{
Expand Down
8 changes: 4 additions & 4 deletions pkg/registry/apps/deployment/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ func newDeploymentWithSelectorLabels(selectorLabels map[string]string) *apps.Dep
Strategy: apps.DeploymentStrategy{
Type: apps.RollingUpdateDeploymentStrategyType,
RollingUpdate: &apps.RollingUpdateDeployment{
MaxSurge: intstr.FromInt(1),
MaxUnavailable: intstr.FromInt(1),
MaxSurge: intstr.FromInt32(1),
MaxUnavailable: intstr.FromInt32(1),
},
},
Template: api.PodTemplateSpec{
Expand Down Expand Up @@ -200,8 +200,8 @@ func newDeploymentWithHugePageValue(resourceName api.ResourceName, value resourc
Strategy: apps.DeploymentStrategy{
Type: apps.RollingUpdateDeploymentStrategyType,
RollingUpdate: &apps.RollingUpdateDeployment{
MaxSurge: intstr.FromInt(1),
MaxUnavailable: intstr.FromInt(1),
MaxSurge: intstr.FromInt32(1),
MaxUnavailable: intstr.FromInt32(1),
},
},
Template: api.PodTemplateSpec{
Expand Down
218 changes: 109 additions & 109 deletions pkg/registry/core/service/storage/storage_test.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/registry/core/service/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func makeValidServicePort(name string, proto api.Protocol, port int32) api.Servi
Name: name,
Protocol: proto,
Port: port,
TargetPort: intstr.FromInt(int(port)),
TargetPort: intstr.FromInt32(port),
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/networking/ingress/storage/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
name = "foo-ingress"
defaultHostname = "foo.bar.com"
defaultBackendName = "default-backend"
defaultBackendPort = intstr.FromInt(80)
defaultBackendPort = intstr.FromInt32(80)
defaultLoadBalancer = "127.0.0.1"
defaultPath = "/foo"
defaultPathType = networking.PathTypeImplementationSpecific
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func newStorage(t *testing.T) (*REST, *StatusREST, *etcd3testing.EtcdTestServer)
}

func validNewPodDisruptionBudget() *policy.PodDisruptionBudget {
minAvailable := intstr.FromInt(7)
minAvailable := intstr.FromInt32(7)
return &policy.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Expand Down Expand Up @@ -91,7 +91,7 @@ func TestStatusUpdate(t *testing.T) {
}
obtainedPdb := obj.(*policy.PodDisruptionBudget)

minAvailable := intstr.FromInt(8)
minAvailable := intstr.FromInt32(8)
update := policy.PodDisruptionBudget{
ObjectMeta: obtainedPdb.ObjectMeta,
Spec: policy.PodDisruptionBudgetSpec{
Expand Down
12 changes: 6 additions & 6 deletions pkg/registry/policy/poddisruptionbudget/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func testPodDisruptionBudgetStrategyWithUnhealthyPodEvictionPolicy(t *testing.T,
}

validSelector := map[string]string{"a": "b"}
minAvailable := intstr.FromInt(3)
minAvailable := intstr.FromInt32(3)
pdb := &policy.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: policy.PodDisruptionBudgetSpec{
Expand Down Expand Up @@ -196,7 +196,7 @@ func testPodDisruptionBudgetStrategy(t *testing.T) {
}

validSelector := map[string]string{"a": "b"}
minAvailable := intstr.FromInt(3)
minAvailable := intstr.FromInt32(3)
pdb := &policy.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: policy.PodDisruptionBudgetSpec{
Expand Down Expand Up @@ -267,8 +267,8 @@ func TestPodDisruptionBudgetStatusStrategy(t *testing.T) {
t.Errorf("PodDisruptionBudgetStatus should not allow create on update")
}

oldMinAvailable := intstr.FromInt(3)
newMinAvailable := intstr.FromInt(2)
oldMinAvailable := intstr.FromInt32(3)
newMinAvailable := intstr.FromInt32(2)

validSelector := map[string]string{"a": "b"}
oldPdb := &policy.PodDisruptionBudget{
Expand Down Expand Up @@ -337,8 +337,8 @@ func TestPodDisruptionBudgetStatusValidationByApiVersion(t *testing.T) {
APIVersion: tc.apiVersion,
})

oldMaxUnavailable := intstr.FromInt(2)
newMaxUnavailable := intstr.FromInt(3)
oldMaxUnavailable := intstr.FromInt32(2)
newMaxUnavailable := intstr.FromInt32(3)
oldPdb := &policy.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault, ResourceVersion: "10"},
Spec: policy.PodDisruptionBudgetSpec{
Expand Down