inventory

package
v0.26.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWrongInventoryKey occurs when a stored object has been read,
	// which doesn't follow the expected format.
	// This can only happen through an incompatible change, like editing the inventory directly.
	ErrWrongInventoryKey     = errors.New("Inventory key is incorrect")
	ErrManifestFieldNotFound = errors.New("Manifest field not found")
)

Functions

This section is empty.

Types

type HelmReleaseItem

type HelmReleaseItem struct {
	Name      string
	Namespace string
	ID        string
}

HelmReleaseItem is a small inventory representation of a Release. Release is a running instance of a Chart. When a chart is installed, the ChartReconciler creates a release to track that installation.

func (*HelmReleaseItem) GetID

func (hr *HelmReleaseItem) GetID() string

GetID returns the string representation of the release. This is used as an identifier in the inventory.

func (*HelmReleaseItem) GetName

func (hr *HelmReleaseItem) GetName() string

func (*HelmReleaseItem) GetNamespace

func (hr *HelmReleaseItem) GetNamespace() string

type Instance

type Instance struct {
	Path string
}

Instance is a representation of an inventory. It can store, delete and read items. The object does not include the storage itself, it only holds a reference to the storage.

func (Instance) DeleteItem

func (instance Instance) DeleteItem(item Item) error

DeleteItem removes the item from the inventory. Navecd will not be tracking its current state anymore.

func (Instance) GetItem

func (instance Instance) GetItem(item Item) (io.ReadCloser, error)

GetItem opens the item file for reading. If there is an error, it will be of type *PathError.

func (*Instance) Load

func (instance *Instance) Load() (*Storage, error)

Load returns all the stored components in this inventory.

func (Instance) StoreItem

func (instance Instance) StoreItem(item Item, contentReader io.Reader) error

StoreItem persists given item with optional content in the inventory.

type Item

type Item interface {
	GetName() string
	GetNamespace() string
	// GetID returns a unique identifier.
	GetID() string
}

Item is a small representation of a stored object.

type ManifestItem

type ManifestItem struct {
	TypeMeta  v1.TypeMeta
	Name      string
	Namespace string
	ID        string
}

ManifestItem a small inventory representation of a ManifestItem. ManifestItem is a Kubernetes object.

func (*ManifestItem) GetID

func (manifest *ManifestItem) GetID() string

GetID returns the string representation of the manifest. This is used as an identifier in the inventory.

func (*ManifestItem) GetName

func (manifest *ManifestItem) GetName() string

func (*ManifestItem) GetNamespace

func (manifest *ManifestItem) GetNamespace() string

type Storage

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

Storage represents all stored Navecd items. It is effectively the current cluster state.

func (Storage) HasItem

func (inv Storage) HasItem(item Item) bool

HasItem evaluates whether an item is part of the current cluster state.

func (Storage) Items

func (inv Storage) Items() map[string]Item

Items returns all stored Navecd items.

Jump to

Keyboard shortcuts

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