oras

package
v0.0.0-...-c83555f Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEnableLogging = true
)

Functions

func Init

func Init(logLevel int) error

func NewSettings

func NewSettings(volumeContext map[string]string) (orasSettings, error)

NewSettings parses volume attributes and returns the settings

Types

type Mounter

type Mounter struct {
	MounterInterface
}

func (*Mounter) IsMounted

func (m *Mounter) IsMounted(destPath string, testRun bool) (bool, error)

func (*Mounter) Mount

func (m *Mounter) Mount(sourcePath, destPath, mountType string, opts ...string) error

func (*Mounter) UMount

func (m *Mounter) UMount(destPath string) error

type MounterInterface

type MounterInterface interface {
	// Mount an artifact as a volume
	Mount(sourcePath string, destPath, mountType string, opts ...string) error

	// Unmount an artifact as a volume
	UMount(destPath string) error

	// Verify mount
	IsMounted(destPath string, testRun bool) (bool, error)
}

type OrasHandler

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

func NewOrasHandler

func NewOrasHandler(rootPath, pluginDataPath string, enforceNamespaces bool, name string, num ...int) *OrasHandler

NewOrasHandler creates a new oras handles to mount a container URI, pulled once

func (*OrasHandler) BindMount

func (mnt *OrasHandler) BindMount(source string, target string, options ...string) error

func (*OrasHandler) BindUMount

func (mnt *OrasHandler) BindUMount(target string) error

func (*OrasHandler) CreateMountVolume

func (mnt *OrasHandler) CreateMountVolume(volumeId string) error

func (*OrasHandler) CreateVolume

func (mnt *OrasHandler) CreateVolume(volumeId string, size int64) error

func (*OrasHandler) DeleteVolume

func (mnt *OrasHandler) DeleteVolume(volumeId string) error

Delete a volume (this isn't currently used, we need to design concept of cleanup)

func (*OrasHandler) HostPathTo

func (mnt *OrasHandler) HostPathTo(to string) string

func (*OrasHandler) HostPathToLogs

func (mnt *OrasHandler) HostPathToLogs() string

func (*OrasHandler) HostPathToMountVolume

func (mnt *OrasHandler) HostPathToMountVolume(volumeId string) string

func (*OrasHandler) HostPathToVolume

func (mnt *OrasHandler) HostPathToVolume(volumeId string) string

HostPathToVolume returns absoluthe path to given volumeId on host mountpoint

func (*OrasHandler) HostPluginDataPath

func (mnt *OrasHandler) HostPluginDataPath() string

func (*OrasHandler) OrasPathToVolume

func (mnt *OrasHandler) OrasPathToVolume(settings orasSettings) (string, error)

OrasPathToVolume ensures the artifact exists, and returns it

func (*OrasHandler) OrasPull

func (mnt *OrasHandler) OrasPull(artifactRoot string, settings orasSettings) error

Pull the oras container to the plugin data directory Derived from https://github.com/sajayantony/csi-driver-host-path/blob/1bcc9d435d0c3ccd93fa1855e8669aad0f3bd1b5/pkg/oci/oci.go We are working on this plugin together

func (*OrasHandler) SetOrasLogging

func (mnt *OrasHandler) SetOrasLogging()

SetOrasLogging sets up logging for the oras plugin

Jump to

Keyboard shortcuts

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