@@ -27,8 +27,10 @@ import (
2727 corev1 "k8s.io/api/core/v1"
2828 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2929 "k8s.io/apimachinery/pkg/runtime"
30+ "k8s.io/utils/pointer"
3031
3132 parametersv1alpha1 "github.com/apecloud/kubeblocks/apis/parameters/v1alpha1"
33+ "github.com/apecloud/kubeblocks/pkg/configuration/core"
3234 cfgproto "github.com/apecloud/kubeblocks/pkg/configuration/proto"
3335 mockproto "github.com/apecloud/kubeblocks/pkg/configuration/proto/mocks"
3436 testutil "github.com/apecloud/kubeblocks/pkg/testutil/k8s"
@@ -65,8 +67,15 @@ var _ = Describe("Reconfigure OperatorSyncPolicy", func() {
6567 withMockInstanceSet (3 , nil ),
6668 withConfigSpec ("for_test" , map [string ]string {"a" : "c b e f" }),
6769 withConfigDescription (& parametersv1alpha1.FileFormatConfig {Format : parametersv1alpha1 .RedisCfg }),
68- withUpdatedParameters (map [string ]string {
69- "a" : "c b e f" ,
70+ withUpdatedParameters (& core.ConfigPatchInfo {
71+ IsModify : true ,
72+ UpdateConfig : map [string ][]byte {
73+ "for-test" : []byte (`{"a":"c b e f"}` ),
74+ },
75+ }),
76+ withParamDef (& parametersv1alpha1.ParametersDefinitionSpec {
77+ MergeReloadAndRestart : pointer .Bool (false ),
78+ ReloadStaticParamsBeforeRestart : pointer .Bool (true ),
7079 }),
7180 withClusterComponent (3 ))
7281
@@ -116,21 +125,24 @@ var _ = Describe("Reconfigure OperatorSyncPolicy", func() {
116125 withMockInstanceSet (3 , nil ),
117126 withConfigSpec ("for_test" , map [string ]string {"a" : "c b e f" }),
118127 withConfigDescription (& parametersv1alpha1.FileFormatConfig {Format : parametersv1alpha1 .RedisCfg }),
119- withUpdatedParameters (map [string ]string {
120- "a" : "c b e f" ,
128+ withUpdatedParameters (& core.ConfigPatchInfo {
129+ IsModify : true ,
130+ UpdateConfig : map [string ][]byte {
131+ "for-test" : []byte (`{"a":"c b e f"}` ),
132+ },
121133 }),
122- withClusterComponent ( 3 ))
123-
124- // add selector
125- mockParam . ParametersDef = & parametersv1alpha1.ParametersDefinitionSpec {
126- ReloadAction : & parametersv1alpha1. ReloadAction {
127- TargetPodSelector : & metav1. LabelSelector {
128- MatchLabels : map [ string ] string {
129- "primary" : "true" ,
134+ withParamDef ( & parametersv1alpha1. ParametersDefinitionSpec {
135+ MergeReloadAndRestart : pointer . Bool ( false ),
136+ ReloadStaticParamsBeforeRestart : pointer . Bool ( true ),
137+ ReloadAction : & parametersv1alpha1.ReloadAction {
138+ TargetPodSelector : & metav1. LabelSelector {
139+ MatchLabels : map [ string ] string {
140+ "primary" : "true" ,
141+ } ,
130142 },
131143 },
132- },
133- }
144+ }) ,
145+ withClusterComponent ( 3 ))
134146
135147 By ("mock client get pod caller" )
136148 k8sMockClient .MockListMethod (testutil .WithListReturned (
0 commit comments