kubernetesk8s.io/kubernetes/pkg/kubectl/categories Index | Files

package categories

import "k8s.io/kubernetes/pkg/kubectl/categories"

Index

Functions

func NewDiscoveryCategoryExpander

func NewDiscoveryCategoryExpander(fallbackExpander CategoryExpander, client discovery.DiscoveryInterface) (discoveryCategoryExpander, error)

NewDiscoveryCategoryExpander returns a category expander that makes use of the "categories" fields from the API, found through the discovery client. In case of any error or no category found (which likely means we're at a cluster prior to categories support, fallback to the expander provided.

func NewDiscoveryFilteredExpander

func NewDiscoveryFilteredExpander(delegate CategoryExpander, client discovery.DiscoveryInterface) (discoveryFilteredExpander, error)

NewDiscoveryFilteredExpander returns a category expander that filters the returned groupresources by what the server has available

Types

type CategoryExpander

type CategoryExpander interface {
	Expand(category string) ([]schema.GroupResource, bool)
}
var LegacyCategoryExpander CategoryExpander = SimpleCategoryExpander{
	Expansions: map[string][]schema.GroupResource{
		"all": legacyUserResources,
	},
}

LegacyCategoryExpander is the old hardcoded expansion

type SimpleCategoryExpander

type SimpleCategoryExpander struct {
	Expansions map[string][]schema.GroupResource
}

func (SimpleCategoryExpander) Expand

func (e SimpleCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)

type UnionCategoryExpander

type UnionCategoryExpander []CategoryExpander

func (UnionCategoryExpander) Expand

func (u UnionCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)

Source Files

categories.go

Version
v1.9.5
Published
Mar 17, 2018
Platform
js/wasm
Imports
2 packages
Last checked
4 minutes ago

Tools for package owners.