Skip to content

Commit

Permalink
fix none namespaced resources
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Mar 7, 2020
1 parent edac58c commit 214de25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (c Config) List(resourceName string) ([]unstructured.Unstructured, error) {
})

// Check for namespace
if !c.AllNamespaces && len(c.Namespace) > 0 {
if !c.AllNamespaces && len(c.Namespace) > 0 && resource.Namespaced {
list, err = res.Namespace(c.Namespace).List(v1.ListOptions{})
} else {
list, err = res.List(v1.ListOptions{})
Expand Down
9 changes: 6 additions & 3 deletions pkg/cmd/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ namespace unless you pass --all-namespaces`
kubectl sql join vmis,pods on "vmis.metadata.uid = pods.metadata.ownerReferences.1.uid"
# List all virtual machine instanaces and pods joined on vim is owner of pod for vmis with name matching 'test' regexp.
kubectl-sql join vmis,pods on "vmis.metadata.uid = pods.metadata.ownerReferences.1.uid" where "name ~= 'test'" -A
kubectl sql join vmis,pods on "vmis.metadata.uid = pods.metadata.ownerReferences.1.uid" where "name ~= 'test'" -A
# Same using aliases.
kubectl-sql join vmis,pods on "vmis.uid = pods.owner.uid" where "name ~= 'test'" -A`
# Join deployment sets with pods using the uid aliases.
kubectl sql join ds,pods on "ds.uid = pods.owner.uid"
# Display non running pods by nodes for all namespaces.
kubectl sql join nodes,pods on "nodes.status.addresses.1.address = pods.status.hostIP and not pods.phase ~= 'Running'" -A `

// sql version command
sqlVersionShort = "Print the SQL client and server version information"
Expand Down

0 comments on commit 214de25

Please sign in to comment.