Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "csc", Short: "a command line container storage interface (CSI) client", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if debug { root.logLevel.Set(log.DebugLevel.String()) root.withReqLogging = true root.withReqLogging = true } lvl, _ := root.logLevel.Val() log.SetLevel(lvl) if debug { log.Warn("debug mode enabled") } root.ctx = context.Background() log.Debug("assigned the root context") if root.format == "" { switch cmd.Name() { case listVolumesCmd.Name(): if listVolumes.paging { root.format = volumeInfoFormat } else { root.format = listVolumesFormat } case createVolumeCmd.Name(): root.format = volumeInfoFormat case supportedVersCmd.Name(): root.format = supportedVersionsFormat case pluginInfoCmd.Name(): root.format = pluginInfoFormat } } if root.format != "" { tpl, err := template.New("t").Parse(root.format) if err != nil { return err } root.tpl = tpl } root.userCreds = gocsi.ParseMap(os.Getenv("X_CSI_USER_CREDENTIALS")) opts := []grpc.DialOption{ grpc.WithDialer( func(target string, timeout time.Duration) (net.Conn, error) { proto, addr, err := gocsi.ParseProtoAddr(target) if err != nil { return nil, err } return net.DialTimeout(proto, addr, timeout) }), } if root.insecure { opts = append(opts, grpc.WithInsecure()) } if o := getClientInterceptorsDialOpt(); o != nil { opts = append(opts, o) } ctx, cancel := context.WithTimeout(root.ctx, root.timeout) defer cancel() client, err := grpc.DialContext(ctx, root.endpoint, opts...) if err != nil { return err } root.client = client return nil }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Source Files ¶
- controller.go
- controller_create_volume.go
- controller_delete_volume.go
- controller_get_capabilities.go
- controller_get_capacity.go
- controller_list_volumes.go
- controller_probe.go
- controller_publish_volume.go
- controller_unpublish_volume.go
- controller_validate_volume_capabilities.go
- flags.go
- formats.go
- identity.go
- identity_getplugininfo.go
- identity_supportedversions.go
- interceptors.go
- node.go
- node_get_capabilities.go
- node_get_id.go
- node_probe.go
- node_publish_volume.go
- node_unpublish_volume.go
- root.go
- usage.go
- vartypes.go
Click to show internal directories.
Click to hide internal directories.