@@ -792,6 +792,8 @@ func TestSyncerProcessingSingleResourceWithoutStatus(t *testing.T) {
792
792
},
793
793
}
794
794
795
+ const stateNamespace = "kcp-system"
796
+
795
797
for _ , testcase := range testcases {
796
798
t .Run (testcase .name , func (t * testing.T ) {
797
799
localClient := buildFakeClient (testcase .localObject )
@@ -806,6 +808,7 @@ func TestSyncerProcessingSingleResourceWithoutStatus(t *testing.T) {
806
808
testcase .localCRD ,
807
809
testcase .remoteAPIGroup ,
808
810
nil ,
811
+ stateNamespace ,
809
812
)
810
813
if err != nil {
811
814
t .Fatalf ("Failed to create syncer: %v" , err )
@@ -820,7 +823,7 @@ func TestSyncerProcessingSingleResourceWithoutStatus(t *testing.T) {
820
823
syncer .newObjectStateStore = func (primaryObject , stateCluster syncSide ) ObjectStateStore {
821
824
// .Process() is called multiple times, but we want the state to persist between reconciles.
822
825
if backend == nil {
823
- backend = newKubernetesBackend (primaryObject , stateCluster )
826
+ backend = newKubernetesBackend (stateNamespace , primaryObject , stateCluster )
824
827
if testcase .existingState != "" {
825
828
if err := backend .Put (testcase .remoteObject , clusterName .String (), []byte (testcase .existingState )); err != nil {
826
829
t .Fatalf ("Failed to prime state store: %v" , err )
@@ -1086,6 +1089,8 @@ func TestSyncerProcessingSingleResourceWithStatus(t *testing.T) {
1086
1089
},
1087
1090
}
1088
1091
1092
+ const stateNamespace = "kcp-system"
1093
+
1089
1094
for _ , testcase := range testcases {
1090
1095
t .Run (testcase .name , func (t * testing.T ) {
1091
1096
localClient := buildFakeClientWithStatus (testcase .localObject )
@@ -1100,6 +1105,7 @@ func TestSyncerProcessingSingleResourceWithStatus(t *testing.T) {
1100
1105
testcase .localCRD ,
1101
1106
testcase .remoteAPIGroup ,
1102
1107
nil ,
1108
+ stateNamespace ,
1103
1109
)
1104
1110
if err != nil {
1105
1111
t .Fatalf ("Failed to create syncer: %v" , err )
@@ -1114,7 +1120,7 @@ func TestSyncerProcessingSingleResourceWithStatus(t *testing.T) {
1114
1120
syncer .newObjectStateStore = func (primaryObject , stateCluster syncSide ) ObjectStateStore {
1115
1121
// .Process() is called multiple times, but we want the state to persist between reconciles.
1116
1122
if backend == nil {
1117
- backend = newKubernetesBackend (primaryObject , stateCluster )
1123
+ backend = newKubernetesBackend (stateNamespace , primaryObject , stateCluster )
1118
1124
if testcase .existingState != "" {
1119
1125
if err := backend .Put (testcase .remoteObject , clusterName .String (), []byte (testcase .existingState )); err != nil {
1120
1126
t .Fatalf ("Failed to prime state store: %v" , err )
0 commit comments