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

Codespell action for BotKube #394

Merged
merged 2 commits into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 2 additions & 0 deletions .codespell-whitelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
iam
ue
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@sanketsudake this will be altered next time we run changelog_generator, the correct fix would be to fix the issues/PRs names so that next time when it tried to generate changelog, it will get correct names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have corrected typos in respective issues and PRs referred from changelog. Also, keeping this change so that Github action passes.
@PrasadG193 Please let me know if this helps.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good. Thanks @sanketsudake


**Fixed bugs:**

Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deploy-all-in-one-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/bot/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/execute/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
6 changes: 3 additions & 3 deletions pkg/filterengine/filters/object_annotation_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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)
}
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/webhook/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down