@@ -34,7 +34,7 @@ func runColdStorage(cmd *cobra.Command, args []string) error {
3434 logger := logging .NewLogger ()
3535 logger .Info (fmt .Sprintf ("Starting cold storage migration hotCount=%d coldAttribute=%s dryRun=%t" , hotCount , coldAttribute , dryRun ))
3636
37- client , err := utils .NewOSClientFromCommandConfig (cfg )
37+ client , err := utils .NewOSClientWithURL (cfg , cfg . GetOpenSearchURL () )
3838 if err != nil {
3939 return fmt .Errorf ("failed to create OpenSearch client: %v" , err )
4040 }
@@ -55,7 +55,7 @@ func runColdStorage(cmd *cobra.Command, args []string) error {
5555
5656 var candidates []string
5757 for _ , index := range allIndices {
58- if shouldMoveToColdStorage (index .Index , cutoffDate , dateFormat ) {
58+ if utils . IsOlderThanCutoff (index .Index , cutoffDate , dateFormat ) {
5959 candidates = append (candidates , index .Index )
6060 }
6161 }
@@ -112,7 +112,3 @@ func runColdStorage(cmd *cobra.Command, args []string) error {
112112 logger .Info (fmt .Sprintf ("Cold storage migration completed processed=%d skipped_already_cold=%d" , len (coldIndices ), len (alreadyCold )))
113113 return nil
114114}
115-
116- func shouldMoveToColdStorage (index , cutoffDate , dateFormat string ) bool {
117- return utils .IsOlderThanCutoff (index , cutoffDate , dateFormat )
118- }
0 commit comments