Skip to content
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

refactor: Restructure the v2 library to match go module import requirements #48

Merged
merged 2 commits into from
Oct 31, 2023
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
2 changes: 1 addition & 1 deletion cmd/api-regression/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"os"

"github.com/Seagate/seagate-exos-x-api-go/pkg/regression"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/regression"

"github.com/onsi/ginkgo/v2"
"k8s.io/klog/v2"
Expand Down
36 changes: 18 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
module github.com/Seagate/seagate-exos-x-api-go
module github.com/Seagate/seagate-exos-x-api-go/v2

go 1.20

require (
github.com/go-logr/logr v1.2.4
github.com/golang/protobuf v1.5.3
github.com/namsral/flag v1.7.4-pre
github.com/onsi/ginkgo/v2 v2.9.5
github.com/onsi/gomega v1.27.6
github.com/prometheus/client_golang v1.11.1
github.com/stretchr/testify v1.6.1
golang.org/x/text v0.9.0
google.golang.org/grpc v1.53.0
gopkg.in/yaml.v2 v2.4.0
github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.28.1
github.com/prometheus/client_golang v1.17.0
github.com/stretchr/testify v1.8.4
golang.org/x/text v0.13.0
google.golang.org/grpc v1.59.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/klog/v2 v2.100.1
)
Expand All @@ -22,16 +21,17 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/tools v0.9.1 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/protobuf v1.28.1 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/tools v0.12.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
186 changes: 39 additions & 147 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/generator/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"fmt"
"os"

"github.com/Seagate/seagate-exos-x-api-go/internal/generator"
"github.com/Seagate/seagate-exos-x-api-go/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/pkg/common"
"github.com/Seagate/seagate-exos-x-api-go/v2/internal/generator"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/common"

"k8s.io/klog/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sort"
"strings"

"github.com/Seagate/seagate-exos-x-api-go/pkg/common"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/common"

"golang.org/x/text/cases"
"golang.org/x/text/language"
Expand Down
7 changes: 3 additions & 4 deletions internal/validator/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import (
"fmt"
"os"

"github.com/Seagate/seagate-exos-x-api-go/internal/validator"

"github.com/Seagate/seagate-exos-x-api-go/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/pkg/common"
"github.com/Seagate/seagate-exos-x-api-go/v2/internal/validator"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/common"

"k8s.io/klog/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/validator/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"net/http"

"github.com/Seagate/seagate-exos-x-api-go/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/client"

"github.com/go-logr/logr"
"k8s.io/klog/v2"
Expand Down
4 changes: 2 additions & 2 deletions pkg/v2/mcapi.go → pkg/api/mcapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"net/http"
"time"

"github.com/Seagate/seagate-exos-x-api-go/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/pkg/common"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/common"
"github.com/go-logr/logr"
"k8s.io/klog/v2"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/v2/snapshots.go → pkg/api/snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"
"time"

openapiclient "github.com/Seagate/seagate-exos-x-api-go/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/pkg/common"
openapiclient "github.com/Seagate/seagate-exos-x-api-go/v2/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/common"
"k8s.io/klog/v2"
)

Expand Down
9 changes: 7 additions & 2 deletions pkg/v2/system.go → pkg/api/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"strings"

"github.com/Seagate/seagate-exos-x-api-go/pkg/common"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/common"
"k8s.io/klog/v2"
)

Expand Down Expand Up @@ -201,6 +201,11 @@ func GetTargetId(system *common.SystemInfo, portType string) (string, error) {
return "", fmt.Errorf("TargetId was not found for system (%s) with (%d) ports", system.IPAddress, len(system.Ports))
}

// GetPortals: Return a list of portals for the storage system
func (client *Client) GetPortals() (string, error) {
return GetPortals(client.Info)
}

// GetPortals: Return a list of iSCSI portals for the storage system
func GetPortals(system *common.SystemInfo) (string, error) {
if system == nil {
Expand All @@ -224,5 +229,5 @@ func GetPortals(system *common.SystemInfo) (string, error) {
return portals, nil
}

return "", fmt.Errorf("No portals found for system (%s) with (%d) ports", system.IPAddress, len(system.Ports))
return "", fmt.Errorf("no portals found for system (%s) with (%d) ports", system.IPAddress, len(system.Ports))
}
4 changes: 2 additions & 2 deletions pkg/v2/volumes.go → pkg/api/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strconv"
"strings"

"github.com/Seagate/seagate-exos-x-api-go/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/pkg/common"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/common"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"k8s.io/klog/v2"
Expand Down
18 changes: 9 additions & 9 deletions pkg/client/test/api_default_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/common/mc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"strings"

"github.com/Seagate/seagate-exos-x-api-go/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/client"

"k8s.io/klog/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/regression/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package regression

import (
"github.com/Seagate/seagate-exos-x-api-go/pkg/common"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/common"
"github.com/go-logr/logr"
)

Expand Down
10 changes: 5 additions & 5 deletions pkg/regression/regression.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ package regression

import (
"context"
"io/ioutil"
"os"

"github.com/Seagate/seagate-exos-x-api-go/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/pkg/common"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/client"
"github.com/Seagate/seagate-exos-x-api-go/v2/pkg/common"
"github.com/go-logr/logr"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -46,7 +46,7 @@ func ReadConfigurationYaml(filename string) (*ConfigurationYaml, error) {
// If it is not possible to extract the configuration.yaml from the tar file, use defaults
var yamlc = ConfigurationYaml{}

yamlFile, err := ioutil.ReadFile(filename)
yamlFile, err := os.ReadFile(filename)
if err != nil {
return &yamlc, err
}
Expand Down
36 changes: 0 additions & 36 deletions pkg/regression/v1_login.go

This file was deleted.

Loading