mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-03-03 02:00:18 +00:00
17 lines
412 B
Go
17 lines
412 B
Go
// Copyright 2020-2021 Clastix Labs
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package utils
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
"k8s.io/apimachinery/pkg/api/meta"
|
|
"k8s.io/client-go/discovery"
|
|
)
|
|
|
|
func IsUnsupportedAPI(err error) bool {
|
|
missingAPIError, discoveryError := &meta.NoKindMatchError{}, &discovery.ErrGroupDiscoveryFailed{}
|
|
|
|
return errors.As(err, &missingAPIError) || errors.As(err, &discoveryError)
|
|
}
|