diff --git a/pkg/kapp/cmd/app/inspect.go b/pkg/kapp/cmd/app/inspect.go index 7c9580758..b9c0f2052 100644 --- a/pkg/kapp/cmd/app/inspect.go +++ b/pkg/kapp/cmd/app/inspect.go @@ -7,6 +7,7 @@ import ( "fmt" "github.com/cppforlife/go-cli-ui/ui" + // "github.com/davecgh/go-spew/spew" cmdcore "github.com/k14s/kapp/pkg/kapp/cmd/core" cmdtools "github.com/k14s/kapp/pkg/kapp/cmd/tools" ctldiff "github.com/k14s/kapp/pkg/kapp/diff" @@ -82,6 +83,7 @@ func (o *InspectOptions) Run() error { } resources = resourceFilter.Apply(resources) + source := fmt.Sprintf("app '%s'", app.Name()) switch { diff --git a/pkg/kapp/resources/identified_resources_list.go b/pkg/kapp/resources/identified_resources_list.go index e120a247c..0f54e4d2c 100644 --- a/pkg/kapp/resources/identified_resources_list.go +++ b/pkg/kapp/resources/identified_resources_list.go @@ -55,6 +55,16 @@ func (r IdentifiedResources) List(labelSelector labels.Selector, resRefs []Resou } } + // Dump any resources that do not contain Labels + // as they cannot be kapp resources + var newResources []Resource + for _, res := range resources { + if len(res.Labels()) > 0 { + newResources = append(newResources, res) + } + } + resources = newResources + return r.pickPreferredVersions(resources) }