Skip to content

Commit

Permalink
chore: Rename project to kube-lineage
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Toh <tohjustin@hotmail.com>
  • Loading branch information
tohjustin committed Oct 3, 2021
1 parent 835a004 commit a8cd919
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ linters-settings:
- github.com/stretchr/testify/assert: "Use github.com/stretchr/testify/require instead."
- gotest.tools/v3: "Use github.com/stretchr/testify instead."
gci:
local-prefixes: github.com/tohjustin/kubectl-lineage
local-prefixes: github.com/tohjustin/kube-lineage
18 changes: 9 additions & 9 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
project_name: kubectl-lineage
project_name: kube-lineage
before:
hooks:
- go mod tidy
builds:
- binary: kubectl-lineage
main: ./cmd/kubectl-lineage
- binary: kube-lineage
main: ./cmd/kube-lineage
goos:
- darwin
- linux
Expand All @@ -19,12 +19,12 @@ builds:
- CGO_ENABLED=0
ldflags:
- -s -w
- -X github.com/tohjustin/kubectl-lineage/internal/version.gitMajor={{ .Env.GIT_VERSION_MAJOR }}
- -X github.com/tohjustin/kubectl-lineage/internal/version.gitMinor={{ .Env.GIT_VERSION_MINOR }}
- -X github.com/tohjustin/kubectl-lineage/internal/version.gitVersion={{ .Env.GIT_VERSION }}
- -X github.com/tohjustin/kubectl-lineage/internal/version.gitCommit={{ .Env.GIT_COMMIT }}
- -X github.com/tohjustin/kubectl-lineage/internal/version.gitTreeState={{ .Env.GIT_TREE_STATE }}
- -X github.com/tohjustin/kubectl-lineage/internal/version.buildDate={{ .Env.BUILD_DATE }}
- -X github.com/tohjustin/kube-lineage/internal/version.gitMajor={{ .Env.GIT_VERSION_MAJOR }}
- -X github.com/tohjustin/kube-lineage/internal/version.gitMinor={{ .Env.GIT_VERSION_MINOR }}
- -X github.com/tohjustin/kube-lineage/internal/version.gitVersion={{ .Env.GIT_VERSION }}
- -X github.com/tohjustin/kube-lineage/internal/version.gitCommit={{ .Env.GIT_COMMIT }}
- -X github.com/tohjustin/kube-lineage/internal/version.gitTreeState={{ .Env.GIT_TREE_STATE }}
- -X github.com/tohjustin/kube-lineage/internal/version.buildDate={{ .Env.BUILD_DATE }}
archives:
- files:
- LICENSE.md
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ test:

.PHONY: build
build:
go build $(GO_BUILD_ARGS) -o bin/kubectl-lineage ./cmd/kubectl-lineage
go build $(GO_BUILD_ARGS) -o bin/kube-lineage ./cmd/kube-lineage

.PHONY: install
install: build
install bin/kubectl-lineage $(shell go env GOPATH)/bin
install bin/kube-lineage $(shell go env GOPATH)/bin

.PHONY: release
RELEASE_ARGS?=release --rm-dist
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# kubectl-lineage
# kube-lineage

