Skip to content

Commit

Permalink
fix: DNS display
Browse files Browse the repository at this point in the history
  • Loading branch information
illyaks committed Jun 6, 2024
1 parent 23a4f2a commit 0ce70f0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions pkg/kubectl/cmd/getcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,14 @@ func getDNSCmdHandler(cmd *cobra.Command, args []string) {
matchDNS = append(matchDNS, *dns)
}
}
header := []string{"name", "host"}
header := []string{"name", "host", "path"}
data := [][]string{}
for _, matched := range matchDNS {
data = append(data, []string{matched.Host, matched.Name})
str := ""
for _, path := range matched.Paths {
str += path.Path + ","
}
data = append(data, []string{matched.Name, matched.Host, str})
}
prettyprint.PrintTable(header, data)
}
Expand Down
8 changes: 5 additions & 3 deletions yaml/dns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ name: new-dns
host: example.com
paths:
- path: /footprint
serviceNamespace: default
serviceName: test-service1
servicePort: 8888
- path: /counter
serviceName: deployment-service
servicePort: 12345
- path: /nginx
serviceNamespace: default
serviceName: nginx-service
servicePort: 80

0 comments on commit 0ce70f0

Please sign in to comment.