Merge pull request #12005 from JanetKuo/kubectl-describe-allocatedresource
Make kubectl describe node include allocated resource
This commit is contained in:
@@ -301,6 +301,14 @@ func (q *Quantity) String() string {
|
||||
return number + string(suffix)
|
||||
}
|
||||
|
||||
func (q *Quantity) Add(y Quantity) error {
|
||||
if q.Format != y.Format {
|
||||
return fmt.Errorf("format mismatch: %v vs. %v", q.Format, y.Format)
|
||||
}
|
||||
q.Amount.Add(q.Amount, y.Amount)
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface.
|
||||
func (q Quantity) MarshalJSON() ([]byte, error) {
|
||||
return []byte(`"` + q.String() + `"`), nil
|
||||
|
Reference in New Issue
Block a user