@@ -792,6 +792,8 @@ func TestSyncerProcessingSingleResourceWithoutStatus(t *testing.T) {
792792 },
793793 }
794794
795+ const stateNamespace = "kcp-system"
796+
795797 for _ , testcase := range testcases {
796798 t .Run (testcase .name , func (t * testing.T ) {
797799 localClient := buildFakeClient (testcase .localObject )
@@ -806,6 +808,7 @@ func TestSyncerProcessingSingleResourceWithoutStatus(t *testing.T) {
806808 testcase .localCRD ,
807809 testcase .remoteAPIGroup ,
808810 nil ,
811+ stateNamespace ,
809812 )
810813 if err != nil {
811814 t .Fatalf ("Failed to create syncer: %v" , err )
@@ -820,7 +823,7 @@ func TestSyncerProcessingSingleResourceWithoutStatus(t *testing.T) {
820823 syncer .newObjectStateStore = func (primaryObject , stateCluster syncSide ) ObjectStateStore {
821824 // .Process() is called multiple times, but we want the state to persist between reconciles.
822825 if backend == nil {
823- backend = newKubernetesBackend (primaryObject , stateCluster )
826+ backend = newKubernetesBackend (stateNamespace , primaryObject , stateCluster )
824827 if testcase .existingState != "" {
825828 if err := backend .Put (testcase .remoteObject , clusterName .String (), []byte (testcase .existingState )); err != nil {
826829 t .Fatalf ("Failed to prime state store: %v" , err )
@@ -1086,6 +1089,8 @@ func TestSyncerProcessingSingleResourceWithStatus(t *testing.T) {
10861089 },
10871090 }
10881091
1092+ const stateNamespace = "kcp-system"
1093+
10891094 for _ , testcase := range testcases {
10901095 t .Run (testcase .name , func (t * testing.T ) {
10911096 localClient := buildFakeClientWithStatus (testcase .localObject )
@@ -1100,6 +1105,7 @@ func TestSyncerProcessingSingleResourceWithStatus(t *testing.T) {
11001105 testcase .localCRD ,
11011106 testcase .remoteAPIGroup ,
11021107 nil ,
1108+ stateNamespace ,
11031109 )
11041110 if err != nil {
11051111 t .Fatalf ("Failed to create syncer: %v" , err )
@@ -1114,7 +1120,7 @@ func TestSyncerProcessingSingleResourceWithStatus(t *testing.T) {
11141120 syncer .newObjectStateStore = func (primaryObject , stateCluster syncSide ) ObjectStateStore {
11151121 // .Process() is called multiple times, but we want the state to persist between reconciles.
11161122 if backend == nil {
1117- backend = newKubernetesBackend (primaryObject , stateCluster )
1123+ backend = newKubernetesBackend (stateNamespace , primaryObject , stateCluster )
11181124 if testcase .existingState != "" {
11191125 if err := backend .Put (testcase .remoteObject , clusterName .String (), []byte (testcase .existingState )); err != nil {
11201126 t .Fatalf ("Failed to prime state store: %v" , err )
0 commit comments