mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +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 {
|
if len(args) != 2 {
|
||||||
usageError(cmd, "<pod> and <container> are required for log")
|
usageError(cmd, "<pod> and <container> are required for log")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace := getKubeNamespace(cmd)
|
||||||
|
|
||||||
client := getKubeClient(cmd)
|
client := getKubeClient(cmd)
|
||||||
pod, err := client.Pods("default").Get(args[0])
|
pod, err := client.Pods(namespace).Get(args[0])
|
||||||
checkErr(err)
|
checkErr(err)
|
||||||
|
|
||||||
data, err := client.RESTClient.Get().
|
data, err := client.RESTClient.Get().
|
||||||
Path("proxy/minions").
|
Path("proxy/minions").
|
||||||
Path(pod.Status.Host).
|
Path(pod.Status.Host).
|
||||||
Path("containerLogs").
|
Path("containerLogs").
|
||||||
Path(getKubeNamespace(cmd)).
|
Path(namespace).
|
||||||
Path(args[0]).
|
Path(args[0]).
|
||||||
Path(args[1]).
|
Path(args[1]).
|
||||||
Do().
|
Do().
|
||||||
|
Loading…
Reference in New Issue
Block a user