Skip to content

Commit

Permalink
Use consolidated config in lakectl
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-har committed Sep 26, 2023
1 parent 90c4fbd commit 8515199
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cmd/lakectl/cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ func newImportProgressBar(visible bool) *progressbar.ProgressBar {
}

func verifySourceMatchConfiguredStorage(ctx context.Context, client *apigen.ClientWithResponses, source string) {
storageConfResp, err := client.GetStorageConfigWithResponse(ctx)
DieOnErrorOrUnexpectedStatusCode(storageConfResp, err, http.StatusOK)
storageConfig := storageConfResp.JSON200
confResp, err := client.GetConfigWithResponse(ctx)
DieOnErrorOrUnexpectedStatusCode(confResp, err, http.StatusOK)
storageConfig := confResp.JSON200.StorageConfig
if storageConfig == nil {
Die("Bad response from server", 1)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/lakectl/cmd/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ func getLocalSyncFlags(cmd *cobra.Command, client *apigen.ClientWithResponses) s
presign := Must(cmd.Flags().GetBool(localPresignFlagName))
presignFlag := cmd.Flags().Lookup(localPresignFlagName)
if !presignFlag.Changed {
resp, err := client.GetStorageConfigWithResponse(cmd.Context())
resp, err := client.GetConfigWithResponse(cmd.Context())
DieOnErrorOrUnexpectedStatusCode(resp, err, http.StatusOK)
if resp.JSON200 == nil {
Die("Bad response from server", 1)
}
presign = resp.JSON200.PreSignSupport
presign = resp.JSON200.StorageConfig.PreSignSupport
}

parallelism := Must(cmd.Flags().GetInt(localParallelismFlagName))
Expand Down
10 changes: 5 additions & 5 deletions cmd/lakectl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,18 @@ var rootCmd = &cobra.Command{

client := getClient()

resp, err := client.GetLakeFSVersionWithResponse(cmd.Context())
resp, err := client.GetConfigWithResponse(cmd.Context())
if err != nil {
WriteIfVerbose(getLakeFSVersionErrorTemplate, err)
} else if resp.JSON200 == nil {
WriteIfVerbose(getLakeFSVersionErrorTemplate, resp.Status())
} else {
lakefsVersion := resp.JSON200
info.LakeFSVersion = swag.StringValue(lakefsVersion.Version)
if swag.BoolValue(lakefsVersion.UpgradeRecommended) {
info.LakeFSLatestVersion = swag.StringValue(lakefsVersion.LatestVersion)
info.LakeFSVersion = swag.StringValue(lakefsVersion.VersionConfig.Version)
if swag.BoolValue(lakefsVersion.VersionConfig.UpgradeRecommended) {
info.LakeFSLatestVersion = swag.StringValue(lakefsVersion.VersionConfig.LatestVersion)
}
upgradeURL := swag.StringValue(lakefsVersion.UpgradeUrl)
upgradeURL := swag.StringValue(lakefsVersion.VersionConfig.UpgradeUrl)
if upgradeURL != "" {
info.UpgradeURL = upgradeURL
}
Expand Down

0 comments on commit 8515199

Please sign in to comment.