Use generated DeepCopy methods.

This commit is contained in:
Wojciech Tyczynski
2015-05-13 15:52:53 +02:00
parent b7b89c4734
commit 33318f0162
10 changed files with 36 additions and 131 deletions

View File

@@ -27,6 +27,11 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
// TODO(wojtek-t): As suggested in #8320, we should consider the strategy
// to first do the shallow copy and then recurse into things that need a
// deep copy (maps, pointers, slices). That sort of copy function would
// need one parameter - a pointer to the thing it's supposed to expand,
// and it would involve a lot less memory copying.
type DeepCopyGenerator interface {
// Adds a type to a generator.
// If the type is non-struct, it will return an error, otherwise deep-copy

View File

@@ -21,7 +21,7 @@ import (
"reflect"
"testing"
"github.com/GoogleCloudPlatform/kubernetes/pkg/conversion"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
@@ -224,7 +224,7 @@ func TestDeepCopyOfEmbeddedObject(t *testing.T) {
}
t.Logf("originalRole = %v\n", string(originalData))
copyOfOriginal, err := conversion.DeepCopy(original)
copyOfOriginal, err := api.Scheme.DeepCopy(original)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}