Documentation ¶
Index ¶
- func CreateFQAPIs(pkg string, gvs map[string][]string) (apis []string)
- func GetCRDManifestPaths(crdsDir string) (crdPaths []string, err error)
- func GetCRDs(crdsDir string) ([]*apiextv1beta1.CustomResourceDefinition, error)
- func GetDisplayName(name string) string
- func GetKubeconfigAndNamespace(configPath string) (*rest.Config, string, error)
- func GetObjectBytes(obj interface{}, m MarshalFunc) ([]byte, error)
- func GetTypeMetaFromBytes(b []byte) (t metav1.TypeMeta, err error)
- func ParseGroupSubpackages(apisDir string) (map[string][]string, error)
- func ParseGroupVersions(apisDir string) (map[string][]string, error)
- type MarshalFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFQAPIs ¶
CreateFQAPIs return a slice of all fully qualified pkg + groups + versions of pkg and gvs in the format "pkg/groupA/v1".
func GetCRDManifestPaths ¶
GetCRDManifestPaths gets all CRD manifest paths in crdsDir and subdirs.
func GetCRDs ¶
func GetCRDs(crdsDir string) ([]*apiextv1beta1.CustomResourceDefinition, error)
GetCRDs parses all CRD manifests in the directory crdsDir and all of its subdirectories.
func GetDisplayName ¶
GetDisplayName turns a project dir name in any of {snake, chain, camel} cases, hierarchical dot structure, or space-delimited into a space-delimited, title'd display name. Ex. "another-_AppOperator_againTwiceThrice More" -> "Another App Operator Again Twice Thrice More"
func GetKubeconfigAndNamespace ¶
GetKubeconfigAndNamespace returns the *rest.Config and default namespace defined in the kubeconfig at the specified path. If no path is provided, returns the default *rest.Config and namespace
func GetObjectBytes ¶
func GetObjectBytes(obj interface{}, m MarshalFunc) ([]byte, error)
GetObjectBytes marshalls an object with m and removes runtime-managed fields: 'status', 'creationTimestamp'
func GetTypeMetaFromBytes ¶
GetTypeMetaFromBytes gets the type and object metadata from b. b is assumed to be a single Kubernetes resource manifest.
func ParseGroupSubpackages ¶
ParseGroupSubpackages parses the apisDir directory tree and returns a map of all found API groups to subpackages.