Skip to content

Commit

Permalink
change package name to make linter happy
Browse files Browse the repository at this point in the history
Signed-off-by: Silvio Moioli <silvio@moioli.net>
  • Loading branch information
moio committed May 31, 2024
1 parent 0b992f2 commit 5902a9a
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 52 deletions.
14 changes: 7 additions & 7 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/rancher/steve/pkg/server/handler"
"github.com/rancher/steve/pkg/server/router"
metricsStore "github.com/rancher/steve/pkg/stores/metrics"
"github.com/rancher/steve/pkg/stores/partition_alpha"
"github.com/rancher/steve/pkg/stores/proxy_alpha"
"github.com/rancher/steve/pkg/stores/partitionalpha"

Check failure on line 26 in pkg/server/server.go

View workflow job for this annotation

GitHub Actions / ci

found packages partition_alpha (partition_mocks.go) and partitionalpha (partitioner.go) in pkg/stores/partitionalpha (typecheck)
"github.com/rancher/steve/pkg/stores/proxyalpha"
"github.com/rancher/steve/pkg/summarycache"
"k8s.io/client-go/rest"
)
Expand Down Expand Up @@ -250,15 +250,15 @@ func setupAlpha(ctx context.Context, server *Server) error {
return err
}

s, err := proxy_alpha.NewProxyStore(cols, cf, summaryCache, nil)
s, err := proxyalpha.NewProxyStore(cols, cf, summaryCache, nil)
if err != nil {
panic(err)
}

