func TestPodLogValidates(t *testing.T) { etcdStorage, _ := registrytest.NewEtcdStorage(t, "") storage := NewStorage(etcdStorage, false, nil, nil) negativeOne := int64(-1) testCases := []*api.PodLogOptions{ {SinceSeconds: &negativeOne}, {TailLines: &negativeOne}, } for _, tc := range testCases { _, err := storage.Log.Get(api.NewDefaultContext(), "test", tc) if !errors.IsInvalid(err) { t.Fatalf("unexpected error: %v", err) } } }
func newStorage(t *testing.T) (*tools.FakeEtcdClient, ipallocator.Interface, allocator.Interface) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "") _, cidr, err := net.ParseCIDR("192.168.1.0/24") if err != nil { t.Fatal(err) } var backing allocator.Interface storage := ipallocator.NewAllocatorCIDRRange(cidr, func(max int, rangeSpec string) allocator.Interface { mem := allocator.NewAllocationMap(max, rangeSpec) backing = mem etcd := allocator_etcd.NewEtcd(mem, "/ranges/serviceips", "serviceipallocation", etcdStorage) return etcd }) return fakeClient, storage, backing }
func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "extensions") return NewREST(etcdStorage), fakeClient }
func newStorage(t *testing.T) (*DeploymentStorage, *tools.FakeEtcdClient) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "extensions") deploymentStorage := NewStorage(etcdStorage) return &deploymentStorage, fakeClient }
func newStorage(t *testing.T) (*REST, *StatusREST, *tools.FakeEtcdClient) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "extensions") storage, statusStorage := NewREST(etcdStorage) return storage, statusStorage, fakeClient }
func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "") fakeClient.HideExpires = true return NewREST(etcdStorage, testTTL), fakeClient }
func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "") storage, _ := NewREST(etcdStorage, false, fakeConnectionInfoGetter{}, nil) return storage, fakeClient }
func newStorage(t *testing.T) (*REST, *BindingREST, *StatusREST, *tools.FakeEtcdClient) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "") storage := NewStorage(etcdStorage, false, nil, nil) return storage.Pod, storage.Binding, storage.Status, fakeClient }
func newStorage(t *testing.T) (*Etcd, *tools.FakeEtcdClient, allocator.Interface) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "") mem := allocator.NewAllocationMap(100, "rangeSpecValue") etcd := NewEtcd(mem, "/ranges/serviceips", "serviceipallocation", etcdStorage) return etcd, fakeClient, mem }
func newStorage(t *testing.T) (*ScaleREST, *tools.FakeEtcdClient) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "") return NewStorage(etcdStorage).Scale, fakeClient }
func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) { etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "") storage, _, _ := NewREST(etcdStorage) return storage, fakeClient }