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

Add new flag to collect minimal resources #206

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

Sheetalpamecha
Copy link
Contributor

Creating a flag to limit data collection to only major CRDs and CSVs, reducing time taken and log clutter.
It collects minimum required data and have kept the alignment similar to other flags for streamlined parsing.

Copy link
Contributor

openshift-ci bot commented Nov 6, 2024

Hi @Sheetalpamecha. Thanks for your PR.

I'm waiting for a red-hat-storage member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@Sheetalpamecha
Copy link
Contributor Author

@yati1998 and @black-dragon74 Please take a look.

@@ -93,6 +99,7 @@ Options:
-cl, --ceph-logs Collect ceph daemon, kernel, journal logs and crash reports
-ns, --namespaced Collect namespaced resources
-cs, --clusterscoped Collect clusterscoped resources
--minimal-crds Collect only relevant CRDs and CSVs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about adding short form for it too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, How about -mr, --minimal-resources?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MG always collects CRDs or resources. Let's omit it and call it -m, minimal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@yati1998
Copy link
Member

yati1998 commented Nov 6, 2024

@Sheetalpamecha can you link the issue which pointed to raise this PR? I didn't get why do we want only these specific crds to be collected? I just see this as a code duplication and I don't think user would be happy just with these resources to debug any case?

@Sheetalpamecha
Copy link
Contributor Author

Hi Yati, True there will be redundancy, As we want to highlight few configurations only and we don't want the logs and other information collected.
Here is the epic link - https://issues.redhat.com/browse/RHSTOR-5936

@@ -197,6 +204,12 @@ if [ "$clusterscoped" == true ] && [ "$odf" == false ]; then
pids+=($!)
fi

if [ "$minimal_crds" == true ] && [ "$odf" == false ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ "$minimal_crds" == true ] && [ "$odf" == false ]; then
if [ "$minimal_crds" == true ]; then

We do not need to check for odf == false here as the minimal script is not part of the odf collection. The reason we check for odf == false is so we do not collect resources that are collected with --odf mode twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm.. I think you forgot to commit the changes..

P.S: We should not mark conversations as resolved by ourselves as it makes it harder to keep track of changes for reviewers. Ideally, the person who left the comment resolves it upon confirming the changes :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, will be careful with future PRs.
Pushed the correct changes

@black-dragon74
Copy link
Collaborator

/ok-to-test

@@ -93,6 +99,7 @@ Options:
-cl, --ceph-logs Collect ceph daemon, kernel, journal logs and crash reports
-ns, --namespaced Collect namespaced resources
-cs, --clusterscoped Collect clusterscoped resources
-m, --minimal Collect only relevant CRDs and CSVs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more specific description would be nice. "only relevant" sounds a bit vague?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -197,6 +204,12 @@ if [ "$clusterscoped" == true ] && [ "$odf" == false ]; then
pids+=($!)
fi

if [ "$minimal" == true ]; then
echo "Collect minimal resource files..."
gather_minimal_resources ${BASE_COLLECTION_PATH} &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gather_minimal_resources ${BASE_COLLECTION_PATH} &
gather_minimal_resources &

Copy link
Contributor Author

@Sheetalpamecha Sheetalpamecha Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Niraj, We can keep it as it is, as this is to keep the same structure for all options as there will be a python script running over this. I have tested with both cmds but we should call with argument only for future use also.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s fine I guess. But if you look at actual scripts, none of them read this arg. They read the exported BASE_COLLECTION_PATH.

Anyways, let’s keep it.

@yati1998
Copy link
Member

@Sheetalpamecha I hope you have tested this change and verified that you are able to collect all the required crds using this flag?

Creating a flag to limit data collection to only major CRDs and CSVs,
reducing time taken and log clutter.

Signed-off-by: Sheetal Pamecha <[email protected]>
@Sheetalpamecha
Copy link
Contributor Author

Hi @yati1998 , Yes I have tested and this option is able to collect required crds.

@black-dragon74
Copy link
Collaborator

/lgtm
/approve

Copy link
Contributor

openshift-ci bot commented Nov 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: black-dragon74, Sheetalpamecha

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 7922423 into red-hat-storage:main Nov 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants