Skip to content

Commit

Permalink
Chore: Rebase main (apache#309)
Browse files Browse the repository at this point in the history
* bugfix(pitr): fix storage nodes info struct error, add endtime to backup file, and fix backup mode ptrack did not work. (apache#288)

* chore(ci): add golangci-lint and refactor according to the result (apache#294)

* chore: add golangci-lint check config and update Makefile for check

* fix: fix according to golangci-lint

* fix: rename Api to API

* fix: fix sharedVolumeAndMountBuild SetVolumeMountSize non-zero slice

* fix: remove overlapped Build method from shardingSphereProxyContainerBuilder

* chore: add license header

* chore(ci): add golangci-lint (apache#295)

* chore(ci): add golangci-lint to github action

Signed-off-by: mlycore <maxwell92@126.com>

* chore(ci): seperate unit tests

Signed-off-by: mlycore <maxwell92@126.com>

* chore(ci): add golangci-lint for pitr

Signed-off-by: mlycore <maxwell92@126.com>

* chore(ci): fix license header

Signed-off-by: mlycore <maxwell92@126.com>

---------

Signed-off-by: mlycore <maxwell92@126.com>

* refactor(operator): refactor according to golangci-lint (apache#296)

* chore: seperate golangci-lint to base and advanced lints

Signed-off-by: mlycore <maxwell92@126.com>

* fix: introduce CondSucceed to Proxy and ComputeNode status

Signed-off-by: mlycore <maxwell92@126.com>

* chore: fix according to golangci-lint

Signed-off-by: mlycore <maxwell92@126.com>

* chore: refactor according to golangci-lint

Signed-off-by: mlycore <maxwell92@126.com>

* chore: update golangci-lint

Signed-off-by: mlycore <maxwell92@126.com>

* chore: remove loggercheck

Signed-off-by: mlycore <maxwell92@126.com>

* fix: fix unit test

Signed-off-by: mlycore <maxwell92@126.com>

* chore(ci): seperate golint to operator and pitr

Signed-off-by: mlycore <maxwell92@126.com>

* chore: add lint for commit message

Signed-off-by: mlycore <maxwell92@126.com>

---------

Signed-off-by: mlycore <maxwell92@126.com>

* fix: fix proxy controller according to golangci-lint (apache#299)

* chore: update golangci-lint

Signed-off-by: mlycore <maxwell92@126.com>

* chore: fix according to golangci-lint

Signed-off-by: mlycore <maxwell92@126.com>

* refactor: refactor update service with computenode

Signed-off-by: mlycore <maxwell92@126.com>

* fix: update service

Signed-off-by: mlycore <maxwell92@126.com>

* refactor: refactor proxy controller reconcile hpa, deployment and configmap according to golangci-lint

Signed-off-by: mlycore <maxwell92@126.com>

* chore: update commit-msg action

Signed-off-by: mlycore <maxwell92@126.com>

---------

Signed-off-by: mlycore <maxwell92@126.com>

* chore: update varnamelen default to 1

Signed-off-by: mlycore <maxwell92@126.com>

* fix: fix updateSSProxyContainer

Signed-off-by: mlycore <maxwell92@126.com>

* refactor: refactor getReadyProxyInstances

Signed-off-by: mlycore <maxwell92@126.com>

* refactor: refactor getReadyNodes

Signed-off-by: mlycore <maxwell92@126.com>

* fix: fix NewDeployment and set agent

Signed-off-by: mlycore <maxwell92@126.com>

* chore: update golangci-lint

Signed-off-by: mlycore <maxwell92@126.com>

* bugfix(pitr): fix test case show no record (apache#297)

* test(pitr): fix test case show no record

* style: lint code

* feat: Implements EncryptionRule DistSQL Parser Visitor with AST (apache#301)

* feat: implements encrypt rule distsql visitor interface with ast

Signed-off-by: wangbo <wangbo@sphere-ex.com>

* feat: add TODO

Signed-off-by: wangbo <wangbo@sphere-ex.com>

* chore: fix import package error

Signed-off-by: wangbo <wangbo@sphere-ex.com>

* chore: fix ci error

Signed-off-by: wangbo <wangbo@sphere-ex.com>

* chore: fix lint

Signed-off-by: wangbo <wangbo@sphere-ex.com>

* feat: add encrypt distsql ast

Signed-off-by: wangbo <wangbo@sphere-ex.com>

---------

Signed-off-by: wangbo <wangbo@sphere-ex.com>
Co-authored-by: wangbo <wangbo@sphere-ex.com>

* chore: add ifExists to ast (apache#304)

Signed-off-by: wangbo <wangbo@sphere-ex.com>
Co-authored-by: wangbo <wangbo@sphere-ex.com>

* Common builder (apache#305)

* refactor container builder to pkg/common

* fix golang-lint check

* add lincense check

---------

Co-authored-by: moonman <agoiyanzsa@163.com>

* refactor configmap to common pkg (apache#306)

Co-authored-by: moonman <agoiyanzsa@163.com>

---------

Signed-off-by: mlycore <maxwell92@126.com>
Signed-off-by: wangbo <wangbo@sphere-ex.com>
Co-authored-by: liyao <maxwell92@126.com>
Co-authored-by: Zhengqiang Duan <duanzhengqiang@apache.org>
Co-authored-by: Jack <875818649@qq.com>
Co-authored-by: wangbo <wangbo@sphere-ex.com>
Co-authored-by: moomman <85389467+moomman@users.noreply.github.com>
Co-authored-by: moonman <agoiyanzsa@163.com>
  • Loading branch information
7 people committed May 5, 2023
1 parent 876deeb commit d936616
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
File renamed without changes.
43 changes: 43 additions & 0 deletions .github/workflows/pitr-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Unit Test

on:
pull_request:
branches: [ main ]
paths:
- 'pitr/**'
- '.github/workflows/unit-test.yml'
jobs:
pitr-cli:
runs-on: ubuntu-latest
steps:
- name: "checkout codes"
uses: actions/checkout@v3
- name: "setup go"
uses: actions/setup-go@v4
with:
go-version: '^1.18.1'
- name: "unit test"
run: |
cd pitr/cli
make test
- name: "Code coverage"
uses: codecov/codecov-action@v3
with:
files: ./pitr/cli/cover.out
68 changes: 68 additions & 0 deletions shardingsphere-operator/pkg/reconcile/common/configmap.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package common

import v1 "k8s.io/api/core/v1"

// ConfigMapBuilder generic configmap interface
type ConfigMapBuilder interface {
SetName(name string) ConfigMapBuilder
SetNamespace(namespace string) ConfigMapBuilder
SetLabels(labels map[string]string) ConfigMapBuilder
SetAnnotations(annos map[string]string) ConfigMapBuilder
Build() *v1.ConfigMap
}

// commonConfigMapBuilder common configmap implementation
type commonConfigMapBuilder struct {
configmap *v1.ConfigMap
}

// NewCommonConfigMapBuilder Create a new common configmap builder
func NewCommonConfigMapBuilder(configmap *v1.ConfigMap) ConfigMapBuilder {
return &commonConfigMapBuilder{configmap}
}

// SetName set the ConfigMap name
func (c *commonConfigMapBuilder) SetName(name string) ConfigMapBuilder {
c.configmap.Name = name
return c
}

// SetNamespace set the ConfigMap namespace
func (c *commonConfigMapBuilder) SetNamespace(namespace string) ConfigMapBuilder {
c.configmap.Namespace = namespace
return c
}

// SetLabels set the ConfigMap labels
func (c *commonConfigMapBuilder) SetLabels(labels map[string]string) ConfigMapBuilder {
c.configmap.Labels = labels
return c
}

// SetAnnotations set the ConfigMap annotations
func (c *commonConfigMapBuilder) SetAnnotations(annos map[string]string) ConfigMapBuilder {
c.configmap.Annotations = annos
return c
}

// Build returns a ConfigMap
func (c *commonConfigMapBuilder) Build() *v1.ConfigMap {
return c.configmap
}

0 comments on commit d936616

Please sign in to comment.