manifest

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Overview

Package manifest manages content resources, which contain all the resources for a deployed bundle.

Content resources are not namespaced.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToSHA256ID added in v0.10.2

func ToSHA256ID(shasum string) string

ToSHA256ID generates a valid Kubernetes name (max length of 64) from a provided SHA256 sum

Types

type ContentStore added in v0.10.0

type ContentStore struct {
	Client client.Client
}

func NewStore

func NewStore(client client.Client) *ContentStore

func (*ContentStore) Store added in v0.10.0

func (c *ContentStore) Store(ctx context.Context, manifest *Manifest) error

Store stores the manifest as a content resource. It copies the resources from the bundle to the content resource.

type Lookup

type Lookup struct {
}

func NewLookup

func NewLookup() *Lookup

func (*Lookup) Get

func (l *Lookup) Get(ctx context.Context, client client.Reader, id string) (*Manifest, error)

type Manifest

type Manifest struct {
	Commit    string                 `json:"-"`
	Resources []fleet.BundleResource `json:"resources,omitempty"`
	// contains filtered or unexported fields
}

func FromBundle added in v0.10.0

func FromBundle(bundle *fleet.Bundle) *Manifest

func FromJSON added in v0.10.0

func FromJSON(data []byte, expectedSHAsum string) (*Manifest, error)

func New

func New(resources []fleet.BundleResource) *Manifest

func (*Manifest) Content

func (m *Manifest) Content() ([]byte, error)

Content retrieves the JSON serialization of the bundle resources

func (*Manifest) ID added in v0.10.0

func (m *Manifest) ID() (string, error)

ID returns the name of the Content resource produced from this Manifest. If necessary it loads the content resource and caches its shasum and raw data.

func (*Manifest) ResetSHASum added in v0.10.0

func (m *Manifest) ResetSHASum()

ResetSHASum removes stored data about calculated SHASum, forcing a recalculation on the next call to SHASum()

func (*Manifest) SHASum added in v0.10.0

func (m *Manifest) SHASum() (string, error)

SHASum returns the SHA256 sum of the JSON serialization. If necessary it loads the content resource and caches its shasum and raw data.

func (*Manifest) ToTarGZ

func (m *Manifest) ToTarGZ() (io.Reader, error)

Jump to

Keyboard shortcuts

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