bug: fixes bug with error out with using kompose convert with no -f (#1725)
#### What type of PR is this? <!-- Add one of the following kinds: /kind cleanup /kind documentation /kind feature --> /kind bug Fixes a validation bug where if you do not provide a compose.yaml or docker-compose.yaml it will nil point error out rather than have an appropriate "file not found" output. #### Which issue(s) this PR fixes: <!-- *Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Closes https://github.com/kubernetes/kompose/issues/1719 #### Special notes for your reviewer: Signed-off-by: Charlie Drage <charlie@charliedrage.com>
This commit is contained in:
+6
-1
@@ -133,7 +133,12 @@ var convertCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
app.ValidateFlags(args, cmd, &ConvertOpt)
|
||||
app.ValidateComposeFile(&ConvertOpt)
|
||||
|
||||
// Since ValidateComposeFiles returns an error, let's validate it and output the error appropriately if the validation fails
|
||||
err := app.ValidateComposeFile(&ConvertOpt)
|
||||
if err != nil {
|
||||
log.Fatalf("Error validating compose file: %v", err)
|
||||
}
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user