Skip to content

Commit ec5a24a

Browse files
authored
Updated to be kubectl plugin compatible (#1)
* directly use kubectl * bump version * updated config handling * fixed cli issues * more config updates for ux * adding goreleaser
1 parent b900188 commit ec5a24a

File tree

9 files changed

+269
-559
lines changed

9 files changed

+269
-559
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@
1919

2020
# Go workspace file
2121
go.work
22+
23+
dist/

.goreleaser.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# The lines below are called `modelines`. See `:help modeline`
5+
# Feel free to remove those if you don't want/need to use them.
6+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
7+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
8+
9+
version: 1
10+
11+
before:
12+
hooks:
13+
- go mod tidy
14+
15+
builds:
16+
- env:
17+
- CGO_ENABLED=0
18+
goos:
19+
- linux
20+
- windows
21+
- darwin
22+
23+
archives:
24+
- format: tar.gz
25+
# this name template makes the OS and Arch compatible with the results of `uname`.
26+
name_template: >-
27+
{{ .ProjectName }}_
28+
{{- title .Os }}_
29+
{{- if eq .Arch "amd64" }}x86_64
30+
{{- else if eq .Arch "386" }}i386
31+
{{- else }}{{ .Arch }}{{ end }}
32+
{{- if .Arm }}v{{ .Arm }}{{ end }}
33+
# use zip for windows archives
34+
format_overrides:
35+
- goos: windows
36+
format: zip
37+
38+
changelog:
39+
sort: asc
40+
filters:
41+
exclude:
42+
- "^docs:"
43+
- "^test:"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ pod:
2525
- "https://example.com/dashboards/xyz1?name={.metadata.name}&namespace={.metadata.namespace}"
2626
commands:
2727
meta:
28+
short: open dashboards for namespaced things
29+
example: |
30+
kubectl k8surl meta get pods
31+
kubectl get pods -ojson | k8surl meta
2832
kinds: ["*"]
2933
urls:
3034
- "{range .items[*]}https://example.com/dashboards/xyz?name={.metadata.name}&namespace={.metadata.namespace}{end}"

go.mod

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,52 @@
11
module github.com/jklaw90/k8surl
22

3-
go 1.20
3+
go 1.21
44

55
require (
6-
github.com/spf13/cobra v1.7.0
7-
github.com/spf13/viper v1.16.0
8-
go.uber.org/zap v1.24.0
9-
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
10-
k8s.io/api v0.27.4
11-
k8s.io/apimachinery v0.27.4
12-
k8s.io/cli-runtime v0.27.4
13-
k8s.io/client-go v0.27.4
6+
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
7+
github.com/spf13/cobra v1.8.0
8+
github.com/spf13/viper v1.18.2
9+
k8s.io/apimachinery v0.29.3
10+
k8s.io/cli-runtime v0.29.3
11+
k8s.io/client-go v0.29.3
1412
)
1513

1614
require (
17-
github.com/fsnotify/fsnotify v1.6.0 // indirect
18-
github.com/go-logr/logr v1.2.3 // indirect
15+
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
16+
github.com/fsnotify/fsnotify v1.7.0 // indirect
17+
github.com/go-logr/logr v1.4.1 // indirect
1918
github.com/gogo/protobuf v1.3.2 // indirect
20-
github.com/google/gofuzz v1.1.0 // indirect
19+
github.com/google/gofuzz v1.2.0 // indirect
2120
github.com/hashicorp/hcl v1.0.0 // indirect
2221
github.com/inconshreveable/mousetrap v1.1.0 // indirect
2322
github.com/json-iterator/go v1.1.12 // indirect
2423
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
2524
github.com/magiconair/properties v1.8.7 // indirect
2625
github.com/mitchellh/mapstructure v1.5.0 // indirect
26+
github.com/moby/term v0.5.0 // indirect
2727
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2828
github.com/modern-go/reflect2 v1.0.2 // indirect
29-
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
30-
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
31-
github.com/spf13/afero v1.9.5 // indirect
32-
github.com/spf13/cast v1.5.1 // indirect
33-
github.com/spf13/jwalterweatherman v1.1.0 // indirect
29+
github.com/pelletier/go-toml/v2 v2.2.0 // indirect
30+
github.com/sagikazarmark/locafero v0.4.0 // indirect
31+
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
32+
github.com/sourcegraph/conc v0.3.0 // indirect
33+
github.com/spf13/afero v1.11.0 // indirect
34+
github.com/spf13/cast v1.6.0 // indirect
3435
github.com/spf13/pflag v1.0.5 // indirect
35-
github.com/subosito/gotenv v1.4.2 // indirect
36-
go.uber.org/atomic v1.9.0 // indirect
37-
go.uber.org/goleak v1.2.1 // indirect
38-
go.uber.org/multierr v1.8.0 // indirect
39-
golang.org/x/net v0.10.0 // indirect
40-
golang.org/x/sys v0.8.0 // indirect
41-
golang.org/x/text v0.9.0 // indirect
36+
github.com/subosito/gotenv v1.6.0 // indirect
37+
go.uber.org/multierr v1.11.0 // indirect
38+
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
39+
golang.org/x/net v0.22.0 // indirect
40+
golang.org/x/sys v0.18.0 // indirect
41+
golang.org/x/text v0.14.0 // indirect
4242
gopkg.in/inf.v0 v0.9.1 // indirect
4343
gopkg.in/ini.v1 v1.67.0 // indirect
4444
gopkg.in/yaml.v2 v2.4.0 // indirect
4545
gopkg.in/yaml.v3 v3.0.1 // indirect
46-
k8s.io/klog/v2 v2.90.1 // indirect
47-
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
46+
k8s.io/api v0.29.3 // indirect
47+
k8s.io/klog/v2 v2.120.1 // indirect
48+
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
4849
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
49-
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
50-
sigs.k8s.io/yaml v1.3.0 // indirect
50+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
51+
sigs.k8s.io/yaml v1.4.0 // indirect
5152
)

0 commit comments

Comments
 (0)