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

clean go package import #379

Merged
merged 1 commit into from
Aug 11, 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
1 change: 0 additions & 1 deletion .ci/yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
extends: default

ignore: |
customresourcedefinitions.gen.yaml
manifests/charts/aeraki/templates/deployment.yaml
manifests/charts/aeraki/templates/service.yaml
manifests/charts/aeraki/templates/serviceaccount.yaml
Expand Down
14 changes: 7 additions & 7 deletions client-go/pkg/clientset/versioned/fake/register.gen.go

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

14 changes: 7 additions & 7 deletions client-go/pkg/clientset/versioned/scheme/register.gen.go

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

3 changes: 1 addition & 2 deletions cmd/aeraki/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"syscall"

"github.com/google/uuid"
"istio.io/pkg/log"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Into the golang package import detection mechanism in the future


"github.com/aeraki-mesh/aeraki/internal/bootstrap"
"github.com/aeraki-mesh/aeraki/internal/config/constants"
Expand All @@ -31,8 +32,6 @@ import (
"github.com/aeraki-mesh/aeraki/internal/plugin/metaprotocol"
"github.com/aeraki-mesh/aeraki/internal/plugin/thrift"
"github.com/aeraki-mesh/aeraki/internal/plugin/zookeeper"

"istio.io/pkg/log"
)

