ocm

package
v0.11.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (

	// ProductDescriptionType defines the type of the ProductDescription resource in the component version.
	ProductDescriptionType = "productdescription.mpas.ocm.software"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements the OCM fetcher interface.

func NewClient

func NewClient(client client.Client) *Client

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

func (*Client) CreateAuthenticatedOCMContext

func (c *Client) CreateAuthenticatedOCMContext(ctx context.Context, serviceAccountName, namespace string) (ocm.Context, error)

CreateAuthenticatedOCMContext authenticates the client using a service account.

func (*Client) GetComponentVersion

func (c *Client) GetComponentVersion(_ context.Context, octx ocm.Context, url, 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) GetProductDescription

func (c *Client) GetProductDescription(_ context.Context, _ ocm.Context, cv ocm.ComponentVersionAccess) ([]byte, error)

func (*Client) GetResourceData

func (c *Client) GetResourceData(ctx context.Context, cv ocm.ComponentVersionAccess, ref v1alpha1.ResourceReference) ([]byte, error)

type Contract

type Contract interface {
	CreateAuthenticatedOCMContext(ctx context.Context, serviceAccountName, namespace string) (ocm.Context, error)
	GetComponentVersion(ctx context.Context, octx ocm.Context, url, name, version string) (ocm.ComponentVersionAccess, error)
	GetProductDescription(ctx context.Context, octx ocm.Context, cv ocm.ComponentVersionAccess) ([]byte, error)
	GetResourceData(ctx context.Context, cv ocm.ComponentVersionAccess, ref v1alpha1.ResourceReference) ([]byte, error)
}

Contract defines a subset of capabilities from the OCM library.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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