MCPcopy
hub / github.com/kubernetes/client-go / IsContextNotFound

Function IsContextNotFound

tools/clientcmd/validation.go:48–56  ·  view source on GitHub ↗

IsContextNotFound returns a boolean indicating whether the error is known to report that a context was not found

(err error)

Source from the content-addressed store, hash-verified

46// IsContextNotFound returns a boolean indicating whether the error is known to
47// report that a context was not found
48func IsContextNotFound(err error) bool {
49 if err == nil {
50 return false
51 }
52 if _, ok := err.(*errContextNotFound); ok || err == ErrNoContext {
53 return true
54 }
55 return strings.Contains(err.Error(), "context was not found for specified context")
56}
57
58// IsEmptyConfig returns true if the provided error indicates the provided configuration
59// is empty.

Callers 2

TestIsContextNotFoundFunction · 0.85
IsConfigurationInvalidFunction · 0.85

Calls 1

ErrorMethod · 0.65

Tested by 1

TestIsContextNotFoundFunction · 0.68