[ 
https://issues.apache.org/jira/browse/YUNIKORN-2572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hsien-Cheng(Ryan) Huang updated YUNIKORN-2572:
----------------------------------------------
    Description: 
look into this [conditional:|#L98]
{code:go}
if intValue < 0 {
            return nil, fmt.Errorf("negative resources not permitted: %v", 
configMap)
}
{code}
This will never be used because regrex defined 
[here|https://github.com/apache/yunikorn-core/blob/55e9fe650760bdf30d27a7ecf85b34d5f96c492f/pkg/common/resources/quantity.go#L38].
 not including "-" as a starting char

Thus, it will never omit error about negative resource, instead it will raise 
invalid quantity error at 
[https://github.com/apache/yunikorn-core/blob/55e9fe650760bdf30d27a7ecf85b34d5f96c492f/pkg/common/resources/quantity.go#L74]
 .

  was:
look into this [conditional:|#L98]
{code:go}
// Some comments here
if intValue < 0 {
            return nil, fmt.Errorf("negative resources not permitted: %v", 
configMap)
}
{code}
This will never be used because regrex defined 
[here|https://github.com/apache/yunikorn-core/blob/55e9fe650760bdf30d27a7ecf85b34d5f96c492f/pkg/common/resources/quantity.go#L38].
 not including "-" as a starting char

Thus, it will never omit error about negative resource, instead it will raise 
invalid quantity error at 
[https://github.com/apache/yunikorn-core/blob/55e9fe650760bdf30d27a7ecf85b34d5f96c492f/pkg/common/resources/quantity.go#L74]
 .


> remove un-used conditional
> --------------------------
>
>                 Key: YUNIKORN-2572
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-2572
>             Project: Apache YuniKorn
>          Issue Type: Improvement
>          Components: core - common
>            Reporter: Hsien-Cheng(Ryan) Huang
>            Assignee: Hsien-Cheng(Ryan) Huang
>            Priority: Minor
>             Fix For: 1.5.0
>
>
> look into this [conditional:|#L98]
> {code:go}
> if intValue < 0 {
>             return nil, fmt.Errorf("negative resources not permitted: %v", 
> configMap)
> }
> {code}
> This will never be used because regrex defined 
> [here|https://github.com/apache/yunikorn-core/blob/55e9fe650760bdf30d27a7ecf85b34d5f96c492f/pkg/common/resources/quantity.go#L38].
>  not including "-" as a starting char
> Thus, it will never omit error about negative resource, instead it will raise 
> invalid quantity error at 
> [https://github.com/apache/yunikorn-core/blob/55e9fe650760bdf30d27a7ecf85b34d5f96c492f/pkg/common/resources/quantity.go#L74]
>  .



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: issues-h...@yunikorn.apache.org

Reply via email to