Skip to content

Commit 8d9b5be

Browse files
authored
fix(cli): Send sync time to new sources (#10796)
Fixes version check in the new CLI and send sync time new sources.
1 parent 27ff430 commit 8d9b5be

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

cli/cmd/sync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ func sync(cmd *cobra.Command, args []string) error {
108108
if err != nil {
109109
return fmt.Errorf("failed to get destination versions: %w", err)
110110
}
111-
if !slices.Contains(versions, 2) {
112-
return fmt.Errorf("destination %[1]s does not support CloudQuery SDK version 2. Please upgrade to newer version of %[1]s", destination.Spec.Name)
111+
if !slices.Contains(versions, 1) {
112+
return fmt.Errorf("destination %[1]s does not support CloudQuery SDK version 1. Please upgrade to newer version of %[1]s", destination.Spec.Name)
113113
}
114114
}
115115
if err := syncConnectionV2(ctx, cl, destinationsClients, invocationUUID.String(), noMigrate); err != nil {

cli/cmd/sync_v2.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ func syncConnectionV2(ctx context.Context, sourceClient *managedsource.Client, d
8888
log.Info().Str("source", sourceSpec.VersionString()).Strs("destinations", destinationStrings).Msg("Start fetching resources")
8989
fmt.Printf("Starting sync for: %s -> %s\n", sourceSpec.VersionString(), destinationStrings)
9090

91-
syncClient, err := sourcePbClient.Sync(ctx, &source.Sync_Request{})
91+
syncClient, err := sourcePbClient.Sync(ctx, &source.Sync_Request{
92+
SyncTime: timestamppb.New(syncTime),
93+
})
9294
if err != nil {
9395
return err
9496
}

0 commit comments

Comments
 (0)