Skip to content

Commit

Permalink
[Fix] fix hasKappAPIs method (#676)
Browse files Browse the repository at this point in the history
The method was listing resources falling under the `kappctrl.k14s.io`
string. It would return nil when kapp-ctrl is not installed, resulting
in a panic.

Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
  • Loading branch information
varshaprasad96 committed Mar 4, 2024
1 parent a81b311 commit d10056e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ func hasKappApis(config *rest.Config) (bool, error) {
return false, fmt.Errorf("listing resource APIs: %v", err)
}

if apiResourceList == nil {
return false, nil
}

for _, resource := range apiResourceList.APIResources {
if resource.Kind == "App" {
return true, nil
Expand Down

0 comments on commit d10056e

Please sign in to comment.