client-go: chore: implement Is interface for ErrGroupDiscoveryFailed

Signed-off-by: Tarun Gupta Akirala <takirala@users.noreply.github.com>
This commit is contained in:
Tarun Gupta Akirala 2023-08-07 12:08:09 -07:00
parent 1620473a9a
commit 6aad00ff73
No known key found for this signature in database
GPG Key ID: CEEBD9E3BEB7BBA2

View File

@ -415,6 +415,11 @@ func (e *ErrGroupDiscoveryFailed) Error() string {
return fmt.Sprintf("unable to retrieve the complete list of server APIs: %s", strings.Join(groups, ", "))
}
func (e *ErrGroupDiscoveryFailed) Is(target error) bool {
_, ok := target.(*ErrGroupDiscoveryFailed)
return ok
}
// IsGroupDiscoveryFailedError returns true if the provided error indicates the server was unable to discover
// a complete list of APIs for the client to use.
func IsGroupDiscoveryFailedError(err error) bool {