-
Notifications
You must be signed in to change notification settings - Fork 105
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
CNF-11815: e2e: Added node inspector for inspecting nodes configuration #1008
CNF-11815: e2e: Added node inspector for inspecting nodes configuration #1008
Conversation
56d838d
to
43743a9
Compare
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, possible improvements inside
test/e2e/performanceprofile/functests/utils/clusterrole/clusterrole.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/clusterrolebinding/clusterrolebinding.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/daemonset/daemonset.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/daemonset/daemonset.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/daemonset/daemonset.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/daemonset/daemonset.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/serviceaccount/serviceaccount.go
Outdated
Show resolved
Hide resolved
43743a9
to
7c6d163
Compare
@rbaturov: This pull request references CNF-11815 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 story to target the "4.16.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. |
/hold |
d61ea00
to
294c4af
Compare
test/e2e/performanceprofile/functests/0_config/test_suite_performance_config_test.go
Outdated
Show resolved
Hide resolved
} | ||
|
||
// ExecCommandOnMachineConfigDaemon returns the output of the command execution on the machine-config-daemon pod that runs on the specified node | ||
func ExecCommandOnMachineConfigDaemon(ctx context.Context, node *corev1.Node, command []string) ([]byte, error) { |
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.
Both ExecCommandOnTestingDaemonPod
and ExecCommandOnNode
have the same purpose.
Unless there is a very good reason to have both functions, I would merge them into one named:
ExecCommandOnNode
which declare explicitly where the command is about to be 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.
@Tal-or
ExecCommandOnTestingDaemonPod
is being used as an underlying function for ExecCommandOnNode
.
The difference between the two is that ExecCommandOnNode
returns a string (after some formatting) rather than a bytes slice (ExecCommandOnTestingDaemonPod
).
As throughout the repo, developers have chosen to use both of them, I think we should keep both of these functions and just rename them appropriately. (Another option is to unify them to one function that returns []bytes and change all calls to target this func, following a call if needed to a util function that will do the string format that is left). But again the latter option would require some work for refactoring.
WDYT?
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.
Then let's keep them and just rename ExecCommandOnTestingDaemonPod
.
We don't want to steer too much from the scope of this work
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.
@Tal-or I'll need to rename ExecCommandOnNode
to ExecCommandOnNodeToString
and ExecCommandOnTestingDaemonPod
which returns a []byte to ExecCommandOnNode
.
This however, may cause a slight confusion for developers that got used that ExecCommandOnNode
returns a string. but I think this is not a big deal.
Another option could be to change ExecCommandOnTestingDaemonPod
to ExecCommandOnNodeToByteSlice
. I personally think we should go with the first option, even if it might cause a bit of confusion.
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.
since the name of the package is nodes
I would rename ExecCommandOnTestingDaemonPod
to ExecCommand
and call it a day.
From the caller site it looks like:
nodes.ExecCommand()
The package name provides a clear indication about where this command is about to be 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.
But what will be the name of the second func?
Anyways I was thinking that we should move these functions to the node inspector package, as they rely on it running.
So it's going to be more of nodeInspector.ExecCommand...
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 node inspector is an implementation detail. you can call nodeInspector.ExecCommand
from nodes.ExecCommand
294c4af
to
3648ece
Compare
3648ece
to
ddddb84
Compare
ddddb84
to
1247887
Compare
@rbaturov: This pull request references CNF-11815 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 story to target the "4.16.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. |
/retest-required |
1247887
to
ee990a0
Compare
@Tal-or ready for another review iteration |
90cba92
to
14f169e
Compare
/retest-required |
14f169e
to
390015c
Compare
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.
/approve
I like the direction and we surely want this change. A few inline comments/questions
test/e2e/performanceprofile/functests/utils/daemonset/daemonset.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/node_inspector/inspector.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/node_inspector/inspector.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/node_inspector/inspector.go
Outdated
Show resolved
Hide resolved
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ffromani, rbaturov 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 |
test/e2e/performanceprofile/functests/utils/node_inspector/inspector.go
Outdated
Show resolved
Hide resolved
390015c
to
fd8cb0c
Compare
@Tal-or @ffromani
|
test/e2e/performanceprofile/functests/utils/node_inspector/inspector.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/utils/node_inspector/inspector.go
Outdated
Show resolved
Hide resolved
dc71b58
to
a7b20dc
Compare
On hypershift there is no MCO, hence there are no machine-config-daemon pods. A different resolution is needed for accessing the underlying node for inspecting configurations. This commit introduces a node inspector implemented as a daemonset. Upon execution of test suites, a pod with elevated privileges and host filesystem mounted will be deployed on every node. Also I have added Z-deconfig suite ('Z' prefix, will guarantee that it will be the last suite run) that will be used for cleanup. This API will be used for both hypershift and non-hypershift systems. Signed-off-by: Ronny Baturov <[email protected]>
Adding trap command in the run-test.sh script will ensure the Z_deconfig suite will run, thereby deleting the node inspector. Signed-off-by: Ronny Baturov <[email protected]>
Updated these functions to use the node inspector rather than the MCD. Furthermore, I have renamed these functions to better reflect their purposes and usage. Signed-off-by: Ronny Baturov <[email protected]>
639d431
to
41e92a5
Compare
/retest-required |
2 similar comments
/retest-required |
/retest-required |
Refactor all calls to the unified function: ExecCommand. Added a util ToString function that will be used for the calls that require the output in a string format. Signed-off-by: Ronny Baturov <[email protected]>
41e92a5
to
362196e
Compare
/retest-required |
@rbaturov: all tests passed! Full PR test history. Your PR dashboard. 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/lgtm |
/label acknowledge-critical-fixes-only |
On hypershift there is no MCO, hence there are no machine-config-daemon pods.
A different resolution is needed for accessing the underlying node for inspecting configurations.
This commit introduces a node inspector implemented as a daemonset.
Upon execution of test suites, a pod with elevated privileges and host filesystem mounted will be deployed on every node.
Also I have added Z-deconfig suite ('Z' prefix, will guarantee that it will be the last suite run) that will be used for cleanup.
This API will be used for both hypershift and non-hypershift systems.