fix: ensure we continue on with logic if the error returned from fetching all apps is NoAppsExist

This makes it so we don't accidentally skip logic that happens after iterate over the apps.
This commit is contained in:
Jose Diaz-Gonzalez committed 2025-12-05 20:16:15 -05:00
1 parent 4942a15a2b
commit 129691eb6e
8 files changed
+14 -8

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
package apps package apps
import ( import (
"errors"
"fmt" "fmt"
"os" "os"
"time" "time"
@@ -48,7 +49,7 @@ func TriggerInstall() error {
} }
apps, err := common.UnfilteredDokkuApps() apps, err := common.UnfilteredDokkuApps()
if err != nil { if err != nil && !errors.Is(err, common.NoAppsExist) {
return nil return nil
} }
+1 -1
View File
@@ -109,7 +109,7 @@ func TriggerInstall() error {
} }
apps, err := common.UnfilteredDokkuApps() apps, err := common.UnfilteredDokkuApps()
if err != nil { if err != nil && !errors.Is(err, common.NoAppsExist) {
return nil return nil
} }
+2 -1
View File
@@ -1,6 +1,7 @@
package common package common
import ( import (
"errors"
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
@@ -78,7 +79,7 @@ func SetupAppData(pluginName string) error {
} }
apps, err := UnfilteredDokkuApps() apps, err := UnfilteredDokkuApps()
if err != nil { if err != nil && !errors.Is(err, NoAppsExist) {
return nil return nil
} }
+2 -1
View File
@@ -1,6 +1,7 @@
package common package common
import ( import (
"errors"
"fmt" "fmt"
) )
@@ -34,7 +35,7 @@ func TriggerInstall() error {
} }
apps, err := UnfilteredDokkuApps() apps, err := UnfilteredDokkuApps()
if err != nil { if err != nil && !errors.Is(err, NoAppsExist) {
return nil return nil
} }
+2 -1
View File
@@ -1,6 +1,7 @@
package network package network
import ( import (
"errors"
"fmt" "fmt"
"io" "io"
"os" "os"
@@ -37,7 +38,7 @@ func TriggerInstall() error {
} }
apps, err := common.UnfilteredDokkuApps() apps, err := common.UnfilteredDokkuApps()
if err != nil { if err != nil && !errors.Is(err, common.NoAppsExist) {
return nil return nil
} }
+2 -1
View File
@@ -2,6 +2,7 @@ package ports
import ( import (
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"sort" "sort"
@@ -16,7 +17,7 @@ func TriggerInstall() error {
} }
apps, err := common.UnfilteredDokkuApps() apps, err := common.UnfilteredDokkuApps()
if err != nil { if err != nil && !errors.Is(err, common.NoAppsExist) {
return nil return nil
} }
+1 -1
View File
@@ -100,7 +100,7 @@ func TriggerInstall() error {
} }
apps, err := common.UnfilteredDokkuApps() apps, err := common.UnfilteredDokkuApps()
if err != nil { if err != nil && !errors.Is(err, common.NoAppsExist) {
return nil return nil
} }
+2 -1
View File
@@ -1,6 +1,7 @@
package scheduler package scheduler
import ( import (
"errors"
"fmt" "fmt"
"github.com/dokku/dokku/plugins/common" "github.com/dokku/dokku/plugins/common"
@@ -31,7 +32,7 @@ func TriggerInstall() error {
} }
apps, err := common.UnfilteredDokkuApps() apps, err := common.UnfilteredDokkuApps()
if err != nil { if err != nil && !errors.Is(err, common.NoAppsExist) {
return nil return nil
} }