Skip to content

Commit

Permalink
fix: handle the namespace/appname args[0]
Browse files Browse the repository at this point in the history
Signed-off-by: Mostafa Negim <[email protected]>
  • Loading branch information
monegim committed Oct 21, 2024
1 parent 0bd0f2c commit 8ebd966
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/util/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,12 @@ func constructAppsFromFileUrl(fileURL, appName string, labels, annotations, args
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]
// split the appname from the command line <ns>/<appname>
_, appNameFromCommand, err := GetNamespaceAndAppName(args[0])
if err != nil {
return nil, err
}
app.Name = appNameFromCommand
}
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 8ebd966

Please sign in to comment.