ocm

package
v0.0.1-dev Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 20 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructRepositoryName

func ConstructRepositoryName(identity v1alpha1.Identity) (string, error)

ConstructRepositoryName hashes the name and passes it back.

Types

type Client

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

Client implements the OCM fetcher interface.

func NewClient

func NewClient(client client.Client, cache cache.Cache) *Client

NewClient creates a new fetcher Client using the provided k8s client.

func (*Client) GetComponentVersion

func (c *Client) GetComponentVersion(ctx context.Context, obj *v1alpha1.ComponentVersion, name, version string) (ocm.ComponentVersionAccess, error)

GetComponentVersion returns a component version. It's the caller's responsibility to clean it up and close the component version once done with it.

func (*Client) GetLatestComponentVersion added in v0.1.0

func (c *Client) GetLatestComponentVersion(ctx context.Context, obj *v1alpha1.ComponentVersion) (string, error)

func (*Client) GetResource

func (c *Client) GetResource(ctx context.Context, cv *v1alpha1.ComponentVersion, resource v1alpha1.ResourceRef) (io.ReadCloser, string, error)

GetResource returns a reader for the resource data. It is the responsibility of the caller to close the reader.

func (*Client) ListComponentVersions

func (c *Client) ListComponentVersions(octx ocm.Context, obj *v1alpha1.ComponentVersion) ([]Version, error)

func (*Client) VerifyComponent

func (c *Client) VerifyComponent(ctx context.Context, obj *v1alpha1.ComponentVersion, version string) (bool, error)

type FetchVerifier added in v0.1.0

type FetchVerifier interface {
	Verifier
	Fetcher
}

FetchVerifier can fetch and verify components.

type Fetcher added in v0.1.0

type Fetcher interface {
	GetResource(ctx context.Context, cv *v1alpha1.ComponentVersion, resource v1alpha1.ResourceRef) (io.ReadCloser, string, error)
	GetComponentVersion(ctx context.Context, obj *v1alpha1.ComponentVersion, name, version string) (ocm.ComponentVersionAccess, error)
	GetLatestComponentVersion(ctx context.Context, obj *v1alpha1.ComponentVersion) (string, error)
	ListComponentVersions(ctx ocm.Context, obj *v1alpha1.ComponentVersion) ([]Version, error)
}

Fetcher gets information about an OCM component Version based on a k8s component Version.

type Verifier added in v0.1.0

type Verifier interface {
	VerifyComponent(ctx context.Context, obj *v1alpha1.ComponentVersion, version string) (bool, error)
}

Verifier takes a Component and runs OCM verification on it.

type Version

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

Version has two values to be able to sort a list but still return the actual Version. The Version might contain a `v`.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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