Skip to content

Commit b65247e

Browse files
committed
set up goreleaser-action attempt
Signed-off-by: Ahmet Alp Balkan <[email protected]>
1 parent 962a2b1 commit b65247e

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: release
2+
on:
3+
tags:
4+
- 'v*.*.*'
5+
jobs:
6+
goreleaser:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@master
11+
- name: Setup Go
12+
uses: actions/setup-go@v1
13+
- name: GoReleaser
14+
uses: goreleaser/goreleaser-action@v1
15+
with:
16+
version: latest
17+
args: release --rm-dist
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

cmd/kubectl-tree/apis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ func apiNames(a metav1.APIResource, gv schema.GroupVersion) []string {
9494
names := append([]string{singularName, pluralName}, shortNames...)
9595
for _, n := range names {
9696
fmtBare := n // e.g. deployment
97-
fmtWithGroup := fmt.Sprintf("%s.%s", n, gv.Group) // e.g. deployment.apps
98-
fmtWithGroupVersion := fmt.Sprintf("%s.%s.%s", n, gv.Version, gv.Group) // e.g. deployment.v1.apps
97+
fmtWithGroup := strings.Join([]string{n, gv.Group},".") // e.g. deployment.apps
98+
fmtWithGroupVersion := strings.Join([]string{n, gv.Version, gv.Group},".") // e.g. deployment.v1.apps
9999

100100
out = append(out,
101101
fmtBare, fmtWithGroup, fmtWithGroupVersion)

cmd/kubectl-tree/rootcmd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ func run(cmd *cobra.Command, args []string) error {
8686

8787
objs := newObjectDirectory(apiObjects)
8888
if len(objs.ownership[obj.GetUID()]) == 0 {
89-
return fmt.Errorf("no resources are owned by the specified object")
89+
fmt.Println("No resources are owned by the specified object through ownerReferences.")
90+
return nil
9091
}
9192
treeView(os.Stderr, objs, *obj)
9293
return nil

0 commit comments

Comments
 (0)