mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Log function use namespace
This commit is contained in:
parent
c5e9f60f9c
commit
f41a44278d
@ -29,15 +29,18 @@ func NewCmdLog(out io.Writer) *cobra.Command {
|
||||
if len(args) != 2 {
|
||||
usageError(cmd, "<pod> and <container> are required for log")
|
||||
}
|
||||
|
||||
namespace := getKubeNamespace(cmd)
|
||||
|
||||
client := getKubeClient(cmd)
|
||||
pod, err := client.Pods("default").Get(args[0])
|
||||
pod, err := client.Pods(namespace).Get(args[0])
|
||||
checkErr(err)
|
||||
|
||||
data, err := client.RESTClient.Get().
|
||||
Path("proxy/minions").
|
||||
Path(pod.Status.Host).
|
||||
Path("containerLogs").
|
||||
Path(getKubeNamespace(cmd)).
|
||||
Path(namespace).
|
||||
Path(args[0]).
|
||||
Path(args[1]).
|
||||
Do().
|
||||
|
Loading…
Reference in New Issue
Block a user