Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ and we will add you. **All** contributors belong here. 💯
- [Robin Brämer](https://github.com/robinbraemer)
- [Geeta Chavan](https://github.com/geetachavan1)
- [Stephen Augustus](https://github.com/justaugustus)
- [Erik Cederberg](https://github.com/erikced)
2 changes: 1 addition & 1 deletion pkg/porter/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func (p *Porter) ListInstallations(ctx context.Context, opts ListOptions) (Displ
return nil, log.Error(fmt.Errorf("could not list installations: %w", err))
}

var displayInstallations DisplayInstallations
var displayInstallations DisplayInstallations = DisplayInstallations{}
var fieldSelectorMap map[string]string
if opts.FieldSelector != "" {
fieldSelectorMap, err = parseFieldSelector(opts.FieldSelector)
Expand Down
8 changes: 8 additions & 0 deletions pkg/porter/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ func TestPorter_ListInstallations(t *testing.T) {
require.NoError(t, err)
assert.Len(t, results, 1)
})

t.Run("empty namespace", func(t *testing.T) {
opts := ListOptions{Namespace: "nonexistent"}
results, err := p.ListInstallations(ctx, opts)
require.NoError(t, err)
assert.Len(t, results, 0)
assert.NotNil(t, results)
})
}

func TestPorter_ListInstallationsWithFieldSelector(t *testing.T) {
Expand Down