-
Notifications
You must be signed in to change notification settings - Fork 367
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 --storage-id flag to Repo Create CLI #8557
base: master
Are you sure you want to change the base?
Conversation
🎊 PR Preview 2049918 has been successfully built and deployed to https://treeverse-lakeFS-preview-pr-8557.surge.sh 🕐 Build time: 0.01s 🤖 By surge-preview |
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!
Some comments regarding documentation +
Please add esti tests
I have some reservations on documenting this parameter ATM.
Also, lets have a discussion on this in a different forum
cmd/lakectl/cmd/repo_create.go
Outdated
@@ -16,7 +16,7 @@ const ( | |||
|
|||
// repoCreateCmd represents the create repo command | |||
var repoCreateCmd = &cobra.Command{ | |||
Use: "create <repository URI> <storage namespace>", | |||
Use: "create <repository URI> <storage namespace> [--storage-id <storage id>]", |
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.
Lets not document this flag ATM and open an issue to discuss that
cmd/lakectl/cmd/repo_create.go
Outdated
@@ -48,6 +52,7 @@ var repoCreateCmd = &cobra.Command{ | |||
//nolint:gochecknoinits | |||
func init() { | |||
repoCreateCmd.Flags().StringP("default-branch", "d", DefaultBranch, "the default branch of this repository") | |||
repoCreateCmd.Flags().String("storage-id", "", "the storage of this repository") |
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.
Suggest we make this a hidden flag for now
cmd/lakectl/cmd/repo_create_bare.go
Outdated
@@ -10,7 +10,7 @@ import ( | |||
|
|||
// repoCreateBareCmd represents the create repo command | |||
var repoCreateBareCmd = &cobra.Command{ | |||
Use: "create-bare <repository URI> <storage namespace>", | |||
Use: "create-bare <repository URI> <storage namespace> [--storage-id <storage id>]", |
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 comments as the "create" command
@N-o-Z regarding esti - Any other esti tests you think should be added? |
We should test 2 things:
|
Add the first, @N-o-Z Can you think of a way to test this, or are you OK with having the Config tests covering this part? |
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.
Still missing a couple of things
@@ -52,7 +52,7 @@ var repoCreateCmd = &cobra.Command{ | |||
//nolint:gochecknoinits | |||
func init() { | |||
repoCreateCmd.Flags().StringP("default-branch", "d", DefaultBranch, "the default branch of this repository") | |||
repoCreateCmd.Flags().String("storage-id", "", "the storage of this repository") | |||
repoCreateCmd.Flags().String("storage-id", "", "") |
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 please define the storage-id flag globally (see withNoProgress
as example) and set its property to hidden so it won't show up in the CLI docs (MarkHidden
)
esti/lakectl_test.go
Outdated
"BRANCH": mainBranch, | ||
} | ||
RunCmdAndVerifySuccessWithFile(t, Lakectl()+" repo create lakefs://"+repoNameSID+" "+storageSID+" --storage-id \"\"", false, "lakectl_repo_create", vars) | ||
|
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 it would be better to separate this into a different test.
Also, missing the failure scenario when running it with storage_id != ""
@N-o-Z fixed - |
Closes #8511.
Change Description
Support creating a repository with storageID in the CLI.