diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index df32a1573..9c59ceae6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,12 +26,20 @@ jobs: with: files: ./coverage.out - golint: + static-check: runs-on: [ubuntu-20.04] if: ${{ github.event_name == 'pull_request' }} steps: - uses: actions/checkout@v2 - - uses: golangci/golangci-lint-action@v2 + + - name: Check conventional commits + uses: webiny/action-conventional-commits@v1.1.0 + + - name: Check spelling + uses: crate-ci/typos@v1.0.4 + + - name: Check golang lint + uses: golangci/golangci-lint-action@v2 with: version: v1.48.0 only-new-issues: true @@ -137,12 +145,12 @@ jobs: slack-notification: if: ${{ always() }} - needs: [ pr-check,golint,run-e2e,run-k8s-e2e,run-tower-e2e,generate-check ] + needs: [ pr-check,static-check,run-e2e,run-k8s-e2e,run-tower-e2e,generate-check ] runs-on: [ ubuntu-20.04 ] env: SLACK_COLOR: 2EA44F RESULT_PR_CHECK: ":white_check_mark:" - RESULT_GOLINT: ":white_check_mark:" + RESULT_STATIC_CHECK: ":white_check_mark:" RESULT_RUN_E2E: ":white_check_mark:" RESULT_RUN_K8S_E2E: ":white_check_mark:" RESULT_RUN_TOWER_E2E: ":white_check_mark:" @@ -150,8 +158,8 @@ jobs: steps: - if: ${{ needs.pr-check.result == 'failure'}} run: echo "SLACK_COLOR=DF0000" >> $GITHUB_ENV && echo "RESULT_PR_CHECK=:x:" >> $GITHUB_ENV - - if: ${{ needs.golint.result == 'failure'}} - run: echo "SLACK_COLOR=DF0000" >> $GITHUB_ENV && echo "RESULT_GOLINT=:x:" >> $GITHUB_ENV + - if: ${{ needs.static-check.result == 'failure'}} + run: echo "SLACK_COLOR=DF0000" >> $GITHUB_ENV && echo "RESULT_STATIC_CHECK=:x:" >> $GITHUB_ENV - if: ${{ needs.run-e2e.result == 'failure'}} run: echo "SLACK_COLOR=DF0000" >> $GITHUB_ENV && echo "RESULT_RUN_E2E=:x:" >> $GITHUB_ENV - if: ${{ needs.run-k8s-e2e.result == 'failure'}} @@ -163,8 +171,8 @@ jobs: - if: ${{ needs.pr-check.result == 'cancelled'}} run: echo "RESULT_PR_CHECK=:ballot_box_with_check:" >> $GITHUB_ENV - - if: ${{ needs.golint.result == 'cancelled'}} - run: echo "RESULT_GOLINT=:ballot_box_with_check:" >> $GITHUB_ENV + - if: ${{ needs.static-check.result == 'cancelled'}} + run: echo "RESULT_STATIC_CHECK=:ballot_box_with_check:" >> $GITHUB_ENV - if: ${{ needs.run-e2e.result == 'cancelled'}} run: echo "RESULT_RUN_E2E=:ballot_box_with_check:" >> $GITHUB_ENV - if: ${{ needs.run-k8s-e2e.result == 'cancelled'}} @@ -220,7 +228,7 @@ jobs: }, { "type": "mrkdwn", - "text": "${{ env.RESULT_GOLINT }} => *golint*" + "text": "${{ env.RESULT_STATIC_CHECK }} => *static-check*" }, { "type": "mrkdwn", diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 000000000..1c1b91de2 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,4 @@ +[files] +extend-exclude = [ + "deploy/crds", + "deploy/everoute.yaml"] diff --git a/README.md b/README.md index 4d2500770..4431d3ae9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Everoute provides network and security services for the following platforms: * Hybrid Cloud * Legacy virtualized data center -It can be intergated within these platforms easily. +It can be integrated within these platforms easily. ## Architecture @@ -73,7 +73,7 @@ refer to [Everoute CNI](https://github.com/everoute/everoute/blob/main/docs/cni/ * **Virtualization Platform**: [SMTX OS](https://www.smartx.com/global/smtx-os) is [SmartX](https://www.smartx.com/global) native virtualization platform. -Everoute can be intergated with SMTX OS through the +Everoute can be integrated with SMTX OS through the [CloudTower](https://www.smartx.com/global/cloud-tower) plugin to provide the Micro-Segmentation service. diff --git a/pkg/agent/datapath/clsBridge.go b/pkg/agent/datapath/clsBridge.go index fcee8f158..e797f9424 100644 --- a/pkg/agent/datapath/clsBridge.go +++ b/pkg/agent/datapath/clsBridge.go @@ -185,7 +185,7 @@ func (c *ClsBridge) initForwardingTable() error { return nil } -func (c *ClsBridge) initOuputTable(sw *ofctrl.OFSwitch) error { +func (c *ClsBridge) initOutputTable(sw *ofctrl.OFSwitch) error { localBrName := strings.TrimSuffix(c.name, "-cls") // clsBridgeOutputTable floodingOutputFlow floodingOutputFlow, _ := c.clsBridgeOutputTable.NewFlow(ofctrl.FlowMatch{ @@ -223,8 +223,8 @@ func (c *ClsBridge) initOuputTable(sw *ofctrl.OFSwitch) error { return fmt.Errorf("failed to install cls bridge learnedLocalToLocalOutputFlow, error: %v", err) } - // clsBridgeOutputTable learnedLocalToRemoteOuputFlow - learnedLocalToRemoteOuputFlow, _ := c.clsBridgeOutputTable.NewFlow(ofctrl.FlowMatch{ + // clsBridgeOutputTable learnedLocalToRemoteOutputFlow + learnedLocalToRemoteOutputFlow, _ := c.clsBridgeOutputTable.NewFlow(ofctrl.FlowMatch{ Priority: NORMAL_MATCH_FLOW_PRIORITY, Regs: []*ofctrl.NXRegister{ { @@ -235,8 +235,8 @@ func (c *ClsBridge) initOuputTable(sw *ofctrl.OFSwitch) error { }, }) outputPort, _ = sw.OutputPort(c.datapathManager.BridgeChainPortMap[localBrName][ClsToUplinkSuffix]) - if err := learnedLocalToRemoteOuputFlow.Next(outputPort); err != nil { - return fmt.Errorf("failed to install cls bridge learnedLocalToRemoteOuputFlow, error: %v", err) + if err := learnedLocalToRemoteOutputFlow.Next(outputPort); err != nil { + return fmt.Errorf("failed to install cls bridge learnedLocalToRemoteOutputFlow, error: %v", err) } // clsBridgeOutputTable default flow @@ -263,7 +263,7 @@ func (c *ClsBridge) BridgeInit() { if err := c.initForwardingTable(); err != nil { log.Fatalf("Failed to init cls bridge forwarding table, error: %v", err) } - if err := c.initOuputTable(sw); err != nil { + if err := c.initOutputTable(sw); err != nil { log.Fatalf("Failed to init cls bridge output table, error: %v", err) } } diff --git a/pkg/agent/datapath/policyBridge.go b/pkg/agent/datapath/policyBridge.go index 80b7e4fc4..68673ad7d 100644 --- a/pkg/agent/datapath/policyBridge.go +++ b/pkg/agent/datapath/policyBridge.go @@ -389,7 +389,7 @@ func (p *PolicyBridge) initPolicyForwardingTable(sw *ofctrl.OFSwitch) error { return fmt.Errorf("failed to install from local output flow, error: %v", err) } - fromUpstreamOuputFlow, _ := p.policyForwardingTable.NewFlow(ofctrl.FlowMatch{ + fromUpstreamOutputFlow, _ := p.policyForwardingTable.NewFlow(ofctrl.FlowMatch{ Priority: NORMAL_MATCH_FLOW_PRIORITY, InputPort: uint32(p.datapathManager.BridgeChainPortMap[localBrName][PolicyToClsSuffix]), Regs: []*ofctrl.NXRegister{ @@ -401,7 +401,7 @@ func (p *PolicyBridge) initPolicyForwardingTable(sw *ofctrl.OFSwitch) error { }, }) outputPort, _ = sw.OutputPort(p.datapathManager.BridgeChainPortMap[localBrName][PolicyToLocalSuffix]) - if err := fromUpstreamOuputFlow.Next(outputPort); err != nil { + if err := fromUpstreamOutputFlow.Next(outputPort); err != nil { return fmt.Errorf("failed to install from upstream output flow, error: %v", err) } diff --git a/tests/e2e/cases/security_test.go b/tests/e2e/cases/security_test.go index 2f35c4b5f..054ee3380 100644 --- a/tests/e2e/cases/security_test.go +++ b/tests/e2e/cases/security_test.go @@ -1285,7 +1285,7 @@ func checkConnectionHealth(src, dst *model.Endpoint) <-chan ConnHealth { // --- [dstIP] ping statistics --- // [time] packets transmitted, [n1] packets received, [n2]% packet loss output := regexp.MustCompile("\r\n|\n|\r").Split(fullOut, -1) - infoOutput := output[3] // expect: [n0] packets transmitted, [n1] packets recived, [n2]% packet loss + infoOutput := output[3] // expect: [n0] packets transmitted, [n1] packets received, [n2]% packet loss connInfo := regexp.MustCompile("[0-9]+").FindAllString(infoOutput, -1) klog.Info("Total,Received,Loss Rate,Time:", connInfo) lossRate, err := strconv.Atoi(connInfo[2]) diff --git a/tests/e2e/framework/node/node.go b/tests/e2e/framework/node/node.go index 46a593f23..90bdb5fae 100644 --- a/tests/e2e/framework/node/node.go +++ b/tests/e2e/framework/node/node.go @@ -62,7 +62,7 @@ const ( RoleAgent = "agent" ) -// GetClient return client connect to this node, must not close the returnd client. +// GetClient return client connect to this node, must not close the returned client. func (n *Node) GetClient() (*ssh.Client, error) { n.lock.Lock() defer n.lock.Unlock()