fix: don't fail info/invoke if eventing missing (#823)

If eventing is not installed, the user should still be able to get info and use
`kn invoke`. Don't fail, if `describe` finds eventing missing.

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/822

Signed-off-by: Lance Ball <lball@redhat.com>
This commit is contained in:
Lance Ball 2022-02-09 05:04:43 -06:00 committed by GitHub
parent a2abfca3d3
commit fdf4b60051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -64,9 +64,17 @@ func (d *Describer) Describe(ctx context.Context, name string) (description fn.I
primaryRouteURL = routes.Items[0].Status.URL.String()
}
description.Name = name
description.Namespace = d.namespace
description.Route = primaryRouteURL
description.Routes = routeURLs
triggers, err := eventingClient.ListTriggers(ctx)
// IsNotFound -- Eventing is probably not installed on the cluster
if err != nil && !errors.IsNotFound(err) {
err = nil
return
} else if err != nil {
return
}
@ -90,10 +98,6 @@ func (d *Describer) Describe(ctx context.Context, name string) (description fn.I
}
}
description.Name = name
description.Namespace = d.namespace
description.Route = primaryRouteURL
description.Routes = routeURLs
description.Subscriptions = subscriptions
return