summaryrefslogtreecommitdiff
path: root/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go')
-rw-r--r--vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
index fe510ed9e..4a1d89cfc 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
@@ -153,6 +153,16 @@ func (t Time) MarshalJSON() ([]byte, error) {
return buf, nil
}
+// ToUnstructured implements the value.UnstructuredConverter interface.
+func (t Time) ToUnstructured() interface{} {
+ if t.IsZero() {
+ return nil
+ }
+ buf := make([]byte, 0, len(time.RFC3339))
+ buf = t.UTC().AppendFormat(buf, time.RFC3339)
+ return string(buf)
+}
+
// OpenAPISchemaType is used by the kube-openapi generator when constructing
// the OpenAPI spec of this type.
//