errStore := proxy_alpha.NewErrorStore(
proxy_alpha.NewUnformatterStore(
proxy_alpha.NewWatchRefresh(
partition_alpha.NewStore(
errStore := proxyalpha.NewErrorStore(
proxyalpha.NewUnformatterStore(
proxyalpha.NewWatchRefresh(
partitionalpha.NewStore(
s,
asl,
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package listprocessor_alpha contains methods for filtering, sorting, and paginating lists of objects.
package listprocessor_alpha
// Package listprocessor contains methods for filtering, sorting, and paginating lists of objects.
package listprocessor

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package listprocessor_alpha
package listprocessor

import (
"context"
Expand All @@ -15,7 +15,7 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

//go:generate mockgen --build_flags=--mod=mod -package listprocessor_alpha -destination ./proxy_mocks_test.go github.com/rancher/steve/pkg/stores/proxy_alpha Cache
//go:generate mockgen --build_flags=--mod=mod -package listprocessor -destination ./proxy_mocks_test.go github.com/rancher/steve/pkg/stores/proxyalpha Cache

func TestParseQuery(t *testing.T) {
type testCase struct {
Expand Down

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

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package partition_alpha
package partitionalpha

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package partition_alpha
package partitionalpha

import (
"github.com/golang/mock/gomock"
"testing"

"github.com/golang/mock/gomock"

"github.com/rancher/apiserver/pkg/types"
"github.com/rancher/lasso/pkg/cache/sql/partition"
"github.com/rancher/steve/pkg/accesscontrol"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package partition_alpha implements a store with parallel partitioning of data
// so that segmented data can be concurrently collected and returned as a single data set.
package partition_alpha
package partitionalpha

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
package partition_alpha
package partitionalpha

import (
"context"
"crypto/sha256"
"encoding/base64"
"fmt"
"github.com/golang/mock/gomock"
"github.com/rancher/wrangler/v2/pkg/schemas"
"github.com/stretchr/testify/assert"
"net/http"
"net/url"
"strconv"
"testing"

"github.com/golang/mock/gomock"
"github.com/rancher/wrangler/v2/pkg/schemas"
"github.com/stretchr/testify/assert"

"github.com/rancher/apiserver/pkg/types"
"github.com/rancher/lasso/pkg/cache/sql/partition"
"github.com/rancher/steve/pkg/accesscontrol"
"github.com/rancher/steve/pkg/stores/proxy_alpha"
"github.com/rancher/steve/pkg/stores/proxyalpha"
"github.com/rancher/wrangler/v2/pkg/generic"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -27,7 +28,7 @@ import (
"k8s.io/apiserver/pkg/endpoints/request"
)

//go:generate mockgen --build_flags=--mod=mod -package partition_alpha -destination partition_mocks.go "github.com/rancher/steve/pkg/stores/partition_alpha" Partitioner,UnstructuredStore
//go:generate mockgen --build_flags=--mod=mod -package partition_alpha -destination partition_mocks.go "github.com/rancher/steve/pkg/stores/partitionalpha" Partitioner,UnstructuredStore

func TestList(t *testing.T) {
type testCase struct {
Expand Down Expand Up @@ -136,7 +137,7 @@ func TestList(t *testing.T) {
}

type mockPartitioner struct {
store proxy_alpha.Store
store proxyalpha.Store
partitions map[string][]partition.Partition
}

Expand All @@ -149,7 +150,7 @@ func (m mockPartitioner) All(apiOp *types.APIRequest, schema *types.APISchema, v
return m.partitions[user.GetName()], nil
}

func (m mockPartitioner) Store() proxy_alpha.Store {
func (m mockPartitioner) Store() proxyalpha.Store {
return m.store
}

Expand Down

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package proxy_alpha
package proxyalpha

import (
"github.com/rancher/apiserver/pkg/apierror"
Expand Down

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package proxy implements the proxy store, which is responsible for interfacing directly with Kubernetes.
package proxy_alpha
package proxyalpha

import (
"context"
Expand All @@ -22,8 +22,8 @@ import (
"github.com/rancher/steve/pkg/attributes"
"github.com/rancher/steve/pkg/resources/common"
metricsStore "github.com/rancher/steve/pkg/stores/metrics"
"github.com/rancher/steve/pkg/stores/partition_alpha/listprocessor_alpha"
"github.com/rancher/steve/pkg/stores/proxy_alpha/tablelistconvert"
"github.com/rancher/steve/pkg/stores/partitionalpha/listprocessor"
"github.com/rancher/steve/pkg/stores/proxyalpha/tablelistconvert"
"github.com/rancher/wrangler/v2/pkg/data"
"github.com/rancher/wrangler/v2/pkg/schemas"
"github.com/rancher/wrangler/v2/pkg/schemas/validation"
Expand Down Expand Up @@ -600,7 +600,7 @@ func (s *Store) Delete(apiOp *types.APIRequest, schema *types.APISchema, id stri

// ListByPartitions returns an unstructured list of resources belonging to any of the specified partitions
func (s *Store) ListByPartitions(apiOp *types.APIRequest, schema *types.APISchema, partitions []partition.Partition) ([]unstructured.Unstructured, string, error) {
opts, err := listprocessor_alpha.ParseQuery(apiOp, s.namespaceCache)
opts, err := listprocessor.ParseQuery(apiOp, s.namespaceCache)
if err != nil {
return nil, "", err
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
package proxy_alpha
package proxyalpha

import (
"context"
"fmt"
"net/http"
"net/url"
"testing"
"time"

"github.com/golang/mock/gomock"
"github.com/rancher/lasso/pkg/cache/sql/informer"
"github.com/rancher/lasso/pkg/cache/sql/informer/factory"
"github.com/rancher/lasso/pkg/cache/sql/partition"
"github.com/rancher/steve/pkg/attributes"
"github.com/rancher/steve/pkg/resources/common"
"github.com/rancher/steve/pkg/stores/partition_alpha/listprocessor_alpha"
"github.com/rancher/steve/pkg/stores/proxy_alpha/tablelistconvert"
"github.com/rancher/steve/pkg/stores/partitionalpha/listprocessor"
"github.com/rancher/steve/pkg/stores/proxyalpha/tablelistconvert"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"net/http"
"net/url"
"testing"
"time"

"github.com/pkg/errors"
"github.com/rancher/apiserver/pkg/types"
Expand Down Expand Up @@ -224,7 +225,7 @@ func TestListByPartitions(t *testing.T) {
// ListByPartitions copies point so we need some original record of items to ensure as asserting listToReturn's
// items is equal to the list returned by ListByParititons doesn't ensure no mutation happened
copy(listToReturn.Items, expectedItems)
opts, err := listprocessor_alpha.ParseQuery(req, nil)
opts, err := listprocessor.ParseQuery(req, nil)
assert.Nil(t, err)
cg.EXPECT().TableAdminClient(req, schema, "", &WarningBuffer{}).Return(ri, nil)
// This tests that fields are being extracted from schema columns and the type specific fields map
Expand Down Expand Up @@ -292,7 +293,7 @@ func TestListByPartitions(t *testing.T) {
copy(listToReturn.Items, expectedItems)

nsi.EXPECT().ListByOptions(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, "", fmt.Errorf("error")).Times(2)
_, err := listprocessor_alpha.ParseQuery(req, nsi)
_, err := listprocessor.ParseQuery(req, nsi)
assert.NotNil(t, err)

_, _, err = s.ListByPartitions(req, schema, partitions)
Expand Down Expand Up @@ -354,7 +355,7 @@ func TestListByPartitions(t *testing.T) {
// ListByPartitions copies point so we need some original record of items to ensure as asserting listToReturn's
// items is equal to the list returned by ListByParititons doesn't ensure no mutation happened
copy(listToReturn.Items, expectedItems)
_, err := listprocessor_alpha.ParseQuery(req, nil)
_, err := listprocessor.ParseQuery(req, nil)
assert.Nil(t, err)
cg.EXPECT().TableAdminClient(req, schema, "", &WarningBuffer{}).Return(nil, fmt.Errorf("error"))

Expand Down Expand Up @@ -417,7 +418,7 @@ func TestListByPartitions(t *testing.T) {
// ListByPartitions copies point so we need some original record of items to ensure as asserting listToReturn's
// items is equal to the list returned by ListByParititons doesn't ensure no mutation happened
copy(listToReturn.Items, expectedItems)
_, err := listprocessor_alpha.ParseQuery(req, nil)
_, err := listprocessor.ParseQuery(req, nil)
assert.Nil(t, err)
cg.EXPECT().TableAdminClient(req, schema, "", &WarningBuffer{}).Return(ri, nil)
// This tests that fields are being extracted from schema columns and the type specific fields map
Expand Down Expand Up @@ -489,7 +490,7 @@ func TestListByPartitions(t *testing.T) {
// ListByPartitions copies point so we need some original record of items to ensure as asserting listToReturn's
// items is equal to the list returned by ListByParititons doesn't ensure no mutation happened
copy(listToReturn.Items, expectedItems)
opts, err := listprocessor_alpha.ParseQuery(req, nil)
opts, err := listprocessor.ParseQuery(req, nil)
assert.Nil(t, err)
cg.EXPECT().TableAdminClient(req, schema, "", &WarningBuffer{}).Return(ri, nil)
// This tests that fields are being extracted from schema columns and the type specific fields map
Expand Down

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package proxy_alpha
package proxyalpha

import (
"github.com/rancher/apiserver/pkg/types"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package proxy_alpha
package proxyalpha

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package proxy_alpha
package proxyalpha

import (
"context"
Expand Down

0 comments on commit 5902a9a

Please sign in to comment.