Documentation
¶
Index ¶
- Constants
- Variables
- func BaseAutosupportURL() string
- func BaseURL() string
- func CreateOpenShiftTridentSCC(user, appLabelVal string) error
- func DeleteGroupSnapshot(groupID string) error
- func DeleteOpenShiftTridentSCC(user, labelVal string) error
- func GenPatchedBashCompletionScript(cmd *cobra.Command, cobraPoweredPlugins []string, originalScript string) string
- func GenPatchedZshCompletionScript(cmd *cobra.Command, cobraPoweredPlugins []string, originalScript string) string
- func GetAutogrowPolicies() ([]string, error)
- func GetAutogrowPolicy(autogrowPolicyName string) (storage.AutogrowPolicyExternal, error)
- func GetBackend(backendName string) (storage.BackendExternal, error)
- func GetBackendByBackendUUID(backendUUID string) (storage.BackendExternal, error)
- func GetBackends() ([]string, error)
- func GetCobraPoweredPlugins() []string
- func GetErrorFromHTTPResponse(response *http.Response, responseBody []byte) error
- func GetExitCodeFromError(err error) int
- func GetGroupSnapshot(groupID string) (storage.GroupSnapshotExternal, error)
- func GetGroupSnapshots() ([]string, error)
- func GetNode(nodeName string) (*models.NodeExternal, error)
- func GetNodes() ([]string, error)
- func GetSnapshot(snapshotID string) (storage.SnapshotExternal, error)
- func GetSnapshots(url string) ([]string, error)
- func GetStorageClass(storageClassName string) (api.StorageClass, error)
- func GetStorageClasses() ([]string, error)
- func GetVolume(volumeName string) (storage.VolumeExternal, error)
- func GetVolumePublication(volumeName, nodeName string) (*models.VolumePublicationExternal, error)
- func GetVolumes() ([]string, error)
- func ObliviateCRDs(kubeClientVal k8sclient.KubernetesClient, crdClientsetVal crdclient.Interface, ...) error
- func SetExitCodeFromError(err error)
- func TunnelCommand(commandArgs []string) ([]byte, error)
- func WriteAutogrowPolicies(autogrowPolicies []storage.AutogrowPolicyExternal)
- func WriteBackends(backends []storage.BackendExternal)
- func WriteGroupSnapshots(groupSnapshots []storage.GroupSnapshotExternal)
- func WriteJSON(out interface{})
- func WriteNodes(nodes []models.NodeExternal)
- func WriteSnapshots(snapshots []storage.SnapshotExternal)
- func WriteStorageClasses(storageClasses []api.StorageClass)
- func WriteVolumeMove(tvm *netappv1.TridentVolumeMove)
- func WriteVolumeMoves(moves []*netappv1.TridentVolumeMove)
- func WriteVolumePublications(pubs []models.VolumePublicationExternal)
- func WriteVolumes(volumes []storage.VolumeExternal)
- func WriteYAML(out interface{})
- type ImageList
- type ImageSet
Constants ¶
const ( PreferredNamespace = tridentconfig.OrchestratorName // CRD names ActionMirrorUpdateCRDName = "tridentactionmirrorupdates.trident.netapp.io" ActionSnapshotRestoreCRDName = "tridentactionsnapshotrestores.trident.netapp.io" BackendConfigCRDName = "tridentbackendconfigs.trident.netapp.io" BackendCRDName = "tridentbackends.trident.netapp.io" MirrorRelationshipCRDName = "tridentmirrorrelationships.trident.netapp.io" NodeCRDName = "tridentnodes.trident.netapp.io" NodeRemediationCRDName = "tridentnoderemediations.trident.netapp.io" NodeRemediationTemplateCRDName = "tridentnoderemediationtemplates.trident.netapp.io" SnapshotCRDName = "tridentsnapshots.trident.netapp.io" SnapshotInfoCRDName = "tridentsnapshotinfos.trident.netapp.io" GroupSnapshotCRDName = "tridentgroupsnapshots.trident.netapp.io" StorageClassCRDName = "tridentstorageclasses.trident.netapp.io" TransactionCRDName = "tridenttransactions.trident.netapp.io" VersionCRDName = "tridentversions.trident.netapp.io" VolumeCRDName = "tridentvolumes.trident.netapp.io" VolumePublicationCRDName = "tridentvolumepublications.trident.netapp.io" VolumeReferenceCRDName = "tridentvolumereferences.trident.netapp.io" ConfiguratorCRDName = "tridentconfigurators.trident.netapp.io" AutogrowPolicyCRDName = "tridentautogrowpolicies.trident.netapp.io" AutogrowRequestInternalCRDName = "tridentautogrowrequestinternals.trident.netapp.io" VolumeMoveCRDName = "tridentvolumemoves.trident.netapp.io" ControllerRoleFilename = "trident-controller-role.yaml" ControllerClusterRoleFilename = "trident-controller-clusterrole.yaml" ControllerRoleBindingFilename = "trident-controller-rolebinding.yaml" ControllerServiceAccountFilename = "trident-controller-serviceaccount.yaml" ControllerClusterRoleBindingFilename = "trident-controller-clusterrolebinding.yaml" ControllerSCCFilename = "trident-controller-scc.yaml" NodeLinuxRoleFilename = "trident-node-linux-role.yaml" NodeLinuxRoleBindingFilename = "trident-node-linux-rolebinding.yaml" NodeLinuxServiceAccountFilename = "trident-node-linux-serviceaccount.yaml" NodeLinuxSCCFilename = "trident-node-linux-scc.yaml" NodeLinuxClusterRoleFilename = "trident-node-linux-clusterrole.yaml" NodeLinuxClusterRoleBindingFilename = "trident-node-linux-clusterrolebinding.yaml" NodeWindowsRoleFilename = "trident-node-windows-role.yaml" NodeWindowsRoleBindingFilename = "trident-node-windows-rolebinding.yaml" NodeWindowsServiceAccountFilename = "trident-node-windows-serviceaccount.yaml" NodeWindowsSCCFilename = "trident-node-windows-scc.yaml" NodeWindowsClusterRoleFilename = "trident-node-windows-clusterrole.yaml" NodeWindowsClusterRoleBindingFilename = "trident-node-windows-clusterrolebinding.yaml" CRDsFilename = "trident-crds.yaml" DaemonSetFilename = "trident-daemonset.yaml" WindowsDaemonSetFilename = "trident-windows-daemonset.yaml" DeploymentFilename = "trident-deployment.yaml" NamespaceFilename = "trident-namespace.yaml" ServiceFilename = "trident-service.yaml" ResourceQuotaFilename = "trident-resourcequota.yaml" NodeRemediationTemplateFilename = "trident-node-remediation-template.yaml" NodeRemediationClusterRoleFilename = "trident-node-remediation-clusterrole.yaml" TridentEncryptionKeys = "trident-encryption-keys" TridentCSI = "trident-csi" TridentMainContainer = "trident-main" TridentControllerResourceName = "trident-controller" TridentNodeLinuxResourceName = "trident-node-linux" TridentNodeWindowsResourceName = "trident-node-windows" CSIDriver = "csi.trident.netapp.io" )
const ( FormatJSON = "json" FormatName = "name" FormatWide = "wide" FormatYAML = "yaml" FormatMarkdown = "markdown" ModeDirect = "direct" ModeTunnel = "tunnel" ModeInstall = "install" CLIKubernetes = "kubectl" CLIOpenshift = "oc" PodServer = "127.0.0.1:8000" PodAutosupportCollector = "127.0.0.1:8003" ExitCodeSuccess = 0 ExitCodeFailure = 1 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 TridentPersistentObjectLabelKey = "object" TridentPersistentObjectLabelValue = "persistent.trident.netapp.io" TridentPersistentObjectLabel = TridentPersistentObjectLabelKey + "=" + TridentPersistentObjectLabelValue TridentOperatorLabelKey = "app" TridentOperatorLabelValue = "operator.trident.netapp.io" TridentOperatorLabel = TridentOperatorLabelKey + "=" + TridentOperatorLabelValue AutosupportCollectorURL = "/autosupport/v1" )
const (
RequestTimeout = 5 * time.Second
)
Variables ¶
var ( OperatingMode string KubernetesCLI string TridentPodName string TridentPodNamespace string KubeConfigPath string ExitCode int Debug bool LogLevel string Server string AutosupportCollector string OutputFormat string )
var ( CRDnames = []string{ ActionMirrorUpdateCRDName, BackendConfigCRDName, BackendCRDName, MirrorRelationshipCRDName, NodeCRDName, NodeRemediationCRDName, NodeRemediationTemplateCRDName, VolumeReferenceCRDName, SnapshotCRDName, GroupSnapshotCRDName, SnapshotInfoCRDName, StorageClassCRDName, TransactionCRDName, VersionCRDName, VolumeCRDName, VolumePublicationCRDName, ActionSnapshotRestoreCRDName, ConfiguratorCRDName, AutogrowPolicyCRDName, AutogrowRequestInternalCRDName, VolumeMoveCRDName, } )
var (
K8sVersion string
)
var Log1 = logging.Log
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`, }
var TunnelCommandRaw = func(commandArgs []string) ([]byte, []byte, error) { execCommand := []string{"exec", TridentPodName, "-n", TridentPodNamespace, "-c", config.ContainerTrident, "--"} cliCommand := []string{"tridentctl"} cliCommand = append(cliCommand, commandArgs...) execCommand = append(execCommand, cliCommand...) if Debug { fmt.Printf("Invoking tunneled command: %s %v\n", KubernetesCLI, strings.Join(execCommand, " ")) } cmd := execKubernetesCLIRaw(execCommand...) var outbuff, stderrBuff bytes.Buffer cmd.Stdout = &outbuff cmd.Stderr = &stderrBuff err := cmd.Run() SetExitCodeFromError(err) return outbuff.Bytes(), stderrBuff.Bytes(), err }
Functions ¶
func BaseAutosupportURL ¶
func BaseAutosupportURL() string
func CreateOpenShiftTridentSCC ¶
CreateOpenShiftTridentSCC creates an SCC solely for use with the trident user. This only works for OpenShift.
func DeleteGroupSnapshot ¶
func DeleteOpenShiftTridentSCC ¶
DeleteOpenShiftTridentSCC deletes the trident-only SCC that the trident user uses. This only works for OpenShift.
func GetAutogrowPolicies ¶
func GetAutogrowPolicy ¶
func GetAutogrowPolicy(autogrowPolicyName string) (storage.AutogrowPolicyExternal, error)
func GetBackend ¶
func GetBackend(backendName string) (storage.BackendExternal, error)
func GetBackendByBackendUUID ¶
func GetBackendByBackendUUID(backendUUID string) (storage.BackendExternal, error)
func GetBackends ¶
func GetCobraPoweredPlugins ¶
func GetCobraPoweredPlugins() []string
GetCobraPoweredPlugins collect cobra-powered plugins to check if the plugin is a cobra plugin we run the plugin with argument "__complete -- @@@@" and compare the output with the cobraOutputSuffix string
func GetExitCodeFromError ¶
func GetGroupSnapshot ¶
func GetGroupSnapshot(groupID string) (storage.GroupSnapshotExternal, error)
GetGroupSnapshot retrieves a concrete group snapshot by ID from Trident.
func GetGroupSnapshots ¶
GetGroupSnapshots retrieves all group snapshots from Trident.
func GetSnapshot ¶
func GetSnapshot(snapshotID string) (storage.SnapshotExternal, error)
func GetSnapshots ¶
func GetStorageClass ¶
func GetStorageClass(storageClassName string) (api.StorageClass, error)
func GetStorageClasses ¶
func GetVolumePublication ¶
func GetVolumePublication(volumeName, nodeName string) (*models.VolumePublicationExternal, error)
func GetVolumes ¶
func ObliviateCRDs ¶
func ObliviateCRDs( kubeClientVal k8sclient.KubernetesClient, crdClientsetVal crdclient.Interface, operatorCrdClientSetVal operatorCrdClient.Interface, timeout time.Duration, skipCRDs []string, ) error
func SetExitCodeFromError ¶
func SetExitCodeFromError(err error)
func TunnelCommand ¶
func WriteAutogrowPolicies ¶
func WriteAutogrowPolicies(autogrowPolicies []storage.AutogrowPolicyExternal)
func WriteBackends ¶
func WriteBackends(backends []storage.BackendExternal)
func WriteGroupSnapshots ¶
func WriteGroupSnapshots(groupSnapshots []storage.GroupSnapshotExternal)
func WriteNodes ¶
func WriteNodes(nodes []models.NodeExternal)
func WriteSnapshots ¶
func WriteSnapshots(snapshots []storage.SnapshotExternal)
func WriteStorageClasses ¶
func WriteStorageClasses(storageClasses []api.StorageClass)
func WriteVolumeMove ¶
func WriteVolumeMove(tvm *netappv1.TridentVolumeMove)
WriteVolumeMove displays a single TridentVolumeMove using the global output format.
func WriteVolumeMoves ¶
func WriteVolumeMoves(moves []*netappv1.TridentVolumeMove)
WriteVolumeMoves displays one or more TridentVolumeMove resources.
func WriteVolumePublications ¶
func WriteVolumePublications(pubs []models.VolumePublicationExternal)
func WriteVolumes ¶
func WriteVolumes(volumes []storage.VolumeExternal)
Types ¶
Source Files
¶
- check.go
- check_operator.go
- completion.go
- create.go
- create_backend.go
- create_volume_move.go
- delete.go
- delete_backend.go
- delete_groupsnapshot.go
- delete_node.go
- delete_snapshot.go
- delete_storageclass.go
- delete_volume.go
- get.go
- get_autogrowpolicy.go
- get_backend.go
- get_groupsnapshot.go
- get_logconfig.go
- get_node.go
- get_publication.go
- get_snapshot.go
- get_storageclass.go
- get_volume.go
- images.go
- import.go
- import_volume.go
- install.go
- logs.go
- obliviate.go
- obliviate_crd.go
- obliviate_secret.go
- pause.go
- plugins.go
- root.go
- send.go
- send_autosupport.go
- system_linux.go
- uninstall.go
- update.go
- update_backend.go
- update_backend_state.go
- update_logconfig.go
- update_node.go
- update_volume.go
- version.go