client-go: chore: implement Is interface for ErrGroupDiscoveryFailed

Signed-off-by: Tarun Gupta Akirala <takirala@users.noreply.github.com>

Kubernetes-commit: 6aad00ff73d10378d33d615505239c5373a1108b
This commit is contained in:
Tarun Gupta Akirala 2023-08-07 12:08:09 -07:00 committed by Kubernetes Publisher
parent 17c66cc83d
commit f93655277b

View File

@ -420,6 +420,11 @@ func (e *ErrGroupDiscoveryFailed) Error() string {
return fmt.Sprintf("unable to retrieve the complete list of server APIs: %s", strings.Join(groups, ", ")) 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 // IsGroupDiscoveryFailedError returns true if the provided error indicates the server was unable to discover
// a complete list of APIs for the client to use. // a complete list of APIs for the client to use.
func IsGroupDiscoveryFailedError(err error) bool { func IsGroupDiscoveryFailedError(err error) bool {