Unistore: Add validation for resource names (#110990)
* Unistore: Add validation for resource names Signed-off-by: Maicon Costa <maiconscosta@gmail.com> --------- Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
This commit is contained in:
@@ -684,7 +684,7 @@ func RunTestClusterScopedWatch(ctx context.Context, t *testing.T, store storage.
|
||||
currentObjs := map[string]*example.Pod{}
|
||||
for _, watchTest := range tt.watchTests {
|
||||
out := &example.Pod{}
|
||||
key := "pods/" + watchTest.obj.Name
|
||||
key := "pods/ns-1/" + watchTest.obj.Name
|
||||
err := store.GuaranteedUpdate(ctx, key, out, true, nil, storage.SimpleUpdate(
|
||||
func(runtime.Object) (runtime.Object, error) {
|
||||
obj := watchTest.obj.DeepCopy()
|
||||
@@ -1607,15 +1607,15 @@ func clusterScopedNodeNameAttrFunc(obj runtime.Object) (labels.Set, fields.Set,
|
||||
}
|
||||
|
||||
func basePod(podName string) *example.Pod {
|
||||
return baseNamespacedPod(podName, "")
|
||||
return baseNamespacedPod(podName, "ns-1")
|
||||
}
|
||||
|
||||
func basePodUpdated(podName string) *example.Pod {
|
||||
return baseNamespacedPodUpdated(podName, "")
|
||||
return baseNamespacedPodUpdated(podName, "ns-1")
|
||||
}
|
||||
|
||||
func basePodAssigned(podName, nodeName string) *example.Pod {
|
||||
return baseNamespacedPodAssigned(podName, "", nodeName)
|
||||
return baseNamespacedPodAssigned(podName, "ns-1", nodeName)
|
||||
}
|
||||
|
||||
func baseNamespacedPod(podName, namespace string) *example.Pod {
|
||||
|
||||
Reference in New Issue
Block a user