pkgutil

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

README

This package was copied over from container-diff to remove our dependency on it. That project is too hard to maintain.

project: https://github.com/GoogleContainerTools/container-diff

commit: ae4befd09f92caf735cdd63794ae2fa9f2efc5e3

path: ./pkg/util

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTransport

func BuildTransport(registry Registry) http.RoundTripper

func CheckSameFile

func CheckSameFile(f1name, f2name string) (bool, error)
func CheckSameSymlink(f1name, f2name string) (bool, error)

func CheckTar

func CheckTar(image string) bool

func CleanFilePath

func CleanFilePath(dirtyPath string) string

CleanFilePath removes characters from a given path that cannot be used in paths by the underlying platform (e.g. Windows)

func CleanupImage

func CleanupImage(image Image)

func ConfigureTLS

func ConfigureTLS(skipTsVerifyRegistries []string, registriesToCertificates map[string]string)

func DirIsEmpty

func DirIsEmpty(path string) (bool, error)

given a path to a directory, check if it has any contents

func GetFileContents

func GetFileContents(path string) (*string, error)

GetFileContents returns the contents of a file at the specified path

func GetFileSystemForImage

func GetFileSystemForImage(image v1.Image, root string, whitelist []string) error

unpack image filesystem to local disk if provided directory is not empty, do nothing

func GetFileSystemForLayer

func GetFileSystemForLayer(layer v1.Layer, root string, whitelist []string) error

GetFileSystemForLayer unpacks a layer to local disk

func GetImageLayers

func GetImageLayers(pathToImage string) []string

func GetSize

func GetSize(path string) int64

func HasFilepathPrefix

func HasFilepathPrefix(path, prefix string) bool

HasFilepathPrefix checks if the given file path begins with prefix

func HasTag

func HasTag(image string) bool

checks to see if an image string contains a tag.

func IsTar

func IsTar(path string) bool

func RemoveTag

func RemoveTag(image string) string

returns a raw image name with the tag removed

func SortMap

func SortMap(m map[string]string) string

Types

type Directory

type Directory struct {
	Root    string
	Content []string
}

Directory stores a representation of a file directory.

func GetDirectory

func GetDirectory(path string, deep bool) (Directory, error)

GetDirectoryContents converts the directory starting at the provided path into a Directory struct.

type DirectoryEntry

type DirectoryEntry struct {
	Name string
	Size int64
}

func CreateDirectoryEntries

func CreateDirectoryEntries(root string, entryNames []string) (entries []DirectoryEntry)

func GetDirectoryEntries

func GetDirectoryEntries(d Directory) []DirectoryEntry

type Image

type Image struct {
	Image  v1.Image
	Source string
	FSPath string
	Digest v1.Hash
	Layers []Layer
}

func GetImage

func GetImage(imageName string, includeLayers bool, cacheDir string) (Image, error)

GetImage infers the source of an image and retrieves a v1.Image reference to it. Once a reference is obtained, it attempts to unpack the v1.Image's reader's contents into a temp directory on the local filesystem.

func GetImageForName

func GetImageForName(imageName string) (Image, error)

GetImageForName retrieves an image by name alone. It does not return layer information, or respect caching.

type ImageHistoryItem

type ImageHistoryItem struct {
	CreatedBy string `json:"created_by"`
}

type Layer

type Layer struct {
	FSPath string
	Digest v1.Hash
}

type OriginalPerm

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

Jump to

Keyboard shortcuts

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