-
Notifications
You must be signed in to change notification settings - Fork 6
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
NETOBSERV-2019: Make sure the required yq version is installed #140
Conversation
@msherif1234: This pull request references NETOBSERV-2019 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
41ed464
to
d991299
Compare
/ok-to-test |
New image: It will expire after two weeks. To use this build, update your commands using: USER=netobserv VERSION=24e73b9 make commands |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
=======================================
Coverage 22.66% 22.66%
=======================================
Files 10 10
Lines 1337 1337
=======================================
Hits 303 303
Misses 1015 1015
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. |
to test this running locally Installing yq version v4.43.1 is required. Found v4.40.3.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 9716k 100 9716k 0 0 13.7M 0 --:--:-- --:--:-- --:--:-- 23.1M
Successfully downloaded yq version v4.43.1.
Setting up...
Error from server (NotFound): the server could not find the requested resource (get users.user.openshift.io ~)
creating netobserv-cli namespace
namespace/netobserv-cli created
creating service account
serviceaccount/netobserv-cli created
clusterrole.rbac.authorization.k8s.io/netobserv-cli unchanged
clusterrolebinding.rbac.authorization.k8s.io/netobserv-cli unchanged
creating collector service
service/collector created
creating packet-capture agents
opt: log_level, evalue: trace
opt: filter_protocol, evalue: TCP
opt: filter_port, evalue: 6443
daemonset.apps/netobserv-cli created
Waiting for daemon set "netobserv-cli" rollout to finish: 0 of 2 updated pods are available...
^CRunning network-observability-cli get-packets...
pod/collector created
pod/collector condition met
Starting network-observability-cli:
=====
Build version: main-24e73b9
Build date: 2024-12-16 22:18 |
d991299
to
f93beaa
Compare
9f5f1ac
to
f4fcc21
Compare
/ok-to-test |
New image: It will expire after two weeks. To use this build, update your commands using: USER=netobserv VERSION=c18479c make commands |
scripts/dependencies_check.sh
Outdated
@@ -0,0 +1,65 @@ | |||
#!/usr/bin/env bash | |||
|
|||
set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set -e |
scripts/dependencies_check.sh
Outdated
YQ_BIN=$(which yq 2>/dev/null) | ||
if [ -z "$YQ_BIN" ]; then | ||
echo "Error: 'yq' is not installed or not in PATH." | ||
install_yq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install_yq | |
install_yq "$2" |
scripts/dependencies_check.sh
Outdated
for arch in $supported_archs; do | ||
echo "Attempting to download yq version $required_yq_version for $OS/$arch..." | ||
DOWNLOAD_URL="https://github.com/mikefarah/yq/releases/download/$required_yq_version/yq_${OS}_${arch}" | ||
if ! curl -Lo "$YQ_BIN" "$DOWNLOAD_URL" && chmod +x "$YQ_BIN" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ! curl -Lo "$YQ_BIN" "$DOWNLOAD_URL" && chmod +x "$YQ_BIN" | |
if curl -Lo "$YQ_BIN" "$DOWNLOAD_URL" && chmod +x "$YQ_BIN" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh was trying to fix linter and I broke it :(
scripts/dependencies_check.sh
Outdated
function install_yq() { | ||
OS=$(uname | tr '[:upper:]' '[:lower:]') # Get the OS type (linux or darwin) | ||
supported_archs="$1" | ||
YQ_BIN="./yq" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit dirty 🤔
Is there a way to put it in /tmp
folder for all envs ?
Or maybe alongside oc-netobserv command but renamming yq to something else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, each time the script runs, it redownload the yq binary. We need to check if that path exists at the top of this script and use it if available prior to the one returned by which yq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it in /tmp
Signed-off-by: Mohamed Mahmoud <[email protected]>
f4fcc21
to
c32649e
Compare
@msherif1234: This pull request references NETOBSERV-2019 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Took the opportunity to improve the display e2e41ca Everything is working fine 👌 thanks @msherif1234 ! |
@memodi will give this a try ? |
New image: It will expire after two weeks. To use this build, update your commands using: USER=netobserv VERSION=e7139e2 make commands |
sure @msherif1234 , I upgraded my |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested, it works! thanks @msherif1234
@@ -72,7 +72,11 @@ function packets() { | |||
esac | |||
} | |||
|
|||
case "$1" in | |||
required_yq_version="v0.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msherif1234 - qq , where do you set the required version here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its passed as an arg in the Makefile https://github.com/netobserv/network-observability-cli/pull/140/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R158
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see it, the YQ_VERSION env var value already exists in main.
/label qe-approved |
@msherif1234: This pull request references NETOBSERV-2019 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: msherif1234 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
make sure the required YQ is available for the cli scripts to work
Dependencies
n/a
Checklist
If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.