Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Mar 5, 2020
1 parent 824734b commit 5e7642e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ env:
nstall:
- go get -u golang.org/x/lint/golint
script:
- go build -o kubesql cmd/kubectl-sql/*.go
- go build -o kubectl-sql cmd/kubectl-sql/*.go
- golint cmd/kubectl-sql/*.go && golint pkg/cmd/*.go
- test -s $(gofmt -s -l cmd/kubectl-sql/*.go pkg/cmd/*.go)
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kubesql_pkg := $(wildcard ./pkg/cmd/*.go)
all: kubectl-sql

kubectl-sql: $(kubesql_cmd) $(kubesql_pkg)
go build -ldflags='-X github.com/yaacov/kubesql/pkg/cmd.clientVersion=${VERSION}' -o kubectl-sql $(kubesql_cmd)
go build -ldflags='-X github.com/yaacov/kubectl-sql/pkg/cmd.clientVersion=${VERSION}' -o kubectl-sql $(kubesql_cmd)

.PHONY: lint
lint:
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

[![Go Report Card](https://goreportcard.com/badge/github.com/yaacov/kubesql)](https://goreportcard.com/report/github.com/yaacov/kubesql)
[![Build Status](https://travis-ci.org/yaacov/kubesql.svg?branch=master)](https://travis-ci.org/yaacov/kubesql)
[![Go Report Card](https://goreportcard.com/badge/github.com/yaacov/kubectl-sql)](https://goreportcard.com/report/github.com/yaacov/kubectl-sql)
[![Build Status](https://travis-ci.org/yaacov/kubectl-sql.svg?branch=master)](https://travis-ci.org/yaacov/kubectl-sql)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

<p align="center">
<img src="https://raw.githubusercontent.com/yaacov/kubesql/master/img/kubesql-162.png" alt="kubectl-sql Logo">
<img src="https://raw.githubusercontent.com/yaacov/kubectl-sql/master/img/kubectl-sql-162.png" alt="kubectl-sql Logo">
</p>

# kubectl-sql
Expand Down Expand Up @@ -40,21 +40,21 @@

Using `go get` command:
``` bash
GO111MODULE=on go get -v github.com/yaacov/kubesql/cmd/kubectl-sql
GO111MODULE=on go get -v github.com/yaacov/kubectl-sql/cmd/kubectl-sql
```

Using Fedora Copr:

```
dnf copr enable yaacov/kubesql
dnf install kubesql
dnf copr enable yaacov/kubectl-sql
dnf install kubectl-sql
```

From source:

``` bash
git clone [email protected]:yaacov/kubesql.git
cd kubesql
git clone [email protected]:yaacov/kubectl-sql.git
cd kubectl-sql

make
```
Expand All @@ -79,7 +79,7 @@ Example:
kubectl-sql --all-namespaces get rs where "status.readyReplicas < status.replicas"
```

For other ways to select Kubernetes resources see [#Alternatives](https://github.com/yaacov/kubesql#alternatives).
For other ways to select Kubernetes resources see [#Alternatives](https://github.com/yaacov/kubectl-sql#alternatives).

#### Available Operators:

Expand Down Expand Up @@ -209,13 +209,13 @@ kubectl-sql --help
## Config File

Users can add aliases and edit the fields displayed in table view using json config files,
[see the example config file](https://github.com/yaacov/kubesql/blob/master/kubesql.json).
[see the example config file](https://github.com/yaacov/kubectl-sql/blob/master/kubectl-sql.json).

Flag: `--kubesql <config file path>` (default: `$HOME/.kube/kubesql.json`)
Flag: `--kubectl-sql <config file path>` (default: `$HOME/.kube/kubectl-sql.json`)

Example:
``` bash
kubectl-sql --kubesql ./kubesql.json get pods
kubectl-sql --kubectl-sql ./kubectl-sql.json get pods
...
```

Expand Down
2 changes: 1 addition & 1 deletion cmd/kubectl-sql/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/spf13/pflag"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/yaacov/kubesql/pkg/cmd"
"github.com/yaacov/kubectl-sql/pkg/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/yaacov/kubesql
module github.com/yaacov/kubectl-sql

go 1.13

Expand Down
72 changes: 0 additions & 72 deletions kubesql.json

This file was deleted.

77 changes: 0 additions & 77 deletions kubesql.spec

This file was deleted.

8 changes: 4 additions & 4 deletions pkg/cmd/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ func NewSQLOptions(streams genericclioptions.IOStreams) *SQLOptions {
outputFormat: "table",
}

// Look for a default kubesql.json config file.
// Look for a default kubectl-sql.json config file.
if home, err := os.UserHomeDir(); err == nil {
options.defaultSQLConfigPath = fmt.Sprintf("%s/.kube/kubesql.json", home)
options.defaultSQLConfigPath = fmt.Sprintf("%s/.kube/kubectl-sql.json", home)
}

return options
Expand Down Expand Up @@ -125,8 +125,8 @@ func NewCmdSQL(streams genericclioptions.IOStreams) *cobra.Command {

cmd.Flags().BoolVarP(&o.allNamespaces, "all-namespaces", "A", o.allNamespaces,
"If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.")
cmd.Flags().StringVarP(&o.requestedSQLConfigPath, "kubesql", "q", o.defaultSQLConfigPath,
"Path to the kubesql.json file to use for kubesql requests.")
cmd.Flags().StringVarP(&o.requestedSQLConfigPath, "kubectl-sql", "q", o.defaultSQLConfigPath,
"Path to the kubectl-sql.json file to use for kubectl-sql requests.")
cmd.Flags().StringVarP(&o.outputFormat, "output", "o", o.outputFormat,
"Output format. One of: json|yaml|table|name")

Expand Down

0 comments on commit 5e7642e

Please sign in to comment.