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

grep -oP not working on Alpine Linux / BusyBox #63

Open
tchapuis opened this issue Sep 29, 2023 · 0 comments
Open

grep -oP not working on Alpine Linux / BusyBox #63

tchapuis opened this issue Sep 29, 2023 · 0 comments

Comments

@tchapuis
Copy link

Hi all !

I'm trying to run an analysis with Greenframe CLI in a Gitlab CI. It's a fullstack analysis on a Kubernetes cluster. I built a custom Docker image to run it, from Node 16 Alpine, with docker and kubectl installed.

But this analysis failed when try to run the getHostIP.sh script. Grep version is not the same in Alpine Linux and doesn't have the -P option.

Here is the complete output :

$ greenframe --version
greenframe-cli/1.6.8 linux-x64 node-v16.20.2
$ greenframe kube-config
[STARTED] Check configuration file
[SUCCESS] Check configuration file
[STARTED] Intializing kubernetes client
[SUCCESS] Intializing kubernetes client
[STARTED] Creating greenframe namespace
[TITLE] Greenframe namespace already exists
[SUCCESS] Greenframe namespace already exists
[STARTED] Creating greenframe daemonset
[TITLE] Greenframe daemonset already exists
[SUCCESS] Greenframe daemonset already exists
Kubernetes configuration complete !
$ greenframe analyze
[STARTED] Check configuration file
[SUCCESS] Check configuration file
[STARTED] Retrieving Git information
[SUCCESS] Retrieving Git information
[STARTED] Analysis is in progress locally
[STARTED] Detect docker version
[TITLE] Docker version 24.0.6, build ed223bc
[SUCCESS] Docker version 24.0.6, build ed223bc
[STARTED] Initialize Kubernetes client
[SUCCESS] Initialize Kubernetes client
[STARTED] Detect kubernetes version
[TITLE] Kubernetes version 1.24, build v1.24.14-gke.2700, platform linux/amd64
[SUCCESS] Kubernetes version 1.24, build v1.24.14-gke.2700, platform linux/amd64
[STARTED] Running 1 scenario(s)...
[SUCCESS] Running 1 scenario(s)...
[SUCCESS] Analysis is in progress locally
Analysis complete !
Result summary:
❌ main scenario failed
This scenario fail during the execution:
Command failed: /root/.local/lib/greenframe/dist/bash/getHostIP.sh
grep: unrecognized option: P
BusyBox v1.36.1 (2023-07-27 17:12:24 UTC) multi-call binary.
Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A|B|C N] { PATTERN | -e PATTERN... | -f FILE... } [FILE]...
Search for PATTERN in FILEs (or stdin)
	-H	Add 'filename:' prefix
	-h	Do not add 'filename:' prefix
	-n	Add 'line_no:' prefix
	-l	Show only names of files that match
	-L	Show only names of files that don't match
	-c	Show only count of matching lines
	-o	Show only the matching part of line
	-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
	-v	Select non-matching lines
	-s	Suppress open and read errors
	-r	Recurse
	-R	Recurse and dereference symlinks
	-i	Ignore case
	-w	Match whole words only
	-x	Match whole lines only
	-F	PATTERN is a literal (not regexp)
	-E	PATTERN is an extended regexp
	-m N	Match up to N times per file
	-A N	Print N lines of trailing context
	-B N	Print N lines of leading context
	-C N	Same as '-A N -B N'
	-e PTRN	Pattern to match
	-f FILE	Read pattern from file
ash: usage: printf FORMAT [ARGUMENT...]
Use greenframe open command to run your scenario in debug mode.
JulienMattiussi added a commit that referenced this issue Jul 24, 2024
fix: replace grep -P commands - Closes #83 #63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant