Skip to content

Commit

Permalink
chore: remove legacy engines from the flow
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinandan Purkait <[email protected]>
  • Loading branch information
Abhinandan-Purkait committed Mar 13, 2024
1 parent 2e58733 commit b49ef67
Show file tree
Hide file tree
Showing 79 changed files with 143 additions and 9,977 deletions.
72 changes: 0 additions & 72 deletions .tours/first.tour

This file was deleted.

39 changes: 14 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ OpenEBSCTL is a kubectl plugin to manage OpenEBS storage components.
## Project Status

**Alpha**. Under active development and seeking [contributions from the community](#contributing).
The CLI currently supports managing `cStor`, `Jiva`, `LocalPV-LVM`, `LocalPV-ZFS` Cas-Engines.
The CLI currently supports managing `LocalPV-LVM`, `LocalPV-ZFS` and `LocalPV-HostPath` Engines.

## Table of Contents
* [Installation](#installation)
Expand Down Expand Up @@ -59,44 +59,33 @@ OpenEBSCTL is available on Linux, macOS and Windows platforms.
- `cd openebsctl`
- Run `make openebsctl`
## Code Walkthrough
1. Install [vscode](https://code.visualstudio.com/)
2. Install [CodeTour plugin](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) on vscode
3. Open this project on vscode & press `[ctrl] + [shift] + [p]` or `[command] + [shift] + [p]` and click `CodeTour: Open The Tour File` and locate the appropriate `*.tour` file. The code walkthrough will begin. Happy Contributing!
## Usage
* ```bash
$ kubectl openebs
openebs is a a kubectl plugin for interacting with OpenEBS storage components such as storage(pools, volumegroups), volumes, blockdevices, pvcs.
kubectl openebs is a a kubectl plugin for interacting with OpenEBS storage components such as storage(zfspools, volumegroups), volumes, pvcs.
Find out more about OpenEBS on https://openebs.io/
Usage:
kubectl openebs [command] [resource] [...names] [flags]
openebs [command]
Available Commands:
completion Outputs shell completion code for the specified shell (bash or zsh)
describe Provide detailed information about an OpenEBS resource
get Provides fetching operations related to a Volume/Pool
help Help about any command
version Shows openebs kubectl plugin's version
cluster-info Show component version, status and running components for each installed engine
completion Outputs shell completion code for the specified shell (bash or zsh)
describe Provide detailed information about an OpenEBS resource
get Provides fetching operations related to a Volume/Storage
help Help about any command
version Shows openebs kubectl plugin's version

Flags:
-h, --help help for openebs
-n, --namespace string If present, the namespace scope for this CLI request
--openebs-namespace string to read the openebs namespace from user.
If not provided it is determined from components.
--cas-type to specify the cas-type of the engine, for engine based filtering.
ex- cstor, jiva, localpv-lvm, localpv-zfs.
--debug to launch the debugging mode for cstor pvcs.
-h, --help help for openebs
-c, --kubeconfig string path to config file
-v, --version version for openebs

Use "kubectl openebs command --help" for more information about a command.
Use "openebs [command] --help" for more information about a command.
```
* To know more about various engine specific commands check these:-
* [cStor](docs/cstor/README.md)
* [Jiva](docs/jiva/README.md)
* [LocalPV-LVM](docs/localpv-lvm/README.md)
* [LocalPV-ZFS](docs/localpv-zfs/README.md)
Expand Down
9 changes: 0 additions & 9 deletions cmd/clusterinfo/cluster-info.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ import (
"github.com/spf13/cobra"
)

const (
clusterInfoCmdHelp = `Usage:
kubectl openebs cluster-info
Flags:
-h, --help help for openebs get command
`
)

// NewCmdClusterInfo shows OpenEBSCTL cluster-info
func NewCmdClusterInfo(rootCmd *cobra.Command) *cobra.Command {
cmd := &cobra.Command{
Expand All @@ -39,6 +31,5 @@ func NewCmdClusterInfo(rootCmd *cobra.Command) *cobra.Command {
util.CheckErr(clusterinfo.ShowClusterInfo(), util.Fatal)
},
}
cmd.SetUsageTemplate(clusterInfoCmdHelp)
return cmd
}
29 changes: 1 addition & 28 deletions cmd/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,17 @@ import (
"github.com/spf13/cobra"
)

const (
volumeCommandHelpText = `Show detailed description of a specific OpenEBS resource:
Usage:
kubectl openebs describe [volume|storage|pvc] [...names] [flags]
Describe a Volume:
kubectl openebs describe volume [...names] [flags]
Describe PVCs present in the same namespace:
kubectl openebs describe pvc [...names] [flags]
Describe a Storage :
kubectl openebs describe storage [...names] [flags]
Flags:
-h, --help help for openebs
-n, --namespace string to read the namespace for the pvc.
--openebs-namespace string to read the openebs namespace from user.
If not provided it is determined from components.
--cas-type to specify the cas-type of the engine, for engine based filtering.
ex- cstor, jiva, localpv-lvm, localpv-zfs.
--debug to launch the debugging mode for cstor pvcs.
`
)

// NewCmdDescribe provides options for managing OpenEBS Volume
func NewCmdDescribe(rootCmd *cobra.Command) *cobra.Command {
cmd := &cobra.Command{
Use: "describe",
ValidArgs: []string{"pool", "volume", "pvc"},
ValidArgs: []string{"storage", "volume", "pvc"},
Short: "Provide detailed information about an OpenEBS resource",
}
cmd.AddCommand(
NewCmdDescribeVolume(),
NewCmdDescribePVC(),
NewCmdDescribeStorage(),
)
cmd.SetUsageTemplate(volumeCommandHelpText)
return cmd
}
32 changes: 5 additions & 27 deletions cmd/describe/pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,10 @@ import (
"github.com/spf13/cobra"
)

var (
pvcInfoCommandHelpText = `This command fetches information and status of the various aspects
of the PersistentVolumeClaims and its underlying related resources
in the provided namespace. If no namespace is provided it uses default
namespace for execution.
Usage:
kubectl openebs describe pvc [...names] [flags]
Flags:
-h, --help help for openebs
-n, --namespace string to read the namespace for the pvc.
--openebs-namespace string to read the openebs namespace from user.
If not provided it is determined from components.
--debug to launch the debugging mode for cstor pvcs.
`
)

// NewCmdDescribePVC Displays the pvc describe details
func NewCmdDescribePVC() *cobra.Command {
var debug bool
var openebsNs string
var pvNs string
cmd := &cobra.Command{
Use: "pvc",
Aliases: []string{"pvcs", "persistentvolumeclaims", "persistentvolumeclaim"},
Expand All @@ -53,15 +36,10 @@ func NewCmdDescribePVC() *cobra.Command {
pvNs = "default"
}
openebsNamespace, _ = cmd.Flags().GetString("openebs-namespace")
if debug {
util.CheckErr(persistentvolumeclaim.Debug(args, pvNs, openebsNamespace), util.Fatal)
} else {
util.CheckErr(persistentvolumeclaim.Describe(args, pvNs, openebsNamespace), util.Fatal)
}

util.CheckErr(persistentvolumeclaim.Describe(args, pvNs, openebsNamespace), util.Fatal)
},
}
cmd.SetUsageTemplate(pvcInfoCommandHelpText)
cmd.Flags().BoolVar(&debug, "debug", false, "Debug cstor volume")
cmd.PersistentFlags().StringVarP(&openebsNs, "openebs-namespace", "", "", "to read the openebs namespace from user.\nIf not provided it is determined from components.")
cmd.PersistentFlags().StringVarP(&pvNs, "namespace", "n", "", "to read the namespace of the pvc from the user. If not provided defaults to default namespace.")
return cmd
}
22 changes: 4 additions & 18 deletions cmd/describe/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,18 @@ limitations under the License.
package describe

import (
"fmt"
"strings"

"github.com/openebs/openebsctl/pkg/storage"
"github.com/openebs/openebsctl/pkg/util"
"github.com/spf13/cobra"
)

var (
storageInfoCommandHelpText = `This command fetches information and status of the various aspects
of the openebs storage and its underlying related resources in the openebs namespace.
Usage:
kubectl openebs describe storage [...names] [flags]
Flags:
-h, --help help for openebs
--openebs-namespace string to read the openebs namespace from user.
If not provided it is determined from components.
--cas-type to specify the cas-type of the engine, for engine based filtering.
ex- cstor, jiva, localpv-lvm, localpv-zfs.
`
)

// NewCmdDescribeStorage displays OpenEBS storage related information.
func NewCmdDescribeStorage() *cobra.Command {
var casType string
var openebsNs string
cmd := &cobra.Command{
Use: "storage",
Aliases: []string{"storages", "s"},
Expand All @@ -54,7 +40,7 @@ func NewCmdDescribeStorage() *cobra.Command {
util.CheckErr(storage.Describe(args, openebsNs, casType), util.Fatal)
},
}
cmd.SetUsageTemplate(storageInfoCommandHelpText)
cmd.PersistentFlags().StringVarP(&casType, "cas-type", "", "", "the cas-type filter option for fetching resources")
cmd.PersistentFlags().StringVarP(&openebsNs, "openebs-namespace", "", "", "to read the openebs namespace from user.\nIf not provided it is determined from components.")
cmd.PersistentFlags().StringVarP(&casType, "cas-type", "", "", fmt.Sprintf("the type of the engine %s, %s", util.LVMCasType, util.ZFSCasType))
return cmd
}
19 changes: 2 additions & 17 deletions cmd/describe/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,18 @@ import (
"github.com/spf13/cobra"
)

var (
volumeInfoCommandHelpText = `This command fetches information and status of the various
aspects of a cStor Volume such as ISCSI, Controller, and Replica.
Usage:
kubectl openebs describe volume [...names] [flags]
Flags:
-h, --help help for openebs
-n, --namespace string to read the namespace for the pvc.
--openebs-namespace string to read the openebs namespace from user.
If not provided it is determined from components.
`
)

// NewCmdDescribeVolume displays OpenEBS Volume information.
func NewCmdDescribeVolume() *cobra.Command {
var openebsNs string
cmd := &cobra.Command{
Use: "volume",
Aliases: []string{"volumes", "vol", "v"},
Short: "Displays Openebs information",
Run: func(cmd *cobra.Command, args []string) {
// TODO: Get this from flags, pflag, etc
openebsNS, _ := cmd.Flags().GetString("openebs-namespace")
util.CheckErr(volume.Describe(args, openebsNS), util.Fatal)
},
}
cmd.SetUsageTemplate(volumeInfoCommandHelpText)
cmd.PersistentFlags().StringVarP(&openebsNs, "openebs-namespace", "", "", "to read the openebs namespace from user.\nIf not provided it is determined from components.")
return cmd
}
Loading

0 comments on commit b49ef67

Please sign in to comment.