@@ -157,7 +157,7 @@ The command has two modes of operation:
157157 # Simulate the migration without making any changes.
158158 flux migrate -f . --dry-run
159159
160- # Run the migration by skipping confirmation prompts.
160+ # Run the migration skipping confirmation prompts.
161161 flux migrate -f . --yes
162162` ,
163163 RunE : runMigrateCmd ,
@@ -177,7 +177,7 @@ func init() {
177177 migrateCmd .Flags ().StringVarP (& migrateFlags .path , "path" , "f" , "" ,
178178 "the path to the directory containing the manifests to migrate" )
179179 migrateCmd .Flags ().StringSliceVarP (& migrateFlags .extensions , "extensions" , "e" , []string {".yaml" , ".yml" },
180- "the file extensions to consider when migrating manifests, only applicable --path" )
180+ "the file extensions to consider when migrating manifests, only applicable with --path" )
181181 migrateCmd .Flags ().StringVarP (& migrateFlags .version , "version" , "v" , "" ,
182182 "the target Flux minor version to migrate manifests to, only applicable with --path (defaults to the version of the CLI)" )
183183 migrateCmd .Flags ().BoolVarP (& migrateFlags .yes , "yes" , "y" , false ,
@@ -605,7 +605,8 @@ func (f *FileSystemMigrator) detectFileUpgrades(file string) ([]APIUpgrade, erro
605605 if idx == - 1 {
606606 continue
607607 }
608- apiVersion := strings .TrimSpace (apiVersionLine [idx + len (apiVersionPrefix ):])
608+ apiVersionValuePrefix := strings .TrimSpace (apiVersionLine [idx + len (apiVersionPrefix ):])
609+ apiVersion := strings .Split (apiVersionValuePrefix , " " )[0 ]
609610 gv , err := schema .ParseGroupVersion (apiVersion )
610611 if err != nil {
611612 logger .Warningf ("%s:%d: %v" , file , line + 1 , err )
@@ -669,7 +670,7 @@ func (f *FileSystemMigrator) migrateFile(fileUpgrades *FileAPIUpgrades) error {
669670 // Apply upgrades to lines.
670671 for _ , upgrade := range fileUpgrades .Upgrades {
671672 line := lines [upgrade .Line ]
672- line = strings .ReplaceAll (line , upgrade .OldVersion , upgrade .NewVersion )
673+ line = strings .Replace (line , upgrade .OldVersion , upgrade .NewVersion , 1 )
673674 lines [upgrade .Line ] = line
674675 }
675676
0 commit comments