Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newline is not possible on the Windows environment #172

Open
webwarrior06 opened this issue Dec 8, 2021 · 1 comment
Open

Newline is not possible on the Windows environment #172

webwarrior06 opened this issue Dec 8, 2021 · 1 comment
Labels
help wanted Extra attention is needed kind/bug Something isn't working

Comments

@webwarrior06
Copy link

What happened:
I am trying to use templates on windows. But, It seems that the new line keyword is not working.
image

What you expected to happen:
It should give a line break with the proper command.

How to reproduce it (as minimally and precisely as possible):
Just use the example shown on the Readme.MD
kubectl stern -n company myservice -t --since 10m --context aks-dev-westeurope-cluster --color always --template '{{ .Message}} {{"\n"}} '

Anything else we need to know?:
No

Environment: Windows 10 64 Bit

  • stern version (use stern --version): 1.20.1
  • OS (e.g: cat /etc/os-release):
  • Install tools (e.g: Homebrew)
  • Others:
@webwarrior06 webwarrior06 added the kind/bug Something isn't working label Dec 8, 2021
@superbrothers
Copy link
Member

It work on both Linux and macOS. Unfortunately, I do not have a Windows environment, so it is difficult to reproduce the problem.

Linux

$ uname -a
Linux nuc 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021 x86_64 GNU/Linux

$ k stern --version
version: 1.20.1
commit: a384d35f36e43953ac3c6af5a20ffc97cb8205cf
built at: 2021-09-11T12:17:12Z

$ k stern . -t --color always --template '{{ .Message}} {{"\n"}} '
+ nginx-5f55f8cbff-sxpb6 › nginx-unprivileged
2021-12-09T23:20:07.496180431+09:00 /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
 2021-12-09T23:20:07.496204289+09:00 /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
 2021-12-09T23:20:07.496960607+09:00 /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
 2021-12-09T23:20:07.500211866+09:00 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
 2021-12-09T23:20:07.502879999+09:00 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
 2021-12-09T23:20:07.502952149+09:00 /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
 2021-12-09T23:20:07.504651124+09:00 /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
 2021-12-09T23:20:07.505381846+09:00 /docker-entrypoint.sh: Configuration complete; ready for start up
 2021-12-09T23:20:07.508382748+09:00 2021/12/09 14:20:07 [notice] 1#1: using the "epoll" event method
 2021-12-09T23:20:07.508390975+09:00 2021/12/09 14:20:07 [notice] 1#1: nginx/1.21.4
 2021-12-09T23:20:07.508393130+09:00 2021/12/09 14:20:07 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
 2021-12-09T23:20:07.508394948+09:00 2021/12/09 14:20:07 [notice] 1#1: OS: Linux 5.4.0-89-generic
 2021-12-09T23:20:07.508397332+09:00 2021/12/09 14:20:07 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
 2021-12-09T23:20:07.508404086+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker processes
 2021-12-09T23:20:07.508486579+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 30
 2021-12-09T23:20:07.508554776+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 31
 2021-12-09T23:20:07.508633045+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 32
 2021-12-09T23:20:07.508731113+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 33
 2021-12-09T23:20:07.508835098+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 34
 2021-12-09T23:20:07.508938960+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 35
 2021-12-09T23:20:07.509020181+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 36
 2021-12-09T23:20:07.509121270+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 37
 2021-12-09T23:20:07.509243882+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 38
 2021-12-09T23:20:07.509392089+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 39
 2021-12-09T23:20:07.509495660+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 40
 2021-12-09T23:20:07.509602060+09:00 2021/12/09 14:20:07 [notice] 1#1: start worker process 41
 ^C

macOS

$ uname -a
Darwin MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64 i386 MacBookPro16,1 Darwin

$ k stern --version
version: 1.20.1
commit: a384d35f36e43953ac3c6af5a20ffc97cb8205cf
built at: 2021-09-11T12:17:12Z

$ k stern . -t --color always --template '{{ .Message}} {{"\n"}} '
+ nginx-66f6ffdddf-pg945 › nginx-unprivileged
2021-12-09T23:24:27.217469438+09:00 /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
 2021-12-09T23:24:27.217494535+09:00 /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
 2021-12-09T23:24:27.218641840+09:00 /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
 2021-12-09T23:24:27.223466257+09:00 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
 2021-12-09T23:24:27.227907894+09:00 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
 2021-12-09T23:24:27.228056703+09:00 /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
 2021-12-09T23:24:27.231067231+09:00 /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
 2021-12-09T23:24:27.232545655+09:00 /docker-entrypoint.sh: Configuration complete; ready for start up
 2021-12-09T23:24:27.236837890+09:00 2021/12/09 14:24:27 [notice] 1#1: using the "epoll" event method
 2021-12-09T23:24:27.236853387+09:00 2021/12/09 14:24:27 [notice] 1#1: nginx/1.21.4
 2021-12-09T23:24:27.236856728+09:00 2021/12/09 14:24:27 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
 2021-12-09T23:24:27.236858777+09:00 2021/12/09 14:24:27 [notice] 1#1: OS: Linux 5.10.47-linuxkit
 2021-12-09T23:24:27.236861249+09:00 2021/12/09 14:24:27 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
 2021-12-09T23:24:27.236962866+09:00 2021/12/09 14:24:27 [notice] 1#1: start worker processes
 2021-12-09T23:24:27.236969015+09:00 2021/12/09 14:24:27 [notice] 1#1: start worker process 30
 2021-12-09T23:24:27.237207139+09:00 2021/12/09 14:24:27 [notice] 1#1: start worker process 31
 2021-12-09T23:24:27.237368517+09:00 2021/12/09 14:24:27 [notice] 1#1: start worker process 32
 2021-12-09T23:24:27.237496222+09:00 2021/12/09 14:24:27 [notice] 1#1: start worker process 33
 2021-12-09T23:24:27.237705586+09:00 2021/12/09 14:24:27 [notice] 1#1: start worker process 34
 2021-12-09T23:24:27.237882313+09:00 2021/12/09 14:24:27 [notice] 1#1: start worker process 35
 2021-12-09T23:24:27.238356242+09:00 2021/12/09 14:24:27 [notice] 1#1: start worker process 36
 2021-12-09T23:24:27.238603901+09:00 2021/12/09 14:24:27 [notice] 1#1: start worker process 37

@superbrothers superbrothers added the help wanted Extra attention is needed label Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants