
This tag of hcsshim brings in a couple welcome features/improvements. One being exposing a way to query for hns endpoint statistics (Packets received/sent etc.). This tag also contains some optimizations for querying whether a certain HCN feature is supported, which is a common workflow in kube-proxy on Windows. The first result from querying HCN is now cached so further calls can skip the hcn query as well as the version range parsing that was performed. This also gets rid of some redundant logs that used to hit everytime the version range parsing occurred. The Go-winio dep bump, and all of the ctrd deps are transitive only. Nothing new is needed/intended to be used. Signed-off-by: Daniel Canter <dcanter@microsoft.com>
51 lines
2.7 KiB
Go
51 lines
2.7 KiB
Go
// Package computestorage is a wrapper around the HCS storage APIs. These are new storage APIs introduced
|
|
// separate from the original graphdriver calls intended to give more freedom around creating
|
|
// and managing container layers and scratch spaces.
|
|
package computestorage
|
|
|
|
import (
|
|
hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2"
|
|
)
|
|
|
|
//go:generate go run ../mksyscall_windows.go -output zsyscall_windows.go storage.go
|
|
|
|
//sys hcsImportLayer(layerPath string, sourceFolderPath string, layerData string) (hr error) = computestorage.HcsImportLayer?
|
|
//sys hcsExportLayer(layerPath string, exportFolderPath string, layerData string, options string) (hr error) = computestorage.HcsExportLayer?
|
|
//sys hcsDestroyLayer(layerPath string) (hr error) = computestorage.HcsDestoryLayer?
|
|
//sys hcsSetupBaseOSLayer(layerPath string, handle windows.Handle, options string) (hr error) = computestorage.HcsSetupBaseOSLayer?
|
|
//sys hcsInitializeWritableLayer(writableLayerPath string, layerData string, options string) (hr error) = computestorage.HcsInitializeWritableLayer?
|
|
//sys hcsAttachLayerStorageFilter(layerPath string, layerData string) (hr error) = computestorage.HcsAttachLayerStorageFilter?
|
|
//sys hcsDetachLayerStorageFilter(layerPath string) (hr error) = computestorage.HcsDetachLayerStorageFilter?
|
|
//sys hcsFormatWritableLayerVhd(handle windows.Handle) (hr error) = computestorage.HcsFormatWritableLayerVhd?
|
|
//sys hcsGetLayerVhdMountPath(vhdHandle windows.Handle, mountPath **uint16) (hr error) = computestorage.HcsGetLayerVhdMountPath?
|
|
//sys hcsSetupBaseOSVolume(layerPath string, volumePath string, options string) (hr error) = computestorage.HcsSetupBaseOSVolume?
|
|
|
|
// LayerData is the data used to describe parent layer information.
|
|
type LayerData struct {
|
|
SchemaVersion hcsschema.Version `json:"SchemaVersion,omitempty"`
|
|
Layers []hcsschema.Layer `json:"Layers,omitempty"`
|
|
}
|
|
|
|
// ExportLayerOptions are the set of options that are used with the `computestorage.HcsExportLayer` syscall.
|
|
type ExportLayerOptions struct {
|
|
IsWritableLayer bool `json:"IsWritableLayer,omitempty"`
|
|
}
|
|
|
|
// OsLayerType is the type of layer being operated on.
|
|
type OsLayerType string
|
|
|
|
const (
|
|
// OsLayerTypeContainer is a container layer.
|
|
OsLayerTypeContainer OsLayerType = "Container"
|
|
// OsLayerTypeVM is a virtual machine layer.
|
|
OsLayerTypeVM OsLayerType = "Vm"
|
|
)
|
|
|
|
// OsLayerOptions are the set of options that are used with the `SetupBaseOSLayer` and
|
|
// `SetupBaseOSVolume` calls.
|
|
type OsLayerOptions struct {
|
|
Type OsLayerType `json:"Type,omitempty"`
|
|
DisableCiCacheOptimization bool `json:"DisableCiCacheOptimization,omitempty"`
|
|
SkipUpdateBcdForBoot bool `json:"SkipUpdateBcdForBoot,omitempty"`
|
|
}
|