containerfs

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSpecialMountType

func IsSpecialMountType(mntType string) bool

func ReadHostCustomCADir

func ReadHostCustomCADir(path string) (
	certsToFileName map[string]string,
	symlinks map[string]string,
	rerr error,
)

Types

type ContainerFS

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

ContainerFS is a vfs-like abstraction for operating on a container's filesystem without needing to actually create all the mounts and unmount them (which can be expensive).

func NewContainerFS

func NewContainerFS(spec *specs.Spec, executeContainer ExecuteContainerFunc) (*ContainerFS, error)

func (*ContainerFS) AnyPathExists

func (ctrFS *ContainerFS) AnyPathExists(paths []string) (bool, error)

func (*ContainerFS) DirIsEmpty

func (ctrFS *ContainerFS) DirIsEmpty(path string) (bool, error)
func (ctrFS *ContainerFS) EvaluateSymlinks(name string) (string, error)

func (*ContainerFS) Exec

func (ctrFS *ContainerFS) Exec(ctx context.Context, args ...string) error

func (*ContainerFS) LookPath

func (ctrFS *ContainerFS) LookPath(cmd string) (string, error)

func (*ContainerFS) Lstat

func (ctrFS *ContainerFS) Lstat(name string) (fs.FileInfo, error)

func (*ContainerFS) MkdirAll

func (ctrFS *ContainerFS) MkdirAll(path string, perm fs.FileMode) (createdDir string, rerr error)

MkdirAll is like os.MkdirAll but returns the uppermost container parent dir that was created

func (*ContainerFS) MtimeOf

func (ctrFS *ContainerFS) MtimeOf(path string) (int64, error)

func (*ContainerFS) OSReleaseFileContains

func (ctrFS *ContainerFS) OSReleaseFileContains(ids [][]byte, idLikes [][]byte) (bool, error)

func (*ContainerFS) Open

func (ctrFS *ContainerFS) Open(name string) (fs.File, error)

func (*ContainerFS) OpenFile

func (ctrFS *ContainerFS) OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)

func (*ContainerFS) PathExists

func (ctrFS *ContainerFS) PathExists(path string) (bool, error)

func (*ContainerFS) ReadCABundleFile

func (ctrFS *ContainerFS) ReadCABundleFile(path string) (map[string]struct{}, error)

Returned map is keyed with the contents of each cert in the bundle, with all newlines stripped. The bundle file is presumed to have the format of each cert separated by a blank line.

func (*ContainerFS) ReadCustomCADir

func (ctrFS *ContainerFS) ReadCustomCADir(path string) (
	certsToFileName map[string]string,
	symlinks map[string]string,
	rerr error,
)

func (*ContainerFS) ReadDir

func (ctrFS *ContainerFS) ReadDir(name string) ([]fs.DirEntry, error)

func (*ContainerFS) ReadFile

func (ctrFS *ContainerFS) ReadFile(path string) ([]byte, error)
func (ctrFS *ContainerFS) Readlink(name string) (string, error)

func (*ContainerFS) Remove

func (ctrFS *ContainerFS) Remove(path string) error

func (*ContainerFS) RemoveAll

func (ctrFS *ContainerFS) RemoveAll(path string) error

func (*ContainerFS) RemoveCertsFromCABundle

func (ctrFS *ContainerFS) RemoveCertsFromCABundle(path string, certs map[string]string) error

func (*ContainerFS) SetMtime

func (ctrFS *ContainerFS) SetMtime(path string, t int64) error

func (*ContainerFS) Stat

func (ctrFS *ContainerFS) Stat(name string) (fs.FileInfo, error)
func (ctrFS *ContainerFS) Symlink(oldname, newname string) error

func (*ContainerFS) WriteFile

func (ctrFS *ContainerFS) WriteFile(path string, data []byte, perm fs.FileMode) error

type ExecuteContainerFunc

type ExecuteContainerFunc func(ctx context.Context, args ...string) error

Jump to

Keyboard shortcuts

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