Help us shape the future of Go! Take the 2026 Go Developer Survey

cmd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Copyright 2020 NetApp, Inc. All Rights Reserved.

Copyright 2019 NetApp, Inc. All Rights Reserved.

Index

Constants

View Source
const (
	PreferredNamespace = tridentconfig.OrchestratorName
	DefaultPVCName     = tridentconfig.OrchestratorName
	DefaultPVName      = tridentconfig.OrchestratorName

	// CRD names
	BackendCRDName      = "tridentbackends.trident.netapp.io"
	NodeCRDName         = "tridentnodes.trident.netapp.io"
	StorageClassCRDName = "tridentstorageclasses.trident.netapp.io"
	TransactionCRDName  = "tridenttransactions.trident.netapp.io"
	VersionCRDName      = "tridentversions.trident.netapp.io"
	VolumeCRDName       = "tridentvolumes.trident.netapp.io"
	SnapshotCRDName     = "tridentsnapshots.trident.netapp.io"

	NamespaceFilename          = "trident-namespace.yaml"
	ServiceAccountFilename     = "trident-serviceaccount.yaml"
	ClusterRoleFilename        = "trident-clusterrole.yaml"
	ClusterRoleBindingFilename = "trident-clusterrolebinding.yaml"
	DeploymentFilename         = "trident-deployment.yaml"
	ServiceFilename            = "trident-service.yaml"
	DaemonSetFilename          = "trident-daemonset.yaml"
	CRDsFilename               = "trident-crds.yaml"
	PodSecurityPolicyFilename  = "trident-podsecuritypolicy.yaml"
)
View Source
const (
	FormatJSON = "json"
	FormatName = "name"
	FormatWide = "wide"
	FormatYAML = "yaml"

	ModeDirect  = "direct"
	ModeTunnel  = "tunnel"
	ModeInstall = "install"

	CLIKubernetes = "kubectl"
	CLIOpenshift  = "oc"

	PodServer = "127.0.0.1:8000"

	ExitCodeSuccess = 0
	ExitCodeFailure = 1

	TridentLegacyLabelKey   = "app"
	TridentLegacyLabelValue = "trident.netapp.io"
	TridentLegacyLabel      = TridentLegacyLabelKey + "=" + TridentLegacyLabelValue

	TridentCSILabelKey   = "app"
	TridentCSILabelValue = "controller.csi.trident.netapp.io"
	TridentCSILabel      = TridentCSILabelKey + "=" + TridentCSILabelValue

	TridentNodeLabelKey   = "app"
	TridentNodeLabelValue = "node.csi.trident.netapp.io"
	TridentNodeLabel      = TridentNodeLabelKey + "=" + TridentNodeLabelValue

	TridentInstallerLabelKey   = "app"
	TridentInstallerLabelValue = "trident-installer.netapp.io"
	TridentInstallerLabel      = TridentInstallerLabelKey + "=" + TridentInstallerLabelValue

	TridentMigratorLabelKey   = "app"
	TridentMigratorLabelValue = "trident-migrator.netapp.io"
	TridentMigratorLabel      = TridentMigratorLabelKey + "=" + TridentMigratorLabelValue
)

Variables

View Source
var (
	OperatingMode       string
	KubernetesCLI       string
	TridentPodName      string
	TridentPodNamespace string
	ExitCode            int

	Debug        bool
	Server       string
	OutputFormat string
)
View Source
var RootCmd = &cobra.Command{
	SilenceUsage: true,
	Use:          "tridentctl",
	Short:        "A CLI tool for NetApp Trident",
	Long:         `A CLI tool for managing the NetApp Trident external storage provisioner for Kubernetes`,
}

Functions

func BaseURL

func BaseURL() string

func GetBackend

func GetBackend(backendName string) (storage.BackendExternal, error)

func GetBackendByBackendUUID

func GetBackendByBackendUUID(backendUUID string) (storage.BackendExternal, error)

func GetBackends

func GetBackends() ([]string, error)

func GetErrorFromHTTPResponse

func GetErrorFromHTTPResponse(response *http.Response, responseBody []byte) error

func GetExitCodeFromError

func GetExitCodeFromError(err error) int

func GetNode

func GetNode(nodeName string) (*utils.Node, error)

func GetNodes

func GetNodes() ([]string, error)

func GetSnapshot

func GetSnapshot(snapshotID string) (storage.SnapshotExternal, error)

func GetSnapshots

func GetSnapshots(volume string) ([]string, error)

func GetStorageClass

func GetStorageClass(storageClassName string) (api.StorageClass, error)

func GetStorageClasses

func GetStorageClasses() ([]string, error)

func GetVolume

func GetVolume(volumeName string) (storage.VolumeExternal, error)

func GetVolumes

func GetVolumes() ([]string, error)

func SetExitCodeFromError

func SetExitCodeFromError(err error)

func TunnelCommand

func TunnelCommand(commandArgs []string)

func TunnelCommandRaw

func TunnelCommandRaw(commandArgs []string) ([]byte, error)

func WriteBackends

func WriteBackends(backends []storage.BackendExternal)

func WriteJSON

func WriteJSON(out interface{})

func WriteNodes

func WriteNodes(nodes []utils.Node)

func WriteSnapshots

func WriteSnapshots(snapshots []storage.SnapshotExternal)

func WriteStorageClasses

func WriteStorageClasses(storageClasses []api.StorageClass)

func WriteVolumes

func WriteVolumes(volumes []storage.VolumeExternal)

func WriteYAML

func WriteYAML(out interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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