discovery

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

package discovery implements a way to retrieve discovery information from Kubernetes to determine whether resources are namespace or cluster scoped.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServerResourceInspector

type APIServerResourceInspector struct {
	// contains filtered or unexported fields
}

APIServerResourceInspector implements ResourceInspector using the Kubernetes discovery API. It relies on a Kubernetes apiserver that has discovery information for all inputted resource types.

func NewAPIServerResourceInspector

func NewAPIServerResourceInspector(cfg *rest.Config) (*APIServerResourceInspector, error)

func (*APIServerResourceInspector) AddGVKToScope

func (a *APIServerResourceInspector) AddGVKToScope(gvk schema.GroupVersionKind, namespaced bool)

func (*APIServerResourceInspector) IsCoreGroup

func (a *APIServerResourceInspector) IsCoreGroup(group string) bool

func (*APIServerResourceInspector) IsNamespaced

type LocalResourceInspector

type LocalResourceInspector struct {
	// contains filtered or unexported fields
}

LocalResourceInspector implements ResourceInspector using local manifests

func NewLocalResourceInspector

func NewLocalResourceInspector() (*LocalResourceInspector, error)

func (*LocalResourceInspector) AddGVKToScope

func (l *LocalResourceInspector) AddGVKToScope(gvk schema.GroupVersionKind, namespaced bool)

func (*LocalResourceInspector) IsCoreGroup

func (l *LocalResourceInspector) IsCoreGroup(group string) bool

func (*LocalResourceInspector) IsNamespaced

func (l *LocalResourceInspector) IsNamespaced(gvk schema.GroupVersionKind) (bool, error)

type ResourceInspector

type ResourceInspector interface {
	// IsNamespaced returns true if the given GroupVersionKind is for a
	// namespace-scoped object.
	IsNamespaced(schema.GroupVersionKind) (bool, error)
	// AddGVKToScope adds GVK scope mapping to discovery
	AddGVKToScope(schema.GroupVersionKind, bool)
	// IsCoreGroup returns true if group is core
	IsCoreGroup(string) bool
}

Jump to

Keyboard shortcuts

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