[![build](https://github.com/tohjustin/kubectl-lineage/actions/workflows/build.yaml/badge.svg)](https://github.com/tohjustin/kubectl-lineage/actions/workflows/build.yaml)
[![release](https://aegisbadges.appspot.com/static?subject=release&status=v0.2.0&color=318FE0)](https://github.com/tohjustin/kubectl-lineage/releases)
[![build](https://github.com/tohjustin/kube-lineage/actions/workflows/build.yaml/badge.svg)](https://github.com/tohjustin/kube-lineage/actions/workflows/build.yaml)
[![release](https://aegisbadges.appspot.com/static?subject=release&status=v0.2.0&color=318FE0)](https://github.com/tohjustin/kube-lineage/releases)
[![kubernetes compatibility](https://aegisbadges.appspot.com/static?subject=k8s%20compatibility&status=v1.19%2B&color=318FE0)](https://endoflife.date/kubernetes)
[![license](https://aegisbadges.appspot.com/static?subject=license&status=Apache-2.0&color=318FE0)](./LICENSE.md)

A kubectl plugin to display all dependents of a Kubernetes object.
A CLI tool to display all dependents of a Kubernetes object.

```shell
$ kubectl lineage deploy/coredns
$ kube-lineage deploy/coredns
NAME READY STATUS AGE
Deployment/coredns 1/1 30m
└── ReplicaSet/coredns-5d69dc75db 1/1 30m
└── Pod/coredns-5d69dc75db-26wjw 1/1 Running 30m
└── Service/kube-dns - 30m
└── EndpointSlice/kube-dns-pxh5w - 30m

$ kubectl lineage node k3d-dev-server-1 -o wide
$ kube-lineage node k3d-dev-server-1 -o wide
NAMESPACE NAME READY STATUS AGE RELATIONSHIPS
Node/k3d-dev-server-1 True KubeletReady 30m -
├── CSINode/k3d-dev-server-1 - 30m [OwnerReference]
Expand All @@ -28,7 +28,7 @@ monitoring-system └── Pod/kube-state-metrics-6cb9b94fdf-bkz22 1
monitoring-system └── Service/kube-state-metrics - 25m [Service]
monitoring-system └── EndpointSlice/kube-state-metrics-zkggx - 25m [ControllerReference OwnerReference]

$ kubectl lineage clusterrole/system:metrics-server -o wide
$ kube-lineage clusterrole/system:metrics-server -o wide
NAMESPACE NAME READY STATUS AGE RELATIONSHIPS
ClusterRole/system:metrics-server - 30m -
└── ClusterRoleBinding/system:metrics-server - 30m [ClusterRoleBindingRole]
Expand Down Expand Up @@ -58,16 +58,17 @@ List of supported relationships used for discovering dependent objects:
### Install from Source

```shell
git clone git@github.com:tohjustin/kubectl-lineage.git
git clone git@github.com:tohjustin/kube-lineage.git
make install

kubectl-lineage --version
kube-lineage --version
```

## Prior Art

kubectl-lineage has been inspired by the following projects:
kube-lineage has been inspired by the following projects:

- [ahmetb/kubectl-tree](https://github.com/ahmetb/kubectl-tree)
- [feloy/kubectl-service-tree](https://github.com/feloy/kubectl-service-tree)
- [nimakaviani/knative-inspect](https://github.com/nimakaviani/knative-inspect/)
- [steveteuber/kubectl-graph](https://github.com/steveteuber/kubectl-graph)
8 changes: 4 additions & 4 deletions cmd/kubectl-lineage/main.go → cmd/kube-lineage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/klog/v2"

"github.com/tohjustin/kubectl-lineage/pkg/cmd/lineage"
"github.com/tohjustin/kube-lineage/pkg/cmd/lineage"
)

func New(streams genericclioptions.IOStreams) *cobra.Command {
Expand All @@ -19,14 +19,14 @@ func New(streams genericclioptions.IOStreams) *cobra.Command {
}

func main() {
flags := pflag.NewFlagSet("kubectl-lineage", pflag.ExitOnError)
flags := pflag.NewFlagSet("kube-lineage", pflag.ExitOnError)
pflag.CommandLine = flags

streams := genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr}
root := New(streams)
rootCmd := New(streams)

klog.V(4).Infof("Version: %s", getVersion())
if err := root.Execute(); err != nil {
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"k8s.io/cli-runtime/pkg/genericclioptions"

lineage "github.com/tohjustin/kubectl-lineage/cmd/kubectl-lineage"
"github.com/tohjustin/kubectl-lineage/internal/version"
lineage "github.com/tohjustin/kube-lineage/cmd/kube-lineage"
"github.com/tohjustin/kube-lineage/internal/version"
)

func runCmd(args ...string) (string, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

"github.com/tohjustin/kubectl-lineage/internal/version"
"github.com/tohjustin/kube-lineage/internal/version"
)

func getVersion() string {
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/tohjustin/kubectl-lineage
module github.com/tohjustin/kube-lineage

go 1.16

Expand Down
2 changes: 1 addition & 1 deletion internal/printers/printer_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"k8s.io/apimachinery/pkg/util/duration"
"k8s.io/client-go/util/jsonpath"

"github.com/tohjustin/kubectl-lineage/internal/graph"
"github.com/tohjustin/kube-lineage/internal/graph"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions pkg/cmd/lineage/lineage.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (
cmdutil "k8s.io/kubectl/pkg/cmd/util"
"k8s.io/kubectl/pkg/util/templates"

"github.com/tohjustin/kubectl-lineage/internal/graph"
"github.com/tohjustin/kubectl-lineage/internal/log"
lineageprinters "github.com/tohjustin/kubectl-lineage/internal/printers"
"github.com/tohjustin/kube-lineage/internal/graph"
"github.com/tohjustin/kube-lineage/internal/log"
lineageprinters "github.com/tohjustin/kube-lineage/internal/printers"
)

var (
cmdName = "kubectl-lineage"
cmdName = "kube-lineage"
cmdUse = "COMMAND (TYPE[.VERSION][.GROUP] [NAME] | TYPE[.VERSION][.GROUP]/NAME) [flags]"
cmdExample = templates.Examples(`
# List all dependents of the deployment named "bar" in the current namespace
Expand Down

0 comments on commit a8cd919

Please sign in to comment.