summaryrefslogtreecommitdiff
path: root/vendor/k8s.io/apimachinery/pkg/api
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/k8s.io/apimachinery/pkg/api')
-rw-r--r--vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go b/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
index 8d718945d..2395656cc 100644
--- a/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
+++ b/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
@@ -696,6 +696,15 @@ func (q *Quantity) UnmarshalJSON(value []byte) error {
return nil
}
+// NewDecimalQuantity returns a new Quantity representing the given
+// value in the given format.
+func NewDecimalQuantity(b inf.Dec, format Format) *Quantity {
+ return &Quantity{
+ d: infDecAmount{&b},
+ Format: format,
+ }
+}
+
// NewQuantity returns a new Quantity representing the given
// value in the given format.
func NewQuantity(value int64, format Format) *Quantity {