Documentation
¶
Index ¶
- Constants
- func IsRetryableError(err error) bool
- func VersionFromImageRef(image string) (string, bool)
- func VersionGTE(image string, version semver.Version) bool
- type Client
- func NewClientFromKubeletKubeconfig() (*Client, error)
- func NewClientFromPKI(ca, crt, key []byte, endpoint *url.URL) (*Client, error)
- func NewForConfig(config *restclient.Config) (*Client, error)
- func NewTemporaryClientControlPlane(ctx context.Context, r controller.Reader) (client *Client, err error)
- func NewTemporaryClientFromPKI(ca *x509.PEMEncodedCertificateAndKey, endpoint *url.URL) (client *Client, err error)
Constants ¶
const ( // DrainTimeout is maximum time to wait for the node to be drained. DrainTimeout = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func IsRetryableError ¶
IsRetryableError returns true if this Kubernetes API should be retried.
func VersionFromImageRef ¶ added in v1.14.0
VersionFromImageRef extracts the tag out of the image reference, ignoring the digest (if present).
It returns false if the reference can't be parsed or if the tag is missing.
Types ¶
type Client ¶
type Client struct {
*taloskubernetes.Client
}
Client represents a set of helper methods for interacting with the Kubernetes API.
func NewClientFromKubeletKubeconfig ¶
NewClientFromKubeletKubeconfig initializes and returns a Client.
func NewClientFromPKI ¶
NewClientFromPKI initializes and returns a Client.
func NewForConfig ¶
func NewForConfig(config *restclient.Config) (*Client, error)
NewForConfig initializes and returns a client using the provided config.
func NewTemporaryClientControlPlane ¶ added in v1.3.2
func NewTemporaryClientControlPlane(ctx context.Context, r controller.Reader) (client *Client, err error)
NewTemporaryClientControlPlane initializes a Kubernetes client for a controlplane node using PKI information.
The client uses "localhost" endpoint, so it doesn't depend on the loadbalancer to be ready.
func NewTemporaryClientFromPKI ¶
func NewTemporaryClientFromPKI(ca *x509.PEMEncodedCertificateAndKey, endpoint *url.URL) (client *Client, err error)
NewTemporaryClientFromPKI initializes a Kubernetes client using a certificate with a TTL of 10 minutes.