nfs

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDFormat       = "nfs-%s"
	FilenameFormat = "linstor-gateway-nfs-%s.toml"
)
View Source
const (
	ExportBasePath = "/srv/gateway-exports"
	DefaultNFSPort = 2049
	CurrentVersion = 1
)

Variables

View Source
var (
	UuidNFS      = uuid.NewSHA1(uuid.Nil, []byte("nfs.gateway.linstor.linbit.com"))
	AllowAllCidr = []common.IpCidr{
		{IPNet: net.IPNet{IP: net.IPv6zero, Mask: net.CIDRMask(0, 128)}},
		{IPNet: net.IPNet{IP: net.IPv4zero, Mask: net.CIDRMask(0, 32)}},
	}
)

Functions

func ExportPath

func ExportPath(rsc *ResourceConfig, vol *VolumeConfig) string

ExportPath returns the full path under which the resource is exported.

Types

type NFS

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

func New

func New(controllers []string) (*NFS, error)

func (*NFS) Create

func (n *NFS) Create(ctx context.Context, rsc *ResourceConfig) (*ResourceConfig, error)

Create creates an NFS export according to the resource configuration described in rsc. It automatically prepends a "cluster private volume" to the list of volumes, so volume numbers must start at 1.

func (*NFS) Delete

func (n *NFS) Delete(ctx context.Context, name string) error

func (*NFS) DeleteVolume

func (n *NFS) DeleteVolume(ctx context.Context, name string, lun int) (*ResourceConfig, error)

func (*NFS) Get

func (n *NFS) Get(ctx context.Context, name string) (*ResourceConfig, error)

func (*NFS) List

func (n *NFS) List(ctx context.Context) ([]*ResourceConfig, error)

func (*NFS) Start

func (n *NFS) Start(ctx context.Context, name string) (*ResourceConfig, error)

func (*NFS) Stop

func (n *NFS) Stop(ctx context.Context, name string) (*ResourceConfig, error)

type ResourceConfig

type ResourceConfig struct {
	Name          string                `json:"name"`
	ServiceIP     common.IpCidr         `json:"service_ip,omitempty"`
	AllowedIPs    []common.IpCidr       `json:"allowed_ips,omitempty"`
	ResourceGroup string                `json:"resource_group"`
	Volumes       []VolumeConfig        `json:"volumes"`
	Status        common.ResourceStatus `json:"status"`
	GrossSize     bool                  `json:"gross_size"`
}

func FromPromoter

func FromPromoter(cfg *reactor.PromoterConfig, definition *client.ResourceDefinition, volumeDefinition []client.VolumeDefinition) (*ResourceConfig, error)

func (*ResourceConfig) FillDefaults

func (r *ResourceConfig) FillDefaults()

func (*ResourceConfig) ID

func (r *ResourceConfig) ID() string

func (*ResourceConfig) Matches

func (r *ResourceConfig) Matches(o *ResourceConfig) bool

func (*ResourceConfig) ToPromoter

func (r *ResourceConfig) ToPromoter(deployment []client.ResourceWithVolumes) (*reactor.PromoterConfig, error)

func (*ResourceConfig) Valid

func (r *ResourceConfig) Valid() error

func (*ResourceConfig) VolumeConfig

func (r *ResourceConfig) VolumeConfig(number int) *common.Volume

type VolumeConfig

type VolumeConfig struct {
	common.VolumeConfig
	ExportPath string `json:"export_path"`
}

VolumeConfig adds an export path in addition to the LINSTOR common.VolumeConfig.

Jump to

Keyboard shortcuts

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