mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Tolerate YAML and JSON numbers
Both YAML and JSON can contain numbers
This commit is contained in:
@@ -626,10 +626,7 @@ func (q *Quantity) UnmarshalJSON(value []byte) error {
|
||||
q.i = int64Amount{}
|
||||
return nil
|
||||
}
|
||||
if l < 2 {
|
||||
return ErrFormatWrong
|
||||
}
|
||||
if value[0] == '"' && value[l-1] == '"' {
|
||||
if l >= 2 && value[0] == '"' && value[l-1] == '"' {
|
||||
value = value[1 : l-1]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user