@@ -17,6 +17,7 @@ import (
1717 "github.com/kong/go-database-reconciler/pkg/diff"
1818 "github.com/kong/go-database-reconciler/pkg/dump"
1919 "github.com/kong/go-database-reconciler/pkg/file"
20+ "github.com/kong/go-database-reconciler/pkg/schema"
2021 "github.com/kong/go-database-reconciler/pkg/state"
2122 reconcilerUtils "github.com/kong/go-database-reconciler/pkg/utils"
2223 "github.com/kong/go-kong/kong"
2930 assumeYes bool
3031 noMaskValues bool
3132 syncCmdAssumeYes bool
33+
34+ schemaRegistry * schema.Registry
3235)
3336
3437type mode int
@@ -191,6 +194,10 @@ func syncMain(ctx context.Context, filenames []string, dry bool, parallelism,
191194 var kongClient * kong.Client
192195 mode := getMode (targetContent )
193196 if mode == modeKonnect {
197+ if skipDefaultsFill {
198+ dumpConfig .SkipDefaults = true
199+ }
200+
194201 // Konnect ConsumerGroup APIs don't support the query-parameter list_consumers yet
195202 if dumpConfig .SkipConsumersWithConsumerGroups {
196203 return errors .New ("the flag --skip-consumers-with-consumer-groups can not be used with Konnect" )
@@ -279,6 +286,9 @@ func syncMain(ctx context.Context, filenames []string, dry bool, parallelism,
279286 }
280287 }
281288
289+ schemaRegistry = schema .NewRegistry (ctx , kongClient , mode == modeKonnect )
290+ dumpConfig .SchemaRegistry = schemaRegistry
291+
282292 dumpConfig .IsConsumerGroupPolicyOverrideSet = determinePolicyOverride (* targetContent , dumpConfig )
283293
284294 dumpConfig .SelectorTags , err = determineSelectorTag (* targetContent , dumpConfig )
@@ -696,13 +706,15 @@ func performDiff(ctx context.Context, currentState, targetState *state.KongState
696706 shouldSkipDeletes := applyType == ApplyTypePartial
697707
698708 s , err := diff .NewSyncer (diff.SyncerOpts {
699- CurrentState : currentState ,
700- TargetState : targetState ,
701- KongClient : client ,
702- StageDelaySec : delay ,
703- NoMaskValues : noMaskValues ,
704- IsKonnect : isKonnect ,
705- NoDeletes : shouldSkipDeletes ,
709+ CurrentState : currentState ,
710+ TargetState : targetState ,
711+ KongClient : client ,
712+ StageDelaySec : delay ,
713+ NoMaskValues : noMaskValues ,
714+ IsKonnect : isKonnect ,
715+ NoDeletes : shouldSkipDeletes ,
716+ SkipSchemaDefaults : isKonnect && skipDefaultsFill ,
717+ SchemaRegistry : schemaRegistry ,
706718 })
707719 if err != nil {
708720 return 0 , err
0 commit comments