From 537227dc4342c987cd0d122ba3961b72b291694b Mon Sep 17 00:00:00 2001 From: navist2020 Date: Mon, 1 Mar 2021 14:56:27 +0800 Subject: [PATCH] Simply modify the Kubectl logs information Kubernetes-commit: 1995f28c64a73c8a60fb21e89b0b3d98b544df58 --- pkg/cmd/logs/logs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/logs/logs.go b/pkg/cmd/logs/logs.go index 09bee9aa4..4b6c0fc37 100644 --- a/pkg/cmd/logs/logs.go +++ b/pkg/cmd/logs/logs.go @@ -58,7 +58,7 @@ var ( kubectl logs nginx --all-containers=true # Return snapshot logs from all containers in pods defined by label app=nginx - kubectl logs -lapp=nginx --all-containers=true + kubectl logs -l app=nginx --all-containers=true # Return snapshot of previous terminated ruby container logs from pod web-1 kubectl logs -p -c ruby web-1 @@ -67,7 +67,7 @@ var ( kubectl logs -f -c ruby web-1 # Begin streaming the logs from all containers in pods defined by label app=nginx - kubectl logs -f -lapp=nginx --all-containers=true + kubectl logs -f -l app=nginx --all-containers=true # Display only the most recent 20 lines of output in pod nginx kubectl logs --tail=20 nginx