Skip to content

Commit

Permalink
Merge pull request #182 from d-kuro/d-kuro/preview
Browse files Browse the repository at this point in the history
Fix unsupported printer type error
  • Loading branch information
d-kuro authored Apr 24, 2021
2 parents ba061df + 8844109 commit eed56a4
Show file tree
Hide file tree
Showing 13 changed files with 392 additions and 188 deletions.
25 changes: 25 additions & 0 deletions .github/RELEASE_NOTE_TEMPALTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Release Note Template

## Breaking Change

* TBD

## Enhancement

* TBD

## Bug Fix

* TBD

## Changelog

* TBD

## Update Krew Index

* TBD

## Contributors

* TBD
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
- uses: goreleaser/goreleaser-action@v2
with:
version: latest
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ jobs:
run: go mod tidy && git diff -s --exit-code go.sum
- uses: golangci/[email protected]
with:
version: v1.37.1
version: latest
args: --timeout=3m0s
skip-go-installation: true
skip-pkg-cache: true
skip-build-cache: true
- name: Run tests
run: go test -race -v ./...
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
builds:
- main: ./cmd/kubectl-fuzzy/kubectl-fuzzy.go
- main: ./cmd/kubectl-fuzzy/main.go
binary: kubectl-fuzzy
goos:
- windows
Expand Down
239 changes: 239 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
# Changelog

## v1.9.0

### Enhancement

* Bump Go to v1.16 #162
* Bump Kubernetes library to v0.21.0

### Bug Fix

* Fix unsupported printer type error #182

#### Fix unsupported printer type error

A bug existed that caused error messages to appear in the preview window due to a Kubernetes upgrade.

> error: unsupported printer type: *printers.OmitManagedFieldsPrinter
Fixed a bug so that the preview window is displayed properly.

Also, `.metadata.managedFields` field is now omitted even when `--raw-preview` is enabled.

## v1.8.1

### Enhancement

None

#### 64-bit ARM build binary released

Added ARM builds binaries to the release.
Currently, only Linux is supported.

Please wait for the 64-bit ARM MacOS build for Apple Silicon to be supported in Go 1.16.

https://github.com/golang/go/blob/869e2957b9f66021581b839cadce6cb48ad46114/doc/go1.16.html#L32-L50

## v1.8.0

### Enhancement

* Add env var to enable preview across all commands #86

#### Add env var to enable preview across all commands

Add environment variables about enable preview mode.
You can use `KUBE_FUZZY_PREVIEW_ENABLED=true`.

## v1.7.0

### Enhancement

* Support delete command #81

#### Support delete command

Added support for the `kubectl delete` command with fuzzy finder selector.
You can use the `kubectl fuzzy delete` command.

## v1.6.1

### Bug Fix

* Fix help message #75

## v1.6.0

### Enhancement

* Support global flags #68

#### Support global flags

Show the common command flags as global flags.

## v1.5.2

### Fix Bugs

