This is an automated email from the ASF dual-hosted git repository.
chenyulin0719 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git
The following commit(s) were added to refs/heads/master by this push:
new ff654b2d [YUNIKORN-2572] remove un-used conditional (#850)
ff654b2d is described below
commit ff654b2dd9038c1b026d99e553f79cd32e3d4de7
Author: Ryan <[email protected]>
AuthorDate: Sun Apr 21 08:58:46 2024 +0000
[YUNIKORN-2572] remove un-used conditional (#850)
Closes: #850
Signed-off-by: Yu-Lin Chen <[email protected]>
---
pkg/common/resources/resources.go | 3 ---
pkg/common/resources/resources_test.go | 1 +
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/pkg/common/resources/resources.go
b/pkg/common/resources/resources.go
index 9aacdbbb..01967a43 100644
--- a/pkg/common/resources/resources.go
+++ b/pkg/common/resources/resources.go
@@ -95,9 +95,6 @@ func NewResourceFromConf(configMap map[string]string)
(*Resource, error) {
if err != nil {
return nil, err
}
- if intValue < 0 {
- return nil, fmt.Errorf("negative resources not
permitted: %v", configMap)
- }
res.Resources[key] = intValue
}
return res, nil
diff --git a/pkg/common/resources/resources_test.go
b/pkg/common/resources/resources_test.go
index 3917dd6f..00076d54 100644
--- a/pkg/common/resources/resources_test.go
+++ b/pkg/common/resources/resources_test.go
@@ -119,6 +119,7 @@ func TestNewResourceFromConf(t *testing.T) {
{"vcore multipliers with \"m\"", map[string]string{"vcore":
"10m"}, expectedvalues{true, 1, "map[vcore:10]"}},
{"failure case: parse error", map[string]string{"fail": "xx"},
expectedvalues{false, 0, ""}},
{"negative resource", map[string]string{"memory": "-15"},
expectedvalues{false, 0, ""}},
+ {"nagative resource for vcore", map[string]string{"vcore":
"-15"}, expectedvalues{false, 0, ""}},
{"\"milli\" used for anything other than vcore",
map[string]string{"memory": "10m"}, expectedvalues{false, 0, ""}},
}
for _, tt := range tests {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]