Documentation ¶
Index ¶
- func ClusterCompletionFunc(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ContextCompletionFunc(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func CreateApplyAnnotation(obj runtime.Object, codec runtime.Encoder) error
- func CreateOrUpdateAnnotation(createAnnotation bool, obj runtime.Object, codec runtime.Encoder) error
- func GetModifiedConfiguration(obj runtime.Object, annotate bool, codec runtime.Encoder) ([]byte, error)
- func GetOriginalConfiguration(obj runtime.Object) ([]byte, error)
- func HashObject(obj runtime.Object, codec runtime.Codec) (string, error)
- func ListClustersInConfig(toComplete string) []string
- func ListContextsInConfig(toComplete string) []string
- func ListUsersInConfig(toComplete string) []string
- func LookupContainerPortNumberByName(pod v1.Pod, name string) (int32, error)
- func LookupContainerPortNumberByServicePort(svc v1.Service, pod v1.Pod, port int32) (int32, error)
- func LookupServicePortNumberByName(svc v1.Service, name string) (int32, error)
- func ParseFileSource(source string) (keyName, filePath string, err error)
- func ParseLiteralSource(source string) (keyName, value string, err error)
- func ParseRFC3339(s string, nowFn func() metav1.Time) (metav1.Time, error)
- func PodResourceNameAndContainerCompletionFunc(f cmdutil.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
- func ResourceNameCompletionFunc(f cmdutil.Factory, resourceType string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
- func ResourceTypeAndNameCompletionFunc(f cmdutil.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
- func SetFactoryForCompletion(f cmdutil.Factory)
- func SpecifiedResourceTypeAndNameCompletionFunc(f cmdutil.Factory, allowedTypes []string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
- func Umask(mask int) (old int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterCompletionFunc ¶ added in v0.22.0
func ClusterCompletionFunc(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ClusterCompletionFunc is a completion function that completes as a first argument the cluster names that match the toComplete prefix
func ContextCompletionFunc ¶ added in v0.22.0
func ContextCompletionFunc(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ContextCompletionFunc is a completion function that completes as a first argument the context names that match the toComplete prefix
func CreateApplyAnnotation ¶
CreateApplyAnnotation gets the modified configuration of the object, without embedding it again, and then sets it on the object as the annotation.
func CreateOrUpdateAnnotation ¶
func CreateOrUpdateAnnotation(createAnnotation bool, obj runtime.Object, codec runtime.Encoder) error
CreateOrUpdateAnnotation creates the annotation used by kubectl apply only when createAnnotation is true Otherwise, only update the annotation when it already exists
func GetModifiedConfiguration ¶
func GetModifiedConfiguration(obj runtime.Object, annotate bool, codec runtime.Encoder) ([]byte, error)
GetModifiedConfiguration retrieves the modified configuration of the object. If annotate is true, it embeds the result as an annotation in the modified configuration. If an object was read from the command input, it will use that version of the object. Otherwise, it will use the version from the server.
func GetOriginalConfiguration ¶
GetOriginalConfiguration retrieves the original configuration of the object from the annotation, or nil if no annotation was found.
func HashObject ¶
HashObject returns the hash of a Object hash by a Codec
func ListClustersInConfig ¶ added in v0.22.0
ListClustersInConfig returns a list of cluster names which begin with `toComplete`
func ListContextsInConfig ¶ added in v0.22.0
ListContextsInConfig returns a list of context names which begin with `toComplete`
func ListUsersInConfig ¶ added in v0.22.0
ListUsersInConfig returns a list of user names which begin with `toComplete`
func LookupContainerPortNumberByName ¶
LookupContainerPortNumberByName find containerPort number by its named port name
func LookupContainerPortNumberByServicePort ¶
LookupContainerPortNumberByServicePort implements the handling of resolving container named port, as well as ignoring targetPort when clusterIP=None It returns an error when a named port can't find a match (with -1 returned), or when the service does not declare such port (with the input port number returned).
func LookupServicePortNumberByName ¶
LookupServicePortNumberByName find service port number by its named port name
func ParseFileSource ¶
ParseFileSource parses the source given.
Acceptable formats include: 1. source-path: the basename will become the key name 2. source-name=source-path: the source-name will become the key name and source-path is the path to the key file.
Key names cannot include '='.
func ParseLiteralSource ¶
ParseLiteralSource parses the source key=val pair into its component pieces. This functionality is distinguished from strings.SplitN(source, "=", 2) since it returns an error in the case of empty keys, values, or a missing equals sign.
func ParseRFC3339 ¶
ParseRFC3339 parses an RFC3339 date in either RFC3339Nano or RFC3339 format.
func PodResourceNameAndContainerCompletionFunc ¶ added in v0.22.0
func PodResourceNameAndContainerCompletionFunc(f cmdutil.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
PodResourceNameAndContainerCompletionFunc Returns a completion function that completes as a first argument pod names that match the toComplete prefix, and as a second argument the containers within the specified pod.
func ResourceNameCompletionFunc ¶ added in v0.22.0
func ResourceNameCompletionFunc(f cmdutil.Factory, resourceType string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
ResourceNameCompletionFunc Returns a completion function that completes as a first argument the resource names specified by the resourceType parameter, and which match the toComplete prefix.
func ResourceTypeAndNameCompletionFunc ¶ added in v0.22.0
func ResourceTypeAndNameCompletionFunc(f cmdutil.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
ResourceTypeAndNameCompletionFunc Returns a completion function that completes as a first argument the resource types that match the toComplete prefix, and as a second argument the resource names that match the toComplete prefix.
func SetFactoryForCompletion ¶ added in v0.22.0
SetFactoryForCompletion Store the factory which is needed by the completion functions Not all commands have access to the factory, so cannot pass it to the completion functions.
func SpecifiedResourceTypeAndNameCompletionFunc ¶ added in v0.22.0
func SpecifiedResourceTypeAndNameCompletionFunc(f cmdutil.Factory, allowedTypes []string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
SpecifiedResourceTypeAndNameCompletionFunc Returns a completion function that completes as a first argument the resource types that match the toComplete prefix and are limited to the allowedTypes, and as a second argument the specified resource names that match the toComplete prefix.
Types ¶
This section is empty.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package openapi is a collection of libraries for fetching the openapi spec from a Kubernetes server and then indexing the type definitions.
|
Package openapi is a collection of libraries for fetching the openapi spec from a Kubernetes server and then indexing the type definitions. |