Documentation ¶
Index ¶
- Constants
- Variables
- func CheckInstanceRam() (bool, error)
- func Contains(list []string, s string) bool
- func GetConfigFromSecret(ctx context.Context, r client.Client, secretRef *v1alpha1.SecretRef) ([]byte, error)
- func GetKubernetesClients() (dynamic.Interface, error)
- func GetMetaData(resource string) (int, string, error)
- func GetRegion() (string, error)
- func IgnoreNotFoundError(err error) error
- func IsBackendNotImplemented(err error) bool
- func IsBackendSecretNotFound(err error) bool
- func IsClusterNamespace(s string) bool
- func IsEmptySecretKey(err error) bool
- func JsonStr(o interface{}) string
- func Remove(list []string, s string) []string
- func Retry(interval time.Duration, maxRetries int, f ConditionFunc) error
- type BackendNotImplementedError
- type BackendSecretNotFoundError
- type BackendSecretTypeNotSupportError
- type ConditionFunc
- type EmptySecretKeyError
Constants ¶
const ( UnknownErrorType = "UnknownError" BackendNotImplementedErrorType = "BackendNotImplementedError" BackendSecretNotFoundErrorType = "BackendSecretNotFoundError" BackendSecretTypeNotSupportErrorType = "BackendSecretTypeNotSupportError" EmptySecretKeyErrorType = "EmptySeretKeyError" )
The errors that might occur when parsing and validating a token
const ( BinaryType = "binary" METADATA_URL = "http://100.100.100.200/latest/meta-data/" REGIONID_TAG = "region-id" RAM = "ram/" )
Variables ¶
var ( ErrInvalidKey = errors.New("key is invalid") ErrInvalidKeyType = errors.New("key is of invalid type") )
Error constants
Functions ¶
func CheckInstanceRam ¶
CheckInstanceRam check if instance not bind workerrole
func GetConfigFromSecret ¶
func GetKubernetesClients ¶
getKubernetesClients returns all the required clients(token CRD client and origin k8s cli) to communicate with
func IsBackendNotImplemented ¶
IsBackendNotImplemented returns true if the error is type of BackendNotImplementedError and false otherwise
func IsBackendSecretNotFound ¶
IsBackendSecretNotFound returns true if the error is type of BackendSecretNotFound and false otherwise
func IsClusterNamespace ¶
func IsEmptySecretKey ¶
IsEmptySecretKey returns true if the error is type of EmptySecretKeyError and false otherwise
func Retry ¶
func Retry(interval time.Duration, maxRetries int, f ConditionFunc) error
Retry retries f every interval until after maxRetries. The interval won't be affected by how long f takes. For example, if interval is 3s, f takes 1s, another f will be called 2s later. However, if f takes longer than interval, it will be delayed.
Types ¶
type BackendNotImplementedError ¶
BackendNotImplementedError will be raised if the selected backend is not implemented
func (BackendNotImplementedError) Error ¶
func (e BackendNotImplementedError) Error() string
type BackendSecretNotFoundError ¶
BackendSecretNotFoundError will be raised if secret is not found in the selected backend
func (BackendSecretNotFoundError) Error ¶
func (e BackendSecretNotFoundError) Error() string
type BackendSecretTypeNotSupportError ¶
BackendSecretTypeNotSupportError will be raised if the secret data type not support
func (BackendSecretTypeNotSupportError) Error ¶
func (e BackendSecretTypeNotSupportError) Error() string
type ConditionFunc ¶
type EmptySecretKeyError ¶
type EmptySecretKeyError struct {
ErrType string
}
EmptySecretKeyError will be raised if the selected encoding is not implemented
func (EmptySecretKeyError) Error ¶
func (e EmptySecretKeyError) Error() string