Skip to content

Commit

Permalink
fix: kuttl migration failure in case of unsupported name (#479)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly authored Nov 24, 2023
1 parent 38edcf2 commit dec8822
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .release-notes/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ Release notes for `TODO`.
## :guitar: Misc :guitar:
-->

## :wrench: Fixes :wrench:

- Fixed a kuttl migration failure in case of unsupported file name
5 changes: 4 additions & 1 deletion pkg/commands/kuttl/migrate/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,17 @@ func migrate(out io.Writer, path string, resource unstructured.Unstructured) (me
}
return configuration, nil
case "TestStep":
groups := discovery.StepFileName.FindStringSubmatch(filepath.Base(path))
if len(groups) < 3 {
return nil, nil
}
fmt.Fprintf(out, "Converting %s in %s...\n", "TestStep", path)
step, err := testStep(resource)
if err != nil {
fmt.Fprintf(out, " ERROR: failed to convert %s (%s): %s\n", "TestStep", path, err)
return nil, err
}
if step.GetName() == "" {
groups := discovery.StepFileName.FindStringSubmatch(filepath.Base(path))
step.SetName(groups[2])
}
return step, nil
Expand Down

0 comments on commit dec8822

Please sign in to comment.