Documentation
¶
Overview ¶
Package converter is responsible for converting the types registered with a k8s server to schemas which can be used by the UI (and other consumers) to discover the resources available and the current user's permissions.
Index ¶
- func GVKToSchemaID(gvk schema.GroupVersionKind) string
- func GVKToVersionedSchemaID(gvk schema.GroupVersionKind) string
- func GVRToPluralName(gvr schema.GroupVersionResource) string
- func GetGVKForKind(kind *proto.Kind) *schema.GroupVersionKind
- func GetGVKForProtoSchema(protoSchema proto.Schema) *schema.GroupVersionKind
- func ToSchemas(crd v1.CustomResourceDefinitionClient, client discovery.DiscoveryInterface) (map[string]*types.APISchema, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GVKToSchemaID ¶
func GVKToSchemaID(gvk schema.GroupVersionKind) string
func GVKToVersionedSchemaID ¶
func GVKToVersionedSchemaID(gvk schema.GroupVersionKind) string
func GVRToPluralName ¶
func GVRToPluralName(gvr schema.GroupVersionResource) string
func GetGVKForKind ¶ added in v0.3.0
func GetGVKForKind(kind *proto.Kind) *schema.GroupVersionKind
GetGVKForKind attempts to retrieve a GVK for a given Kind. Not all kind represent top level resources, so this function may return nil if the kind did not have a gvk extension
func GetGVKForProtoSchema ¶ added in v0.3.0
func GetGVKForProtoSchema(protoSchema proto.Schema) *schema.GroupVersionKind
GetGVKForProto attempts to retrieve a GVK for a given OpenAPI V2 schema object. The GVK is defined in an extension. It is possible that the protoSchema does not have the GVK extension set - in that case, we return nil.
func ToSchemas ¶
func ToSchemas(crd v1.CustomResourceDefinitionClient, client discovery.DiscoveryInterface) (map[string]*types.APISchema, error)
ToSchemas creates the schemas for a K8s server, using client to discover groups/resources, and crd to potentially add additional information about new fields/resources. Mostly ties together addDiscovery and addCustomResources.
Types ¶
This section is empty.