host

package
v4.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package host defines a set of useful methods, which can help Connector to operate host information

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveNodeHostInfoToSecret

func SaveNodeHostInfoToSecret(ctx context.Context) error

SaveNodeHostInfoToSecret save the current node host information to secret. secret namespace use the namespace of the current pod.

Types

type NodeHostInfo

type NodeHostInfo struct {
	// HostName the name of host
	HostName string `json:"hostName"`
	// IscsiInitiator the initiator of ISCSI protocol
	IscsiInitiator string `json:"iscsiInitiator"`
	// FCInitiators the initiator of FC protocol
	FCInitiators []string `json:"fCInitiators"`
	// RoCEInitiator the initiator of RoCE protocol
	RoCEInitiator string `json:"roCEInitiator"`
}

NodeHostInfo defines the base information of node host

func GetNodeHostInfosFromSecret

func GetNodeHostInfosFromSecret(ctx context.Context, hostName string) (*NodeHostInfo, error)

GetNodeHostInfosFromSecret get the specified node host information from secret.

func NewNodeHostInfo

func NewNodeHostInfo(ctx context.Context) (*NodeHostInfo, error)

NewNodeHostInfo instantiates this node host info. If the initiator query fails, the error will not be returned directly, because the current host may not have an initiator, which should be judged by the caller and handled accordingly

Jump to

Keyboard shortcuts

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