-
Notifications
You must be signed in to change notification settings - Fork 28
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
clean cephFS omap details #237
Conversation
https://github.com/rook/kubectl-rook-ceph/actions/runs/7799941151/job/21272736952?pr=237#step:12:20
|
The plugin may not understand that it needs to append the mon and cluster commands to the |
That works @travisn . Thanks. |
63b1880
to
013ee98
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.
Also, please update commit/PR title
c52d3b6
to
d881f18
Compare
The CI is failing:
|
d881f18
to
8197c19
Compare
Yes, this error is expected. Updated the test to include error in output. |
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 think we should start testing all these functionalities in the CI to ensure it works, Please add test cases for it
docs/subvolume.md
Outdated
# Error: error getting omap keys ocs-storagecluster-cephfilesystem-metadata/test.subvolume: | ||
# (2) No such file or directory | ||
# . failed to run command. command terminated with exit code 1%!(EXTRA string=failed to list omapval) |
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.
why do we have this 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.
Incase the subvolume is created from backend and it's stale, there will be no omap created for it. In that case if we try to delete the omap, it will through this 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.
let's document the happy case output.
978ee47
to
07b74fd
Compare
docs/subvolume.md
Outdated
# Error: error getting omap keys ocs-storagecluster-cephfilesystem-metadata/test.subvolume: | ||
# (2) No such file or directory | ||
# . failed to run command. command terminated with exit code 1%!(EXTRA string=failed to list omapval) |
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.
let's document the happy case output.
6ffcf46
to
b9336f1
Compare
40198f5
to
40a2196
Compare
tests := []struct { | ||
name string | ||
want string | ||
}{ |
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.
Maybe consider adding negative tests as well? An empty string, a string with only no, one or two -
in there probably are problematic and cause issues. It may be unlikely that these get passed to the function, but you should be prepared for weird issues in a cleanup process, some values may be unexpectedly missing or somehow got corrupted.
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'm not sure if the added tests provide the needed or expected results to whatever calls getOmapVal()
. But this at least confirms that there are no panics happening.
My feedback has been addressed. After CI is passing 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.
Looks good to me. If there are any missed corner-cases where cleanup isn't working as expected, this can always be improved later.
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.
@yati1998 please rebase your PR to get latest ci fixes.
@Madhu-1 waiting for your review here. Please feel free to add your comments. |
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,
small nits
if err != nil || poolName == "" { | ||
logging.Fatal(fmt.Errorf("pool name not found: %q", err)) |
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.
same here as well
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.
yes, it's not required.
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, since this clean cephfs OMAP please update the commit title and PR title to mention cephFS OMAP
this commit deletes the omap presence of the stale subvolume Signed-off-by: yati1998 <ypadia@redhat.com>
Remove the omap object for the given subvolume.