-
Notifications
You must be signed in to change notification settings - Fork 331
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
Update lakectl abuse to use set/link physical address #7743
Conversation
7b785f0
to
5ae1894
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.
Thanks for adding the tests!
} | ||
}) | ||
}, | ||
|
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.
Can you add a simple comment about the fact that you're linking without uploading to the object store?
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.
Don't understand the driver code, sorry. The whole objects upload run command part is weird.
esti/lakectl_test.go
Outdated
} | ||
for _, tt := range tests { | ||
t.Run(tt.Cmd, func(t *testing.T) { | ||
RunCmdAndVerifyContainsText(t, Lakectl()+" abuse "+tt.Cmd+" lakefs://"+repoName+"/"+mainBranch+" --amount "+strconv.Itoa(tt.Amount)+" "+tt.AdditionalArgs, false, "errors: 0", map[string]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.
This string may be easier to read if generated from a template or using fmt.Sprintf
.
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.
Done
const totalObjects = 5 | ||
for i := 0; i < totalObjects; i++ { | ||
vars["FILE_PATH"] = fmt.Sprintf("data/ro/ro_1k.%d", i) | ||
fromFile = fromFile + vars["FILE_PATH"] + "\n" |
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 don't understand this loop at all.
- Each iteration appends an entire new line to
fromFile
! How does that run? - What writes these 5 objects? Do they need to be added to the repo?
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 commands read a file from the provided param and reads line by lines keys from the file
- What writes these 5 objects is line 876 (now 875), we use an existing test file in our repo for the physical object
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.
OK, thanks! The code is a bit confusing. I would probably find it easier to read if you wrote the filename to the abuse-read
file immediately, rather than build a string in-memory and then write it on l. 879.
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 agree but this requires us to handle stdin input in the lakectl tests... 😬
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!
const totalObjects = 5 | ||
for i := 0; i < totalObjects; i++ { | ||
vars["FILE_PATH"] = fmt.Sprintf("data/ro/ro_1k.%d", i) | ||
fromFile = fromFile + vars["FILE_PATH"] + "\n" |
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.
OK, thanks! The code is a bit confusing. I would probably find it easier to read if you wrote the filename to the abuse-read
file immediately, rather than build a string in-memory and then write it on l. 879.
* Update lakectl abuse to use set/link physical address * CR Fixes * Fix test
Closes #7740
Change Description
Background
Modify lakectl abuse random-write so that it will reflect the behavior of lakeFS
Bug Fix
Added some bug fixes and tests to the abuse commands
Testing Details
Added esti tests