fix multiple typos

This commit is contained in:
ml 2021-09-28 02:24:43 +02:00
parent adff4a75ad
commit a2441a256b
3 changed files with 10 additions and 10 deletions

View File

@ -185,7 +185,7 @@ func newDeploymentWithSelectorLabels(selectorLabels map[string]string) *apps.Dep
} }
} }
func newDeploymentWithHugePageValue(reousreceName api.ResourceName, value resource.Quantity) *apps.Deployment { func newDeploymentWithHugePageValue(resourceName api.ResourceName, value resource.Quantity) *apps.Deployment {
return &apps.Deployment{ return &apps.Deployment{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: deploymentName, Name: deploymentName,
@ -221,11 +221,11 @@ func newDeploymentWithHugePageValue(reousreceName api.ResourceName, value resour
Resources: api.ResourceRequirements{ Resources: api.ResourceRequirements{
Requests: api.ResourceList{ Requests: api.ResourceList{
api.ResourceName(api.ResourceCPU): resource.MustParse("10"), api.ResourceName(api.ResourceCPU): resource.MustParse("10"),
api.ResourceName(reousreceName): value, api.ResourceName(resourceName): value,
}, },
Limits: api.ResourceList{ Limits: api.ResourceList{
api.ResourceName(api.ResourceCPU): resource.MustParse("10"), api.ResourceName(api.ResourceCPU): resource.MustParse("10"),
api.ResourceName(reousreceName): value, api.ResourceName(resourceName): value,
}, },
}}, }},
}}, }},

View File

@ -1133,7 +1133,7 @@ func TestApplySeccompVersionSkew(t *testing.T) {
} }
} }
func newPodtWithHugePageValue(reousreceName api.ResourceName, value resource.Quantity) *api.Pod { func newPodWithHugePageValue(resourceName api.ResourceName, value resource.Quantity) *api.Pod {
return &api.Pod{ return &api.Pod{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Namespace: "default", Namespace: "default",
@ -1151,11 +1151,11 @@ func newPodtWithHugePageValue(reousreceName api.ResourceName, value resource.Qua
Resources: api.ResourceRequirements{ Resources: api.ResourceRequirements{
Requests: api.ResourceList{ Requests: api.ResourceList{
api.ResourceCPU: resource.MustParse("10"), api.ResourceCPU: resource.MustParse("10"),
reousreceName: value, resourceName: value,
}, },
Limits: api.ResourceList{ Limits: api.ResourceList{
api.ResourceCPU: resource.MustParse("10"), api.ResourceCPU: resource.MustParse("10"),
reousreceName: value, resourceName: value,
}, },
}}, }},
}, },
@ -1171,7 +1171,7 @@ func TestPodStrategyValidate(t *testing.T) {
}{ }{
{ {
name: "a new pod setting container with indivisible hugepages values", name: "a new pod setting container with indivisible hugepages values",
pod: newPodtWithHugePageValue(api.ResourceHugePagesPrefix+"1Mi", resource.MustParse("1.1Mi")), pod: newPodWithHugePageValue(api.ResourceHugePagesPrefix+"1Mi", resource.MustParse("1.1Mi")),
}, },
{ {
name: "a new pod setting init-container with indivisible hugepages values", name: "a new pod setting init-container with indivisible hugepages values",
@ -1303,8 +1303,8 @@ func TestPodStrategyValidateUpdate(t *testing.T) {
}{ }{
{ {
name: "an existing pod with indivisible hugepages values to a new pod with indivisible hugepages values", name: "an existing pod with indivisible hugepages values to a new pod with indivisible hugepages values",
newPod: newPodtWithHugePageValue(api.ResourceHugePagesPrefix+"2Mi", resource.MustParse("2.1Mi")), newPod: newPodWithHugePageValue(api.ResourceHugePagesPrefix+"2Mi", resource.MustParse("2.1Mi")),
oldPod: newPodtWithHugePageValue(api.ResourceHugePagesPrefix+"2Mi", resource.MustParse("2.1Mi")), oldPod: newPodWithHugePageValue(api.ResourceHugePagesPrefix+"2Mi", resource.MustParse("2.1Mi")),
}, },
} }

View File

@ -30,7 +30,7 @@ func validateBandwidthIsReasonable(rsrc *resource.Quantity) error {
return fmt.Errorf("resource is unreasonably small (< 1kbit)") return fmt.Errorf("resource is unreasonably small (< 1kbit)")
} }
if rsrc.Value() > maxRsrc.Value() { if rsrc.Value() > maxRsrc.Value() {
return fmt.Errorf("resoruce is unreasonably large (> 1Pbit)") return fmt.Errorf("resource is unreasonably large (> 1Pbit)")
} }
return nil return nil
} }