mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Update tests to handle codec changes
This commit is contained in:
@@ -87,8 +87,7 @@ func TestCreateFromConfig(t *testing.T) {
|
||||
{"name" : "PriorityOne", "weight" : 2},
|
||||
{"name" : "PriorityTwo", "weight" : 1} ]
|
||||
}`)
|
||||
err := latestschedulerapi.Codec.DecodeInto(configData, &policy)
|
||||
if err != nil {
|
||||
if err := runtime.DecodeInto(latestschedulerapi.Codec, configData, &policy); err != nil {
|
||||
t.Errorf("Invalid configuration: %v", err)
|
||||
}
|
||||
|
||||
@@ -111,8 +110,7 @@ func TestCreateFromEmptyConfig(t *testing.T) {
|
||||
factory := NewConfigFactory(client, api.DefaultSchedulerName)
|
||||
|
||||
configData = []byte(`{}`)
|
||||
err := latestschedulerapi.Codec.DecodeInto(configData, &policy)
|
||||
if err != nil {
|
||||
if err := runtime.DecodeInto(latestschedulerapi.Codec, configData, &policy); err != nil {
|
||||
t.Errorf("Invalid configuration: %v", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user