summaryrefslogtreecommitdiff
path: root/vendor/k8s.io/apimachinery/pkg/runtime/extension.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/k8s.io/apimachinery/pkg/runtime/extension.go')
-rw-r--r--vendor/k8s.io/apimachinery/pkg/runtime/extension.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/extension.go b/vendor/k8s.io/apimachinery/pkg/runtime/extension.go
index 4d23ee9ee..737e2e9ff 100644
--- a/vendor/k8s.io/apimachinery/pkg/runtime/extension.go
+++ b/vendor/k8s.io/apimachinery/pkg/runtime/extension.go
@@ -17,6 +17,7 @@ limitations under the License.
package runtime
import (
+ "bytes"
"encoding/json"
"errors"
)
@@ -25,7 +26,9 @@ func (re *RawExtension) UnmarshalJSON(in []byte) error {
if re == nil {
return errors.New("runtime.RawExtension: UnmarshalJSON on nil pointer")
}
- re.Raw = append(re.Raw[0:0], in...)
+ if !bytes.Equal(in, []byte("null")) {
+ re.Raw = append(re.Raw[0:0], in...)
+ }
return nil
}