-
Notifications
You must be signed in to change notification settings - Fork 63
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
tests: General improvements to operator script #386
tests: General improvements to operator script #386
Conversation
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.
LGTM
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.
LGTM. Thanks @GabyCT
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.
Thanks, those are fine changes although shellcheck complains about more. Could you please take care of the others too since you are already treating style issues?
f86a4a8
to
8891258
Compare
changes applied |
tests/e2e/operator.sh
Outdated
|
||
local pod_id="$(get_pods_regex $pod $op_ns)" | ||
local pod_id | ||
pod_id="$(get_pods_regex $pod $op_ns)" |
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.
The $pod
and $op_ns
should be quoted as well
tests/e2e/operator.sh
Outdated
|
||
local pod_id="$(get_pods_regex $pod $op_ns)" | ||
local pod_id | ||
pod_id="$(get_pods_regex $pod $op_ns)" |
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.
The same here
tests/e2e/operator.sh
Outdated
cmd+="egrep -q ${controller_pod}.*'\<Running\>'" | ||
if ! wait_for_process 120 10 "$cmd"; then | ||
echo "::error:: ${controller_pod} pod is not running" | ||
|
||
local pod_id="$(get_pods_regex $controller_pod $op_ns)" | ||
local pod_id | ||
pod_id="$(get_pods_regex $controller_pod $op_ns)" |
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.
and here
tests/e2e/operator.sh
Outdated
@@ -132,12 +135,12 @@ install_ccruntime() { | |||
local pod="" | |||
local cmd="" | |||
for pod in cc-operator-daemon-install cc-operator-pre-install-daemon; do | |||
cmd="kubectl get pods -n "$op_ns" --no-headers |" | |||
cmd="kubectl get pods -n $op_ns --no-headers |" |
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.
and here as well cmd="kubectl get pods -n '$op_ns' --no-headers |"
@@ -132,12 +135,12 @@ install_ccruntime() { | |||
local pod="" | |||
local cmd="" | |||
for pod in cc-operator-daemon-install cc-operator-pre-install-daemon; do | |||
cmd="kubectl get pods -n "$op_ns" --no-headers |" | |||
cmd="kubectl get pods -n $op_ns --no-headers |" | |||
cmd+="egrep -q ${pod}.*'\<Running\>'" |
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.
and here...
a7b9fd5
to
b4740ef
Compare
@@ -132,12 +135,12 @@ install_ccruntime() { | |||
local pod="" | |||
local cmd="" | |||
for pod in cc-operator-daemon-install cc-operator-pre-install-daemon; do | |||
cmd="kubectl get pods -n "$op_ns" --no-headers |" | |||
cmd="kubectl get pods -n '$op_ns' --no-headers |" |
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.
Thanks, this one is fine as it's a variable substitution, but ... (see below)
tests/e2e/operator.sh
Outdated
|
||
local pod_id="$(get_pods_regex $pod $op_ns)" | ||
local pod_id | ||
pod_id="$(get_pods_regex '$pod' '$op_ns')" |
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.
^^ unlike variable substitution in shell execution the expansion starts over inside $( ... )
therefore here you need to use "
to expand the variables.
tests/e2e/operator.sh
Outdated
|
||
local pod_id="$(get_pods_regex $pod $op_ns)" | ||
local pod_id | ||
pod_id="$(get_pods_regex '$pod' '$op_ns')" |
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.
the same here, double quotes please
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.
@ldoktor thanks for the feedback changes applied
b4740ef
to
bd770b1
Compare
tests/e2e/operator.sh
Outdated
cmd+="egrep -q ${controller_pod}.*'\<Running\>'" | ||
if ! wait_for_process 120 10 "$cmd"; then | ||
echo "::error:: ${controller_pod} pod is not running" | ||
|
||
local pod_id="$(get_pods_regex $controller_pod $op_ns)" | ||
local pod_id | ||
pod_id="$(get_pods_regex '$controller_pod' '$op_ns')" |
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.
This one still needs to be treated ("
vs. '
)
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.
(It should be the last thing, consider it acked once it is addressed - I'm on PTO already, not sure when I get to it)
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.
@ldoktor changes applied
bd770b1
to
abe9283
Compare
This PR gives general improvements to the operator script that is being used in tests. This PR includes changes like better variable definition and the use of a variable that has been already defined. Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
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.
Thanks, lgtm now :-) (I'm sorry for the delay, it's PTO time...)
@stevenhorsman @wainersm the license check failed, do you have any experience with that? (this change should not have affected that) |
I think we can ignore it as no-one in development has access to the report to check the issue. There seems to have been some sort of org setting that has triggered this check running on all PRs as we have the same issue in the CAA repo. |
Well based on https://app.fossa.com/projects/git%2Bgithub.com%2Fconfidential-containers%2Foperator/refs/branch/main/abe928347a0ff9c3ecbeafceb0c761cc33cd4af1/browse/licenses I'd say it complains about |
The license check has been failing for a while. Unfortunately it's really hard to get details on why. Nobody has an account with FOSSA, but sometimes you can stumble onto the issue on the FOSSA page. Last I checked it was actually complaining about Kata, but I'm not sure what is happening this time. I wouldn't let it block this PR. |
Thanks for the confirmation, let me merge this awesome numbered PR :-) |
This PR gives general improvements to the operator script that is being used in tests. This PR includes changes like better variable definition and the use of a variable that has been already defined.