Skip to content

Commit

Permalink
Fix: check for app.Name if is empty, and pick the args[0] if so #20474
Browse files Browse the repository at this point in the history
  • Loading branch information
Mostafa Negim committed Oct 21, 2024
1 parent aff5e61 commit d0445a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/util/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,10 @@ func constructAppsFromFileUrl(fileURL, appName string, labels, annotations, args
return nil, err
}
for _, app := range apps {
// if app.Name is empty, it should be picked from the command line
if len(args) == 1 && app.Name == "" {
app.Name = args[0]
}
if len(args) == 1 && args[0] != app.Name {
return nil, fmt.Errorf("app name '%s' does not match app spec metadata.name '%s'", args[0], app.Name)
}
Expand Down

0 comments on commit d0445a9

Please sign in to comment.