Skip to content

Commit 0f03c17

Browse files
committed
allow trigger delete if feed has not code
1 parent fe54f82 commit 0f03c17

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

commands/trigger.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,14 @@ var triggerDeleteCmd = &cobra.Command{
292292
// "could not find trigger /NAMESPACE_ID/TRIGGER_NAME in the database"
293293
// OR if the feed action is not present, there's no way to clean up the feed
294294
// "The requested resource does not exist"
295+
// likewise, if the feed action has no code, there's no way to clean up the feed
296+
// "Missing main/no code to execute"
295297
if strings.Contains(err.Error(), "could not find trigger") {
296298
whisk.Debug(whisk.DbgWarn, "trigger feed is already deleted for trigger %s\n", qualifiedName.GetEntityName())
297299
} else if strings.Contains(err.Error(), "The requested resource does not exist") {
298300
whisk.Debug(whisk.DbgWarn, "trigger feed action '%s' does not exist\n", fullFeedName)
301+
} else if strings.Contains(err.Error(), "Missing main/no code to execute") {
302+
whisk.Debug(whisk.DbgWarn, "trigger feed action '%s' does not contain valid code\n", fullFeedName)
299303
} else {
300304
errStr := wski18n.T("Unable to delete trigger '{{.name}}': {{.err}}",
301305
map[string]interface{}{"name": qualifiedName.GetEntityName(), "err": err})

0 commit comments

Comments
 (0)