{"modulePath":"github.phpd.cn/openshift/origin","version":"v3.7.2+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package clientcmd\n\n## Constants\n\n```go\nconst ConfigSyntax = \" --master=\u003caddr\u003e\"\n```\n\n## Functions\n\n```go\nfunc BindClientConfigSecurityFlags(config *restclient.Config, flags *pflag.FlagSet)\n```\nBindClientConfigSecurityFlags adds flags for the supplied client config\n\n```go\nfunc DefaultClientConfig(flags *pflag.FlagSet) kclientcmd.ClientConfig\n```\n\n```go\nfunc DefaultGenerators(cmdName string) map[string]kubectl.Generator\n```\n\n```go\nfunc DiscoverGroupVersionResources(client discovery.ServerResourcesInterface, filterGVR ...schema.GroupVersionResource) ([]schema.GroupVersionResource, bool, error)\n```\nDiscoverGroupVersionResources performs a server resource discovery for each filterGVR, returning a slice of GVRs for the matching Resources, and a bool for \"all\" indicating that each item in filterGVR was found.\n\n```go\nfunc EnvVars(host string, caData []byte, insecure bool, bearerTokenFile string) []api.EnvVar\n```\n\n```go\nfunc FindAllCanonicalResources(d discovery.DiscoveryInterface, m meta.RESTMapper) ([]schema.GroupResource, error)\n```\nFindAllCanonicalResources returns all resource names that map directly to their kind (Kind -\u003e Resource -\u003e Kind) and are not subresources. This is the closest mapping possible from the client side to resources that can be listed and updated. Note that this may return some virtual resources (like imagestreamtags) that can be otherwise represented. TODO: add a field to APIResources for \"virtual\" (or that points to the canonical resource). TODO: fallback to the scheme when discovery is not possible.\n\n```go\nfunc GetPrettyErrorFor(err error) error\n```\nGetPrettyErrorFor prettifys the message of the provided error\n\n```go\nfunc GetPrettyErrorForServer(err error, serverName string) error\n```\nGetPrettyErrorForServer prettifys the message of the provided error\n\n```go\nfunc GetPrettyMessageFor(err error) string\n```\nGetPrettyMessageFor prettifys the message of the provided error\n\n```go\nfunc GetPrettyMessageForServer(err error, serverName string) string\n```\nGetPrettyMessageForServer prettifys the message of the provided error\n\n```go\nfunc IsCertificateAuthorityUnknown(err error) bool\n```\nIsCertificateAuthorityUnknown checks whether the provided error is a 'certificate authority unknown' error or not\n\n```go\nfunc IsCertificateHostnameError(err error) bool\n```\nIsCertificateHostnameError checks whether the set of authorized names doesn't match the requested name\n\n```go\nfunc IsCertificateInvalid(err error) bool\n```\nIsCertificateInvalid checks whether the certificate is invalid for reasons like expired,\tCA not authorized to sign, there are too many cert intermediates, or the cert usage is not valid for the wanted purpose.\n\n```go\nfunc IsConfigurationInvalid(err error) bool\n```\nIsConfigurationInvalid checks whether the provided error is a 'invalid configuration' error or not\n\n```go\nfunc IsConfigurationMissing(err error) bool\n```\n\n```go\nfunc IsForbidden(err error) bool\n```\nIsForbidden checks whether the provided error is a 'forbidden' error or not\n\n```go\nfunc IsNoServerFound(err error) bool\n```\nIsNoServerFound checks whether the provided error is a 'no server found' error or not\n\n```go\nfunc IsTLSOversizedRecord(err error) bool\n```\nIsTLSOversizedRecord checks whether the provided error is a url.Error with \"tls: oversized record received\", which usually means TLS not supported.\n\n```go\nfunc LegacyPolicyResourceGate(client discovery.ServerResourcesInterface) error\n```\nLegacyPolicyResourceGate returns err if the server does not support the set of legacy policy objects (\\\u003c 3.7)\n\n```go\nfunc NewObjectMappingFactory(clientAccessFactory ClientAccessFactory) kcmdutil.ObjectMappingFactory\n```\n\n```go\nfunc ResourceMapper(f kcmdutil.Factory) *resource.Mapper\n```\n\n## Types\n\n```go\ntype CLIClientBuilder interface {\n\tOpenshiftInternalTemplateClient() (templateclientinternal.Interface, error)\n\tOpenshiftInternalImageClient() (imageclientinternal.Interface, error)\n\tOpenshiftInternalAppsClient() (appsclientinternal.Interface, error)\n\tOpenshiftInternalBuildClient() (buildclientinternal.Interface, error)\n\tOpenshiftInternalAuthorizationClient() (authorizationclientinternal.Interface, error)\n\tOpenshiftInternalNetworkClient() (networkclientinternal.Interface, error)\n\tOpenshiftInternalOAuthClient() (oauthclientinternal.Interface, error)\n\tOpenshiftInternalProjectClient() (projectclientinternal.Interface, error)\n\tOpenshiftInternalQuotaClient() (quotaclientinternal.Interface, error)\n\tOpenshiftInternalRouteClient() (routeclientinternal.Interface, error)\n\tOpenshiftInternalSecurityClient() (securityclientinternal.Interface, error)\n\tOpenshiftInternalUserClient() (userclientinternal.Interface, error)\n\n\tConfig() (*rest.Config, error)\n}\n```\nCLIClientBuilder provides clients for the CLI.\n\n```go\ntype ClientAccessFactory interface {\n\tkcmdutil.ClientAccessFactory\n\tCLIClientBuilder\n\n\tOpenShiftClientConfig() kclientcmd.ClientConfig\n\tImageResolutionOptions() FlagBinder\n}\n```\n\n```go\nfunc NewClientAccessFactory(optionalClientConfig kclientcmd.ClientConfig) ClientAccessFactory\n```\n\n```go\ntype Config struct {\n\t// MasterAddr is the address the master can be reached on (host, host:port, or URL).\n\tMasterAddr flagtypes.Addr\n\t// KubernetesAddr is the address of the Kubernetes server (host, host:port, or URL).\n\t// If omitted defaults to the master.\n\tKubernetesAddr flagtypes.Addr\n\t// CommonConfig is the shared base config for both the OpenShift config and Kubernetes config\n\tCommonConfig restclient.Config\n\t// Namespace is the namespace to act in\n\tNamespace string\n\n\t// If set, allow kubeconfig file loading\n\tFromFile bool\n\t// If true, no environment is loaded (for testing, primarily)\n\tSkipEnv bool\n\t// contains filtered or unexported fields\n}\n```\nConfig contains all the necessary bits for client configuration\n\n```go\nfunc NewConfig() *Config\n```\nNewConfig returns a new configuration\n\n```go\nfunc (cfg *Config) Bind(flags *pflag.FlagSet)\n```\nBind binds configuration values to the passed flagset\n\n```go\nfunc (cfg *Config) BindToFile() *Config\n```\nBindToFile is used when this config will not be bound to flags, but should load the config file from disk if available.\n\n```go\nfunc (cfg *Config) Clients() (kclientset.Interface, error)\n```\nClients returns an OpenShift and a Kubernetes client from a given configuration\n\n```go\nfunc (cfg *Config) KubeConfig() *restclient.Config\n```\nKubeConfig returns the Kubernetes configuration\n\n```go\nfunc (cfg *Config) OpenShiftConfig() *restclient.Config\n```\nOpenShiftConfig returns the OpenShift configuration\n\n```go\ntype Factory struct {\n\tClientAccessFactory\n\tkcmdutil.ObjectMappingFactory\n\tkcmdutil.BuilderFactory\n}\n```\nFactory provides common options for OpenShift commands\n\n```go\nfunc New(flags *pflag.FlagSet) *Factory\n```\nNew creates a default Factory for commands that should share identical server connection behavior. Most commands should use this method to get a factory.\n\n```go\nfunc NewFactory(optionalClientConfig kclientcmd.ClientConfig) *Factory\n```\nNewFactory creates an object that holds common methods across all OpenShift commands\n\n```go\nfunc (f *Factory) ExtractFileContents(obj runtime.Object) (map[string][]byte, bool, error)\n```\nExtractFileContents returns a map of keys to contents, false if the object cannot support such an operation, or an error.\n\n```go\nfunc (f *Factory) PodForResource(resource string, timeout time.Duration) (string, error)\n```\n\n```go\nfunc (f *Factory) PrintResourceInfos(cmd *cobra.Command, isLocal bool, infos []*resource.Info, out io.Writer) error\n```\nPrintResourceInfos receives a list of resource infos and prints versioned objects if a generic output format was specified otherwise, it iterates through info objects, printing each resource with a unique printer for its mapping\n\n```go\nfunc (f *Factory) UpdateObjectEnvironment(obj runtime.Object, fn func(*[]api.EnvVar) error) (bool, error)\n```\nUpdateObjectEnvironment update the environment variables in object specification.\n\n```go\ntype FlagBinder interface {\n\t// Bound returns true if the flag is already bound to a command.\n\tBound() bool\n\t// Bind allows to bind an extra flag to a command\n\tBind(*pflag.FlagSet)\n}\n```\nFlagBinder represents an interface that allows to bind extra flags into commands.\n\n```go\ntype OpenshiftCLIClientBuilder struct {\n\t// contains filtered or unexported fields\n}\n```\nOpenshiftCLIClientBuilder implements the CLIClientBuilder.\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) Config() (*rest.Config, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalAppsClient() (appsclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalAuthorizationClient() (authorizationclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalBuildClient() (buildclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalImageClient() (imageclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalNetworkClient() (networkclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalOAuthClient() (oauthclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalProjectClient() (projectclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalQuotaClient() (quotaclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalRouteClient() (routeclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalSecurityClient() (securityclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalTemplateClient() (templateclientinternal.Interface, error)\n```\n\n```go\nfunc (b *OpenshiftCLIClientBuilder) OpenshiftInternalUserClient() (userclientinternal.Interface, error)\n```\n\n","path":"github.phpd.cn/openshift/origin/pkg/cmd/util/clientcmd","name":"clientcmd","synopsis":"","isRedistributable":true}
