Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:
create:
tags:
- 'v*'
permissions:
contents: write

Expand All @@ -25,6 +29,11 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: '1.22.0'
-
name: Remove conflicting go.mod
run: |
# Remove cmd/lsh/go.mod as it conflicts with root go.mod
rm -f cmd/lsh/go.mod
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand All @@ -48,6 +57,11 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: '1.22.0'
-
name: Remove conflicting go.mod
run: |
# Remove cmd/lsh/go.mod as it conflicts with root go.mod
rm -f cmd/lsh/go.mod
-
name: Generate documentation
run: go run internal/generator/documentation/generate.go
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ project_name: lsh

before:
hooks:
# Remove conflicting go.mod in cmd/lsh if it exists
- rm -f cmd/lsh/go.mod
- go mod tidy
- go mod download

Expand Down
7 changes: 4 additions & 3 deletions cli/block_get_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"

latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/lsh/cmd/lsh"
"github.com/latitudesh/lsh/internal/cmdflag"
"github.com/latitudesh/lsh/internal/utils"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -67,8 +68,8 @@ func (o *BlockGetOperation) run(cmd *cobra.Command, args []string) error {
return fmt.Errorf("error getting block ID: %w", err)
}

if dryRun {
logDebugf("dry-run flag specified. Skip sending request.")
if lsh.DryRun {
lsh.LogDebugf("dry-run flag specified. Skip sending request.")
return nil
}

Expand All @@ -94,7 +95,7 @@ func (o *BlockGetOperation) run(cmd *cobra.Command, args []string) error {
return nil
}

if !debug {
if !lsh.Debug {
if response != nil && response.HTTPMeta.Response != nil {
fmt.Fprintf(os.Stdout, "Block storage details retrieved (Status: %s)\n", response.HTTPMeta.Response.Status)
fmt.Fprintf(os.Stdout, "\nNote: This command will show connector_id, gateway IP, and port once the API returns them.\n")
Expand Down
7 changes: 4 additions & 3 deletions cli/block_list_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"

latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/lsh/cmd/lsh"
"github.com/latitudesh/lsh/internal/cmdflag"
"github.com/latitudesh/lsh/internal/utils"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -64,8 +65,8 @@ func (o *BlockListOperation) run(cmd *cobra.Command, args []string) error {
// Get optional project filter
project, _ := cmd.Flags().GetString("project")

if dryRun {
logDebugf("dry-run flag specified. Skip sending request.")
if lsh.DryRun {
lsh.LogDebugf("dry-run flag specified. Skip sending request.")
return nil
}

Expand Down Expand Up @@ -93,7 +94,7 @@ func (o *BlockListOperation) run(cmd *cobra.Command, args []string) error {
return nil
}

if !debug {
if !lsh.Debug {
if response != nil && response.HTTPMeta.Response != nil {
fmt.Fprintf(os.Stdout, "Block storages listed successfully (Status: %s)\n", response.HTTPMeta.Response.Status)
fmt.Fprintf(os.Stdout, "\nNote: Use 'lsh block get --id <BLOCK_ID>' to see full details including connector information\n")
Expand Down
11 changes: 6 additions & 5 deletions cli/block_mount_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"github.com/latitudesh/lsh/cmd/lsh"
"github.com/latitudesh/lsh/internal/cmdflag"
"github.com/latitudesh/lsh/internal/utils"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -450,8 +451,8 @@ func (o *BlockMountOperation) run(cmd *cobra.Command, args []string) error {
printStatus(fmt.Sprintf("✓ Using NQN: %s", nqn))
}

if dryRun {
logDebugf("dry-run flag specified. Skip sending request.")
if lsh.DryRun {
lsh.LogDebugf("dry-run flag specified. Skip sending request.")
return nil
}

Expand All @@ -478,7 +479,7 @@ func (o *BlockMountOperation) run(cmd *cobra.Command, args []string) error {
fmt.Fprintf(os.Stdout, "\n📋 Fetching block storage details...\n")
printStatus(fmt.Sprintf("Block ID: %s", blockID))

if debug {
if lsh.Debug {
fmt.Fprintf(os.Stdout, "[DEBUG] Fetching block storage details to get connector_id\n")
}

Expand Down Expand Up @@ -546,7 +547,7 @@ func (o *BlockMountOperation) run(cmd *cobra.Command, args []string) error {
printStatus(fmt.Sprintf("Block ID: %s", blockID))
printStatus(fmt.Sprintf("Client NQN (for authorization): %s", nqn))

if debug {
if lsh.Debug {
fmt.Fprintf(os.Stdout, "[DEBUG] API Request: POST /storage/blocks/%s/mount\n", blockID)
fmt.Fprintf(os.Stdout, "[DEBUG] Request Body: {\"data\":{\"type\":\"blocks\",\"attributes\":{\"nqn\":\"%s\"}}}\n", nqn)
}
Expand All @@ -568,7 +569,7 @@ func (o *BlockMountOperation) run(cmd *cobra.Command, args []string) error {
return err
}

if debug {
if lsh.Debug {
fmt.Fprintf(os.Stdout, "[DEBUG] API Response Status: %d\n", response.HTTPMeta.Response.StatusCode)
}

Expand Down
3 changes: 0 additions & 3 deletions cmd/lsh/go.mod

This file was deleted.

Loading