const (
Expand Down
13 changes: 6 additions & 7 deletions internal/bootstrap/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ import (
"fmt"
"net"
"net/http"
"sync"
"sync/atomic"
"time"

//nolint: gosec
// nolint
_ "net/http/pprof" // pprof

"istio.io/istio/pkg/config/mesh"
"sync"
"sync/atomic"
"time"

aerakischeme "github.com/aeraki-mesh/client-go/pkg/clientset/versioned/scheme"
istioscheme "istio.io/client-go/pkg/apis/networking/v1alpha3"
"istio.io/client-go/pkg/clientset/versioned"
"istio.io/istio/pilot/pkg/model"
istioconfig "istio.io/istio/pkg/config"
"istio.io/istio/pkg/config/mesh"
kubelib "istio.io/istio/pkg/kube"
"istio.io/pkg/log"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -44,8 +45,6 @@ import (
kubeconfig "sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"

aerakischeme "github.com/aeraki-mesh/client-go/pkg/clientset/versioned/scheme"

"github.com/aeraki-mesh/aeraki/internal/controller/istio"
"github.com/aeraki-mesh/aeraki/internal/controller/kube"
"github.com/aeraki-mesh/aeraki/internal/envoyfilter"
Expand Down
8 changes: 3 additions & 5 deletions internal/ca/istio_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ import (
"path"
"time"

"istio.io/istio/security/pkg/pki/util"

"istio.io/istio/pilot/pkg/bootstrap"
"istio.io/istio/security/pkg/cmd"
"istio.io/pkg/env"

"istio.io/istio/pkg/security"
"istio.io/istio/security/pkg/cmd"
"istio.io/istio/security/pkg/pki/ca"
"istio.io/istio/security/pkg/pki/ra"
"istio.io/istio/security/pkg/pki/util"
"istio.io/pkg/env"
"istio.io/pkg/log"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
)
Expand Down
12 changes: 3 additions & 9 deletions internal/controller/istio/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ import (
"strings"
"time"

"github.com/aeraki-mesh/aeraki/internal/model"

"istio.io/istio/pkg/security"

"istio.io/istio/security/pkg/nodeagent/cache"

discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
networking "istio.io/api/networking/v1alpha3"
"istio.io/istio/pilot/pkg/config/memory"
Expand All @@ -33,18 +27,18 @@ import (
istioconfig "istio.io/istio/pkg/config"
"istio.io/istio/pkg/config/schema/collection"
"istio.io/istio/pkg/config/schema/collections"
"istio.io/istio/pkg/security"
"istio.io/istio/security/pkg/nodeagent/cache"
citadel "istio.io/istio/security/pkg/nodeagent/caclient/providers/citadel"
"istio.io/pkg/log"

"github.com/aeraki-mesh/aeraki/internal/model"
"github.com/aeraki-mesh/aeraki/internal/model/protocol"
)

const (
// istiodCACertPath is the ca volume mount file name for istio root ca.
istiodCACertPath = "/var/run/secrets/istio/root-cert.pem"

// K8sSAJwtFileName is the token volume mount file name for k8s jwt token.
K8sSAJwtFileName = "/var/run/secrets/kubernetes.io/serviceaccount/token"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions internal/controller/kube/dubbo.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package kube
import (
"context"

"github.com/aeraki-mesh/client-go/pkg/apis/dubbo/v1alpha1"
"istio.io/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/event"
Expand All @@ -25,8 +26,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"

"github.com/aeraki-mesh/client-go/pkg/apis/dubbo/v1alpha1"
)

var dubboLog = log.RegisterScope("dubbo-controller", "dubbo-controller debugging", 0)
Expand Down
8 changes: 3 additions & 5 deletions internal/controller/kube/metaprotocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ package kube
import (
"context"

"sigs.k8s.io/controller-runtime/pkg/client"

metaprotocolmodel "github.com/aeraki-mesh/aeraki/internal/model/metaprotocol"

"github.com/aeraki-mesh/client-go/pkg/apis/metaprotocol/v1alpha1"
"istio.io/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/handler"
Expand All @@ -30,7 +28,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"

"github.com/aeraki-mesh/client-go/pkg/apis/metaprotocol/v1alpha1"
metaprotocolmodel "github.com/aeraki-mesh/aeraki/internal/model/metaprotocol"
)

var metaProtocolLog = log.RegisterScope("meta-protocol-controller", "meta-protocol-controller debugging", 0)
Expand Down
6 changes: 2 additions & 4 deletions internal/controller/kube/metarouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ package kube
import (
"context"

"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/aeraki-mesh/client-go/pkg/apis/metaprotocol/v1alpha1"
"istio.io/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"

"github.com/aeraki-mesh/client-go/pkg/apis/metaprotocol/v1alpha1"
)

var metaRouterLog = log.RegisterScope("meta-router-controller", "meta-routerl-controller debugging", 0)
Expand Down
7 changes: 3 additions & 4 deletions internal/controller/kube/namesapce.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ import (
"context"
"fmt"

"k8s.io/apimachinery/pkg/api/errors"

"github.com/aeraki-mesh/aeraki/internal/config/constants"

"istio.io/pkg/log"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
controllerclient "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/event"
Expand All @@ -32,6 +29,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"

"github.com/aeraki-mesh/aeraki/internal/config/constants"
)

var namespaceLog = log.RegisterScope("namespace-controller", "namespace-controller debugging", 0)
Expand Down
3 changes: 1 addition & 2 deletions internal/controller/kube/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package kube
import (
"context"

"github.com/aeraki-mesh/client-go/pkg/apis/redis/v1alpha1"
"istio.io/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/event"
Expand All @@ -25,8 +26,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"

"github.com/aeraki-mesh/client-go/pkg/apis/redis/v1alpha1"
)

var redisLog = log.RegisterScope("redis-controller", "redis-controller debugging", 0)
Expand Down
9 changes: 4 additions & 5 deletions internal/controller/kube/serviceentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ import (
"reflect"
"strings"

"k8s.io/apimachinery/pkg/api/errors"

"github.com/aeraki-mesh/aeraki/internal/config/constants"
"github.com/aeraki-mesh/aeraki/internal/model"

istionapi "istio.io/api/networking/v1alpha3"
networking "istio.io/client-go/pkg/apis/networking/v1alpha3"
"istio.io/pkg/log"
"k8s.io/apimachinery/pkg/api/errors"
controllerclient "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/event"
Expand All @@ -36,6 +32,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"

"github.com/aeraki-mesh/aeraki/internal/config/constants"
"github.com/aeraki-mesh/aeraki/internal/model"
)

var serviceEntryLog = log.RegisterScope("service-entry-controller", "service-entry-controller debugging", 0)
Expand Down
10 changes: 4 additions & 6 deletions internal/envoyfilter/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,21 @@ import (
"strings"
"time"

istioclient "istio.io/client-go/pkg/clientset/versioned"
"istio.io/istio/pkg/config"

"github.com/aeraki-mesh/api/metaprotocol/v1alpha1"
metaprotocol "github.com/aeraki-mesh/client-go/pkg/apis/metaprotocol/v1alpha1"
"github.com/zhaohuabing/debounce"
"google.golang.org/protobuf/proto"
networking "istio.io/api/networking/v1alpha3"
"istio.io/client-go/pkg/apis/networking/v1alpha3"
istioclient "istio.io/client-go/pkg/clientset/versioned"
istiomodel "istio.io/istio/pilot/pkg/model"
"istio.io/istio/pkg/config"
"istio.io/istio/pkg/config/mesh"
"istio.io/istio/pkg/config/schema/collections"
"istio.io/pkg/log"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/aeraki-mesh/api/metaprotocol/v1alpha1"
metaprotocol "github.com/aeraki-mesh/client-go/pkg/apis/metaprotocol/v1alpha1"

"github.com/aeraki-mesh/aeraki/internal/config/constants"
"github.com/aeraki-mesh/aeraki/internal/model"
"github.com/aeraki-mesh/aeraki/internal/model/protocol"
Expand Down
3 changes: 1 addition & 2 deletions internal/envoyfilter/network_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ import (
"strconv"
"strings"

_struct "github.com/golang/protobuf/ptypes/struct"

"github.com/envoyproxy/go-control-plane/pkg/wellknown"
_struct "github.com/golang/protobuf/ptypes/struct"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
networking "istio.io/api/networking/v1alpha3"
Expand Down
3 changes: 1 addition & 2 deletions internal/envoyfilter/network_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import (
"reflect"
"testing"

istioconfig "istio.io/istio/pkg/config"

networking "istio.io/api/networking/v1alpha3"
istioconfig "istio.io/istio/pkg/config"

"github.com/aeraki-mesh/aeraki/internal/model"
)
Expand Down
3 changes: 1 addition & 2 deletions internal/leaderelection/leaderelection.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ import (
"context"
"time"

"go.uber.org/atomic"
"istio.io/istio/pilot/pkg/leaderelection/k8sleaderelection"
"istio.io/istio/pilot/pkg/leaderelection/k8sleaderelection/k8sresourcelock"

"go.uber.org/atomic"
"istio.io/pkg/log"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
Expand Down
3 changes: 1 addition & 2 deletions internal/leaderelection/leaderelection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ import (
"time"

"go.uber.org/atomic"
"istio.io/istio/pkg/test/util/retry"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/fake"
k8stesting "k8s.io/client-go/testing"

"istio.io/istio/pkg/test/util/retry"
)

const testLock = "test-lock"
Expand Down
3 changes: 1 addition & 2 deletions internal/model/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
package model

import (
metaprotocol "github.com/aeraki-mesh/client-go/pkg/apis/metaprotocol/v1alpha1"
networking "istio.io/api/networking/v1alpha3"
istioconfig "istio.io/istio/pkg/config"
"istio.io/istio/pkg/config/mesh"

metaprotocol "github.com/aeraki-mesh/client-go/pkg/apis/metaprotocol/v1alpha1"
)

// ServiceEntryWrapper wraps an Istio ServiceEntry and its metadata, including name, annotations and labels.
Expand Down
1 change: 0 additions & 1 deletion internal/model/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"strings"

networking "istio.io/api/networking/v1alpha3"

istiomodel "istio.io/istio/pilot/pkg/model"
"istio.io/istio/pkg/config/host"
)
Expand Down
Loading