diff --git a/.codespell-whitelist b/.codespell-whitelist new file mode 100644 index 0000000..278592d --- /dev/null +++ b/.codespell-whitelist @@ -0,0 +1,2 @@ +iam +ue diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9589ee..253b0d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,8 @@ jobs: - name: Install golint run: | go get -u golang.org/x/lint/golint + - name: Codespell action + uses: sanketsudake/codespell-action@v1 - name: Before build run: | echo Workflow trigger - ${{ github.event_name }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 364382e..45691aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,9 +14,9 @@ - Aggregate pod status to reduce notification noise [\#212](https://github.com/infracloudio/botkube/issues/212) - Add support to monitor custom resources [\#200](https://github.com/infracloudio/botkube/issues/200) - Limit kubectl commands [\#183](https://github.com/infracloudio/botkube/issues/183) -- Swich to github actions for CI builds [\#179](https://github.com/infracloudio/botkube/issues/179) +- Switch to github actions for CI builds [\#179](https://github.com/infracloudio/botkube/issues/179) - Setting default namespace while executing kubectl commands [\#176](https://github.com/infracloudio/botkube/issues/176) -- Add Microsoft Teams suppport [\#60](https://github.com/infracloudio/botkube/issues/60) +- Add Microsoft Teams support [\#60](https://github.com/infracloudio/botkube/issues/60) **Fixed bugs:** @@ -58,7 +58,7 @@ - options to pass exta annotations for pod [\#304](https://github.com/infracloudio/botkube/pull/304) ([kartik-moolya](https://github.com/kartik-moolya)) - Add aws config in helm values [\#303](https://github.com/infracloudio/botkube/pull/303) ([kartik-moolya](https://github.com/kartik-moolya)) - adding feature to support AWS Signing and creating new index per day [\#302](https://github.com/infracloudio/botkube/pull/302) ([kartik-moolya](https://github.com/kartik-moolya)) -- Allow kubectl commands wihtout namespace and without cluster-name [\#301](https://github.com/infracloudio/botkube/pull/301) ([gmkumar2005](https://github.com/gmkumar2005)) +- Allow kubectl commands without namespace and without cluster-name [\#301](https://github.com/infracloudio/botkube/pull/301) ([gmkumar2005](https://github.com/gmkumar2005)) - Mergify: configuration update [\#287](https://github.com/infracloudio/botkube/pull/287) ([PrasadG193](https://github.com/PrasadG193)) - Refactor logging package \(\#262\) [\#285](https://github.com/infracloudio/botkube/pull/285) ([hmharsh](https://github.com/hmharsh)) - Make allowed kubectl commands configurable [\#284](https://github.com/infracloudio/botkube/pull/284) ([girishg4t](https://github.com/girishg4t)) diff --git a/build/Dockerfile b/build/Dockerfile index cc88276..98b860a 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -46,11 +46,11 @@ RUN apk add --no-cache ca-certificates git \ # Production image FROM alpine:3.10 -# Create Non Privilaged user +# Create Non Privileged user RUN addgroup --gid 101 botkube && \ adduser -S --uid 101 --ingroup botkube botkube -# Run as Non Privilaged user +# Run as Non Privileged user USER botkube COPY --from=BUILD-ENV /go/bin/botkube /go/bin/botkube diff --git a/deploy-all-in-one-tls.yaml b/deploy-all-in-one-tls.yaml index 35960c4..86c1d6a 100644 --- a/deploy-all-in-one-tls.yaml +++ b/deploy-all-in-one-tls.yaml @@ -385,7 +385,7 @@ spec: - name: certs secret: secretName: botkube-certificate-secret - # run as non privilaged user + # run as non privileged user securityContext: runAsUser: 101 runAsGroup: 101 diff --git a/pkg/bot/mattermost.go b/pkg/bot/mattermost.go index dfff832..38c3826 100644 --- a/pkg/bot/mattermost.go +++ b/pkg/bot/mattermost.go @@ -128,7 +128,7 @@ func (b *MMBot) Start() { return } -// Check incomming message and take action +// Check incoming message and take action func (mm *mattermostMessage) handleMessage(b MMBot) { post := model.PostFromJson(strings.NewReader(mm.Event.Data["post"].(string))) channelType := mmChannelType(mm.Event.Data["channel_type"].(string)) @@ -163,7 +163,7 @@ func (mm mattermostMessage) sendMessage() { if len(mm.Response) >= 3990 { res, resp := mm.APIClient.UploadFileAsRequestBody([]byte(mm.Response), mm.Event.Broadcast.ChannelId, mm.Request) if resp.Error != nil { - log.Error("Error occured while uploading file. Error: ", resp.Error) + log.Error("Error occurred while uploading file. Error: ", resp.Error) } post.FileIds = []string{string(res.FileInfos[0].Id)} } else if len(mm.Response) == 0 { diff --git a/pkg/execute/executor.go b/pkg/execute/executor.go index 07b7a45..d47e178 100644 --- a/pkg/execute/executor.go +++ b/pkg/execute/executor.go @@ -304,7 +304,7 @@ func runKubectlCommand(args []string, clusterName, defaultNamespace string, isAu return fmt.Sprintf("Cluster: %s\n%s", clusterName, out) } -// TODO: Have a seperate cli which runs bot commands +// TODO: Have a separate cli which runs bot commands func (e *DefaultExecutor) runNotifierCommand(args []string, clusterName string, isAuthChannel bool) string { if isAuthChannel == false { return "" diff --git a/pkg/filterengine/filters/object_annotation_checker_test.go b/pkg/filterengine/filters/object_annotation_checker_test.go index 91ce4a5..46b149a 100644 --- a/pkg/filterengine/filters/object_annotation_checker_test.go +++ b/pkg/filterengine/filters/object_annotation_checker_test.go @@ -27,8 +27,8 @@ import ( func TestIsObjectNotifDisabled(t *testing.T) { tests := map[string]struct { - annotaion metaV1.ObjectMeta - expected bool + annotation metaV1.ObjectMeta + expected bool }{ `Empty ObjectMeta`: {metaV1.ObjectMeta{}, false}, `ObjectMeta with some annotations`: {metaV1.ObjectMeta{Annotations: map[string]string{"foo": "bar"}}, false}, @@ -38,7 +38,7 @@ func TestIsObjectNotifDisabled(t *testing.T) { for name, test := range tests { name, test := name, test t.Run(name, func(t *testing.T) { - if actual := isObjectNotifDisabled(test.annotaion); actual != test.expected { + if actual := isObjectNotifDisabled(test.annotation); actual != test.expected { t.Errorf("expected: %+v != actual: %+v\n", test.expected, actual) } }) diff --git a/pkg/utils/diff_test.go b/pkg/utils/diff_test.go index 310f643..f4fc6fa 100644 --- a/pkg/utils/diff_test.go +++ b/pkg/utils/diff_test.go @@ -35,7 +35,7 @@ type Object struct { Other Other `json:"other"` } -// Other mocks fileds like MetaData, Status etc in kubernetes objects +// Other mocks fields like MetaData, Status etc in kubernetes objects type Other struct { Foo string `json:"foo"` } diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 0eb3c61..5e16002 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -361,7 +361,7 @@ func TransformIntoTypedObject(obj *unstructured.Unstructured, typedObject interf return runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), typedObject) } -//GetStringInYamlFormat get the formated commands list +//GetStringInYamlFormat get the formatted commands list func GetStringInYamlFormat(header string, commands map[string]bool) string { var b bytes.Buffer fmt.Fprintln(&b, header) diff --git a/test/webhook/server.go b/test/webhook/server.go index 0737b18..5c58224 100644 --- a/test/webhook/server.go +++ b/test/webhook/server.go @@ -43,7 +43,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { // update message in mutex s.receivedPayloads.Lock() - log.Debugf("Incomming Webhook Messages :%#v", t) + log.Debugf("Incoming Webhook Messages :%#v", t) s.receivedPayloads.messages = append(s.receivedPayloads.messages, t) s.receivedPayloads.Unlock()