Revert "Revert "Unistore: Add validation for resource names"" (#111648)

* Revert "Revert "Unistore: Add validation for resource names" (#111408)"

This reverts commit b3ed600bca.


---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
This commit is contained in:
maicon
2025-09-28 20:53:07 +03:00
committed by GitHub
parent e34475041a
commit 2e734549b5
7 changed files with 409 additions and 5 deletions
@@ -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 {