bundle

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownBundleFormat = fmt.Errorf("unknown bundle format")

ErrUnknownBundleFormat is returned when bundle cannot be loaded.

Functions

func DetectServiceSubnetRange

func DetectServiceSubnetRange(b Bundle) (string, error)

DetectServiceSubnetRange attempts to determine service ip range value provided to k8s api server, so that local version can be launched with same argument. So far the function tries to parse value from `kube-apiserver` pod. Other potential locations for parsing this value: - CAPI cluster resource - KIND kubeadm config.

func LoadCRDs

LoadCRDs gets CRDs stored in the bundle.

func LoadConfigMap added in v0.0.3

func LoadConfigMap(bundle afero.Fs, path string) (*unstructured.Unstructured, error)

LoadConfigMap loads configmap data from special struct that support-bundle uses to store CMs in.

func LoadResourcesFromFile

func LoadResourcesFromFile(bundle afero.Fs, path string) (*unstructured.UnstructuredList, error)

LoadResourcesFromFile tries to k8s API resources from a given file. It supports resources stored as List kind or YAML array of separate resources.

func LoadSecret added in v0.0.3

func LoadSecret(bundle afero.Fs, path string) (*unstructured.Unstructured, error)

LoadSecret loads secret from special struct that support-bundle uses to store Secrets in. It leaves the data empty.

Types

type Bundle

type Bundle interface {
	afero.Fs

	Layout() Layout
}

Bundle is representing support bundle data.

func New

func New(path string) (Bundle, error)

New creates bundle representation from given path. It supports reading extracted bundle from directory or `tar.gz` archive, which is automatically extracted to a temporary folder.

type Layout

type Layout interface {
	ClusterInfo() string
	ClusterResources() string
	PodLogs() string
	ConfigMaps() string
	Secrets() string
}

Layout defines paths under which are particular resources stored.

Jump to

Keyboard shortcuts

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