* fix: no auth provider error (#50) #51

#### fix: no auth provider error

Added import of the auth plugin.

```go
// import the auth plugin package
_ "k8s.io/client-go/plugin/pkg/client/auth"
```

refs: https://github.com/kubernetes/client-go/issues/242

## v1.5.1

### Fix Bugs

* Add no resource found error handling #48

#### Add no resource found error handling

Outputs an error message if the resource does not exist.

```console
$ kubectl fuzzy describe pod -n default
no resources found
exit status 1
```

## v1.5.0

### Enhancement

* Support label selector for exec command #43

#### Support label selector for exec command

```diff
Flags:
+ -l, --selector string Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
```

for example:

```console
$ kubectl fuzzy exec -it --preview -l app=nginx -- bash
```

## v1.4.0

### Enhancement

* Add create job command to create job from cronjob #32

#### Create Job command

Added support for the `kubectl create job --from=cronjob` command with fuzzy finder selector.
You can use the `kubectl fuzzy create job --from=cronjob` command.
Currently, `kubectl fuzzy create job` is `--from=cronjob` option required. Job creation without a CronJob is not supported.

> 📝 See the [documentation](https://github.com/d-kuro/kubectl-fuzzy/blob/v1.4.0/docs/commands.md#create) for details.
```console
$ kubectl fuzzy create job --from=cronjob -P
job.batch/test-cronjob-kb87r created
```

## v1.3.0

### Enhancement

* Support multi resource type #33

#### Support multi resource type

`kubectl fuzzy describe` command now allows multiple resource types to be entered.

It is displayed with the following rules:

```go
"%s/%s (%s)", Lower(GroupKind), Name, Namespace
```

for example:

```
kubectl fuzzy describe service,configmap -n argocd
```

## v1.2.0

### Enhancement

* Simplify display the object #30

#### Simplify Display Object

Added ability to simplify Kubernetes objects displayed in the preview window.
Simplified by default. Some metadata and statuses have been removed.
Use the `--raw-preview` option to display the unsimplified object.

## v1.1.0

### Enhancement

* Add describe command #24
* Add preview option for logs and exec command #25

#### Describe Command

Added support for the `kubectl describe` command with fuzzy finder selector.
You can use the `kubectl fuzzy describe` command.

#### Preview Window

You can use the `--preview` or `-P` option to display a YAML of the Kubernetes object in a fuzzy finder selector.
You can switch display to YAML or JSON with the `--preview-format` option.

## v1.0.1

### Bug Fix

* fix project name for command example (#17)

## v1.0.0

### Breaking Change

* rename project to kubectl-fuzzy (#15)

#### Renamed this project from `kubectl-fzf` to `kubectl-fuzzy`.

The name `fzf` was not appropriate.
I'm sorry for the breaking changes.

There are no feature changes in this release.

After this release I'm going add the project to the krew index.
This should make it easier to install and so on.

https://github.com/kubernetes-sigs/krew-index/pull/660

## v0.1.0

### Enhancement

* Support kubectl exec command (#14)

## v0.0.2

### Bug Fix

* Fixed the error message displayed twice(https://github.com/d-kuro/kubectl-fzf/pull/12)

## v0.0.1

### Enhancement

* Support for `kubectl logs` command
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/spf13/pflag"
"k8s.io/cli-runtime/pkg/genericclioptions"

// import the auth plugin package
// import the auth plugin package.
_ "k8s.io/client-go/plugin/pkg/client/auth"
)

Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ require (
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/tidwall/sjson v1.1.6
k8s.io/api v0.21.0
k8s.io/apimachinery v0.21.0
k8s.io/cli-runtime v0.21.0
k8s.io/client-go v0.21.0
k8s.io/klog/v2 v2.8.0
k8s.io/kubectl v0.21.0
sigs.k8s.io/yaml v1.2.0
)
8 changes: 0 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -703,15 +703,7 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tetafro/godot v1.3.0/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tetafro/godot v1.3.2/go.mod h1:ah7jjYmOMnIjS9ku2krapvGQrFNtTLo9Z/qB3dGU1eU=
github.com/tidwall/gjson v1.7.4 h1:19cchw8FOxkG5mdLRkGf9jqIqEyqdZhPqW60XfyFxk8=
github.com/tidwall/gjson v1.7.4/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk=
github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE=
github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8=
github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/sjson v1.1.6 h1:8fDdlahON04OZBlTQCIatW8FstSFJz8oxidj5h0rmSQ=
github.com/tidwall/sjson v1.1.6/go.mod h1:KN3FZ7odvXIHPbJdhNorK/M9lWweVUbXsXXhrJ/kGOA=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk=
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func NewCmdCreate(config *genericclioptions.ConfigFlags, streams genericclioptio
}

flags := cmd.Flags()
o.configFlags.AddFlags(flags)
o.AddFlags(flags)

cmd.AddCommand(NewCmdCreateJob(config, streams))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/spf13/cobra"
)

const Version = "v1.8.1"
const Version = "v1.9.0"

var Revision = "development" //nolint:gochecknoglobals

Expand Down
Loading

0 comments on commit eed56a4

Please sign in to comment.