-
Notifications
You must be signed in to change notification settings - Fork 362
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
Remove lakectl direct deprecated functionality #6623
Conversation
♻️ PR Preview 2eec97b has been successfully destroyed since this PR has been closed. 🤖 By surge-preview |
esti/adapters_test.go
Outdated
@@ -8,6 +8,8 @@ import ( | |||
"strings" | |||
"time" | |||
|
|||
"github.com/treeverse/lakefs/pkg/api/helpers" | |||
|
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.
@@ -1,4 +1,4 @@ | |||
package helpers | |||
package esti |
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.
- Do we use all the functions defined here only in Esti?
- I'm not sure about the new file name, it says adapter_test but there are no 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.
The helper package had adapters that include upload direct.
All the tests that used direct were removed. Except the GC test that I wasn't sure if we like to remove this case - until we will enable different way, like presign.
I've moved the code into the system test (esti) so I've kept the name and added _test
as this code should be built only when running test.
require.Equalf(t, objContent, body, "path: %s, expected: %s, actual:%s", objPath, objContent, body) | ||
}) | ||
} | ||
ctx, _, repo := setupTest(t) |
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.
Unrelated question to this PR- how do we check that everything works with pre-signed mode?
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.
presign_test.go
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 that a better way to test it is to run all the tests in another suit with the pre-signed flag on so we don't have to remember to add a new test for every command/feature we add but again, it doesn't related to this PR
if direct { | ||
stats, err := helpers.ClientUploadDirect(ctx, client, repo, branch, objPath, nil, "", strings.NewReader(objContent)) | ||
stats, err := uploadContentDirect(ctx, client, repo, branch, objPath, nil, "", strings.NewReader(objContent)) |
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 you didn't remove the direct flag from the uploadFileAndReport
and uploadFileRandomDataAndReport
functions?
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.
There are specific GC tests that upload direct so I've moved the implementation and kept the test helper function.
// uploadContentDirect uploads contents as a file using client-side ("direct") access to underlying storage. | ||
// It requires credentials both to lakeFS and to underlying storage, but considerably reduces the load on the lakeFS | ||
// server. | ||
func uploadContentDirect(ctx context.Context, client apigen.ClientWithResponsesInterface, repoID, branchID, objPath string, metadata map[string]string, contentType string, contents io.ReadSeeker) (*apigen.ObjectStats, 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.
I'm not sure I understand why we still need this
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.
If we do not require direct upload for GC testing, I'll remove this functionality.
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
Fix #6479