Skip to content

Commit

Permalink
revert: remove legacy engines from the flow (#157)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinandan Purkait <[email protected]>
  • Loading branch information
Abhinandan-Purkait authored Mar 21, 2024
1 parent 2e58733 commit 9d8d2fd
Show file tree
Hide file tree
Showing 85 changed files with 604 additions and 10,284 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.18.3
uses: actions/setup-go@v2
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.18.3
id: go_3
go-version: 1.19.9
cache: false

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run Deps Check
run: make verify-deps
Expand All @@ -23,14 +23,14 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.18.3
uses: actions/setup-go@v2
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.18.3
id: go
go-version: 1.19.9
cache: false

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Build Openebsctl
run: make openebsctl
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v4
with:
version: v1.46.2
version: v1.54
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.18.3
go-version: 1.19.9
cache: false
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-go@v2
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: '1.17.7'
go-version: 1.19.9
cache: false
- name: Run coverage
run: go test ./... --coverprofile=coverage.out --covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
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
}
4 changes: 2 additions & 2 deletions cmd/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os"

"github.com/spf13/cobra"
"k8s.io/klog"
"k8s.io/klog/v2"
)

const (
Expand Down Expand Up @@ -49,7 +49,7 @@ func NewCmdCompletion(rootCmd *cobra.Command) *cobra.Command {
cmd := &cobra.Command{
Use: "completion",
ValidArgs: []string{"bash", "zsh"},
Args: cobra.ExactValidArgs(1),
Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
Short: "Outputs shell completion code for the specified shell (bash or zsh)",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
},
Expand Down
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
}
Loading

0 comments on commit 9d8d2fd

Please sign in to comment.