var ErrNoContext … var ErrEmptyConfig … var ErrEmptyCluster … // NewEmptyConfigError returns an error wrapping the given message which IsEmptyConfig() will recognize as an empty config error func NewEmptyConfigError(message string) error { … } type errEmptyConfig … func (e *errEmptyConfig) Error() string { … } type errContextNotFound … func (e *errContextNotFound) Error() string { … } // IsContextNotFound returns a boolean indicating whether the error is known to // report that a context was not found func IsContextNotFound(err error) bool { … } // IsEmptyConfig returns true if the provided error indicates the provided configuration // is empty. func IsEmptyConfig(err error) bool { … } type errConfigurationInvalid … var _ … var _ … func newErrConfigurationInvalid(errs []error) error { … } // Error implements the error interface func (e errConfigurationInvalid) Error() string { … } // Errors implements the utilerrors.Aggregate interface func (e errConfigurationInvalid) Errors() []error { … } // Is implements the utilerrors.Aggregate interface func (e errConfigurationInvalid) Is(target error) bool { … } func (e errConfigurationInvalid) visit(f func(err error) bool) bool { … } // IsConfigurationInvalid returns true if the provided error indicates the configuration is invalid. func IsConfigurationInvalid(err error) bool { … } // Validate checks for errors in the Config. It does not return early so that it can find as many errors as possible. func Validate(config clientcmdapi.Config) error { … } // ConfirmUsable looks a particular context and determines if that particular part of the config is useable. There might still be errors in the config, // but no errors in the sections requested or referenced. It does not return early so that it can find as many errors as possible. func ConfirmUsable(config clientcmdapi.Config, passedContextName string) error { … } // validateClusterInfo looks for conflicts and errors in the cluster info func validateClusterInfo(clusterName string, clusterInfo clientcmdapi.Cluster) []error { … } // validateAuthInfo looks for conflicts and errors in the auth info func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []error { … } // validateContext looks for errors in the context. It is not transitive, so errors in the reference authInfo or cluster configs are not included in this return func validateContext(contextName string, context clientcmdapi.Context, config clientcmdapi.Config) []error { … }