Skip to content

Commit

Permalink
Format imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pkosiec committed Jun 3, 2022
1 parent 9bb4479 commit 3c27ebc
Show file tree
Hide file tree
Showing 24 changed files with 34 additions and 70 deletions.
3 changes: 1 addition & 2 deletions pkg/bot/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ import (
"fmt"
"strings"

"github.com/sirupsen/logrus"

"github.com/bwmarrin/discordgo"
"github.com/sirupsen/logrus"

"github.com/infracloudio/botkube/pkg/config"
)
Expand Down
7 changes: 3 additions & 4 deletions pkg/bot/lark.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ import (
"net/http"
"strings"

"github.com/sirupsen/logrus"

"github.com/infracloudio/botkube/pkg/httpsrv"

"github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/event"
eventhttpserver "github.com/larksuite/oapi-sdk-go/event/http"
"github.com/sirupsen/logrus"

"github.com/infracloudio/botkube/pkg/httpsrv"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/utils"
Expand Down
3 changes: 1 addition & 2 deletions pkg/bot/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ import (
"net/url"
"strings"

"github.com/sirupsen/logrus"

"github.com/mattermost/mattermost-server/v5/model"
"github.com/sirupsen/logrus"

"github.com/infracloudio/botkube/pkg/config"
)
Expand Down
1 change: 0 additions & 1 deletion pkg/bot/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"strings"

"github.com/sirupsen/logrus"

"github.com/slack-go/slack"

"github.com/infracloudio/botkube/pkg/config"
Expand Down
16 changes: 5 additions & 11 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,20 @@ import (
"strings"
"time"

"github.com/sirupsen/logrus"
coreV1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/dynamic/dynamicinformer"

"github.com/sirupsen/logrus"
"k8s.io/client-go/tools/cache"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/events"
"github.com/infracloudio/botkube/pkg/filterengine"

// Register filters
_ "github.com/infracloudio/botkube/pkg/filterengine/filters"

"github.com/infracloudio/botkube/pkg/notify"
"github.com/infracloudio/botkube/pkg/utils"

coreV1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/tools/cache"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ import (
"fmt"
"time"

"github.com/sirupsen/logrus"

"github.com/google/go-github/v44/github"
"github.com/sirupsen/logrus"

"github.com/infracloudio/botkube/pkg/notify"
"github.com/infracloudio/botkube/pkg/version"
Expand Down
5 changes: 2 additions & 3 deletions pkg/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ import (
"strings"
"time"

coreV1 "k8s.io/api/core/v1"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/utils"

coreV1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

// Event to store required information from k8s objects
Expand Down
3 changes: 1 addition & 2 deletions pkg/execute/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ import (
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"

"github.com/infracloudio/botkube/pkg/filterengine"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/filterengine"
"github.com/infracloudio/botkube/pkg/utils"
"github.com/infracloudio/botkube/pkg/version"
)
Expand Down
6 changes: 2 additions & 4 deletions pkg/filterengine/filters/image_tag_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ import (
"strings"

"github.com/sirupsen/logrus"
coreV1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/events"

"github.com/infracloudio/botkube/pkg/utils"

coreV1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

// ImageTagChecker add recommendations to the event object if latest image tag is used in pod containers
Expand Down
5 changes: 1 addition & 4 deletions pkg/filterengine/filters/ingress_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ import (
"context"
"fmt"

"k8s.io/client-go/dynamic"

"github.com/sirupsen/logrus"

networkingv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/client-go/dynamic"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/events"

"github.com/infracloudio/botkube/pkg/utils"
)

Expand Down
1 change: 0 additions & 1 deletion pkg/filterengine/filters/node_event_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/events"

"github.com/infracloudio/botkube/pkg/utils"
)

Expand Down
6 changes: 2 additions & 4 deletions pkg/filterengine/filters/object_annotation_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ import (
"context"
"fmt"

"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/client-go/dynamic"

"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/api/meta"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/dynamic"

"github.com/infracloudio/botkube/pkg/events"

"github.com/infracloudio/botkube/pkg/utils"
)

Expand Down
1 change: 0 additions & 1 deletion pkg/filterengine/filters/object_annotation_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"testing"

logtest "github.com/sirupsen/logrus/hooks/test"

metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
4 changes: 1 addition & 3 deletions pkg/filterengine/filters/pod_label_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ import (
"context"
"fmt"

"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/client-go/dynamic"

"github.com/sirupsen/logrus"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/events"

"github.com/infracloudio/botkube/pkg/utils"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/filterengine/filters/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ import (
"fmt"
"strings"

"k8s.io/client-go/dynamic"

coreV1 "k8s.io/api/core/v1"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"

"github.com/infracloudio/botkube/pkg/utils"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/notify/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import (
"context"
"fmt"

"github.com/sirupsen/logrus"

"github.com/bwmarrin/discordgo"
"github.com/sirupsen/logrus"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/events"
Expand Down
3 changes: 1 addition & 2 deletions pkg/notify/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ import (
"fmt"
"strconv"

"github.com/sirupsen/logrus"

"github.com/hashicorp/go-multierror"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/sirupsen/logrus"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/events"
Expand Down
3 changes: 1 addition & 2 deletions pkg/utils/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import (
"fmt"
"testing"

"github.com/stretchr/testify/require"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/infracloudio/botkube/pkg/config"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/utils/lark.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ import (
"encoding/json"
"fmt"

"github.com/sirupsen/logrus"

"github.com/larksuite/oapi-sdk-go/core"
larkconfig "github.com/larksuite/oapi-sdk-go/core/config"
im "github.com/larksuite/oapi-sdk-go/service/im/v1"
"github.com/sirupsen/logrus"
)

// LarkClient the client to communication with lark open platform
Expand Down
5 changes: 2 additions & 3 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ import (
"regexp"
"strings"

"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/client-go/dynamic"

coreV1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
)

const hyperlinkRegex = `(?m)<http:\/\/[a-z.0-9\/\-_=]*\|([a-z.0-9\/\-_=]*)>`
Expand Down
6 changes: 2 additions & 4 deletions test/e2e/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ import (
"testing"
"time"

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

"github.com/slack-go/slack"
"github.com/slack-go/slack/slacktest"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/discovery"
cacheddiscovery "k8s.io/client-go/discovery/cached"
Expand All @@ -40,9 +39,8 @@ import (
"k8s.io/client-go/restmapper"
samplev1alpha1 "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"

"github.com/infracloudio/botkube/pkg/controller"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/controller"
"github.com/infracloudio/botkube/test/e2e/utils"
"github.com/infracloudio/botkube/test/webhook"
)
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/notifier/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import (
"encoding/json"
"testing"

"github.com/infracloudio/botkube/pkg/controller"

"github.com/slack-go/slack"
"github.com/stretchr/testify/assert"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/controller"
"github.com/infracloudio/botkube/pkg/notify"
"github.com/infracloudio/botkube/pkg/utils"
"github.com/infracloudio/botkube/test/e2e/env"
Expand Down
6 changes: 2 additions & 4 deletions test/e2e/notifier/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ import (
"encoding/json"
"testing"

"github.com/stretchr/testify/require"

"github.com/infracloudio/botkube/pkg/controller"

"github.com/slack-go/slack"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/controller"
"github.com/infracloudio/botkube/pkg/notify"
"github.com/infracloudio/botkube/pkg/utils"
"github.com/infracloudio/botkube/test/e2e/env"
Expand Down
5 changes: 2 additions & 3 deletions test/e2e/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"
"k8s.io/client-go/dynamic"

"github.com/slack-go/slack"
"github.com/stretchr/testify/require"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/dynamic"

"github.com/infracloudio/botkube/pkg/config"
"github.com/infracloudio/botkube/pkg/notify"
Expand Down

0 comments on commit 3c27ebc

Please sign in to comment.