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

fix:github action update go version to 1.21 #151

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
golangci:
strategy:
matrix:
go-version: [ "1.20" ]
go-version: [ "1.21" ]
name: golangci-lint
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21"

- name: Build
id: build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21"

- name: Build polairs-controller
run: make build
Expand Down
6 changes: 4 additions & 2 deletions pkg/controller/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ func (p *PolarisController) syncConfigMap(task *Task) error {
metav1.SetMetaDataAnnotation(&operationConfigMap.ObjectMeta, util.PolarisConfigGroup, groupName)
}
// 记录ConfigMap 的 sync 来源 kubernetes 集群
metav1.SetMetaDataLabel(&operationConfigMap.ObjectMeta, util.InternalConfigFileSyncSourceClusterKey, p.config.PolarisController.ClusterName)
metav1.SetMetaDataLabel(&operationConfigMap.ObjectMeta, util.InternalConfigFileSyncSourceClusterKey,
p.config.PolarisController.ClusterName)

cachedConfigMap, ok := p.configFileCache.Load(task.Key())
if !ok {
Expand Down Expand Up @@ -161,7 +162,8 @@ func (p *PolarisController) processSyncNamespaceAndConfigMap(configmap *v1.Confi
func (p *PolarisController) processUpdateConfigMap(old, cur *v1.ConfigMap) error {
log.SyncConfigScope().Infof("Update ConfigMap %s/%s", cur.GetNamespace(), cur.GetName())
if !p.IsPolarisConfigMap(cur) {
log.SyncConfigScope().Infof("user cancel sync ConfigMap %s/%s, delete(%v)", cur.GetNamespace(), cur.GetName(), p.allowDeleteConfig())
log.SyncConfigScope().Infof("user cancel sync ConfigMap %s/%s, delete(%v)", cur.GetNamespace(),
cur.GetName(), p.allowDeleteConfig())
return p.processDeleteConfigMap(cur)
}
_, err := polarisapi.UpdateConfigMap(cur)
Expand Down
6 changes: 4 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,14 @@ func NewPolarisController(

// AllowSyncFromConfigMap 是否开启配置同步从 ConfigMap 到 Polaris
func (p *PolarisController) AllowSyncFromConfigMap() bool {
return p.config.PolarisController.ConfigSync.Enable && p.config.PolarisController.ConfigSync.SyncDirection != util.SyncDirectionPolarisKubernetes
return p.config.PolarisController.ConfigSync.Enable &&
p.config.PolarisController.ConfigSync.SyncDirection != util.SyncDirectionPolarisKubernetes
}

// AllowSyncToConfigMap 是否开启配置同步从 Polaris 到 Kubernetes
func (p *PolarisController) AllowSyncToConfigMap() bool {
return p.config.PolarisController.ConfigSync.Enable && p.config.PolarisController.ConfigSync.SyncDirection != util.SyncDirectionKubernetesToPolaris
return p.config.PolarisController.ConfigSync.Enable &&
p.config.PolarisController.ConfigSync.SyncDirection != util.SyncDirectionKubernetesToPolaris
}

func (p *PolarisController) allowDeleteConfig() bool {
Expand Down
3 changes: 2 additions & 1 deletion pkg/util/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ func (set *SyncSet[K]) Contains(val K) bool {

func (set *SyncSet[K]) String() string {
ret := set.ToSlice()
data, _ := json.Marshal(ret)
data, err := json.Marshal(ret)
_ = err
return string(data)
}

Expand Down
Loading