mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Use correct namespace in unit tests that use fake clientset
Fake clientset no longer needs to be prepopulated with records: keeping them in leads to the name conflict on creates. Also, since fake clientset now respects namespaces, we need to correctly populate them.
This commit is contained in:
@@ -228,7 +228,7 @@ func TestPlugin(t *testing.T) {
|
||||
t.Errorf("Can't find the plugin by name")
|
||||
}
|
||||
|
||||
pod := &api.Pod{ObjectMeta: api.ObjectMeta{UID: testPodUID}}
|
||||
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Namespace: testNamespace, UID: testPodUID}}
|
||||
mounter, err := plugin.NewMounter(volume.NewSpecFromVolume(volumeSpec), pod, volume.VolumeOptions{})
|
||||
if err != nil {
|
||||
t.Errorf("Failed to make a new Mounter: %v", err)
|
||||
@@ -283,7 +283,7 @@ func TestPluginReboot(t *testing.T) {
|
||||
t.Errorf("Can't find the plugin by name")
|
||||
}
|
||||
|
||||
pod := &api.Pod{ObjectMeta: api.ObjectMeta{UID: testPodUID}}
|
||||
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Namespace: testNamespace, UID: testPodUID}}
|
||||
mounter, err := plugin.NewMounter(volume.NewSpecFromVolume(volumeSpec), pod, volume.VolumeOptions{})
|
||||
if err != nil {
|
||||
t.Errorf("Failed to make a new Mounter: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user