bundle

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 15 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 DetectServiceNodePortRange added in v0.0.18

func DetectServiceNodePortRange(b Bundle) (string, error)

DetectServiceNodePortRange attempts to determine service node port range value provided to k8s api server, so that local version can be launched with same argument.

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 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, YAML array of separate resources, JSON array of resources and JSON stored item list without TypeMeta information. The result will be returned as `UnstructuredList` but the items could be missing GVK information. It is up to caller to add GVK to each item before further processing.

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 FromFs added in v0.0.11

func FromFs(fs afero.Fs) Bundle

FromFs allows to create bundle form provided afero.Fs.

func New

func New(path string) (Bundle, error)

New creates bundle representation from given path. It supports reading extracted bundle from a directory or a `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