mappings

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultResourceLists

func DefaultResourceLists() ([]*metav1.APIResourceList, error)

DefaultResourceLists returns APIResourceLists which can be used in a fake discovery client.

func GenerateMappings

func GenerateMappings(cmd *cobra.Command, _ []string) error

GenerateMappings connects to a Kubernetes cluster and discovers the available api-resources, printing out that information as a YAML list of APIMappings. The cluster connected to follows the usual conventions, eg it can be set with the KUBECONFIG environment variable. This function is meant to be used inside of a cobra-style CLI.

func ResourceLists

func ResourceLists(mappings []APIMapping) []*metav1.APIResourceList

ResourceLists takes a list of APIMappings and uses them to populate APIResourceLists which can be used in a fake discovery client.

Types

type APIMapping

type APIMapping struct {
	Group    string
	Version  string
	Kind     string
	Singular string
	Plural   string
	Scope    Scope
}

APIMapping stores information required for mapping between GroupVersionKinds and GroupVersionResources, as well as whether the API is namespaced.

func (APIMapping) String

func (a APIMapping) String() string

type Scope

type Scope string

func (Scope) Name

func (s Scope) Name() meta.RESTScopeName

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL