Skip to content

Commit 819ba20

Browse files
Merge pull request #42 from kamil-holubicki/DISTMYSQL-423
DISTMYSQL-423: Improve code formatting checks, adjust Docker images to use go-1.22.3
2 parents 469ccb4 + 5636c36 commit 819ba20

File tree

13 files changed

+43
-42
lines changed

13 files changed

+43
-42
lines changed

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# ORC_USER (default: orc_server_user): username used to login to orchestrator backend MySQL server
1515
# ORC_PASSWORD (default: orc_server_password): password used to login to orchestrator backend MySQL server
1616

17-
FROM golang:1.20.3-alpine3.17 as build
17+
FROM golang:1.22.3-alpine3.20 as build
1818

1919
ENV GOPATH=/tmp/go
2020

@@ -28,7 +28,7 @@ RUN rsync -av $(find /tmp/orchestrator-release -type d -name orchestrator -maxde
2828
RUN rsync -av $(find /tmp/orchestrator-release -type d -name orchestrator-client -maxdepth 2)/ /
2929
RUN cp conf/orchestrator-sample-sqlite.conf.json /etc/orchestrator.conf.json
3030

31-
FROM alpine:3.17
31+
FROM alpine:3.20
3232

3333
RUN apk --no-cache add bash curl jq
3434

docker/Dockerfile.packaging

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# ORC_USER (default: orc_server_user): username used to login to orchestrator backend MySQL server
1515
# ORC_PASSWORD (default: orc_server_password): password used to login to orchestrator backend MySQL server
1616

17-
FROM golang:1.20.3-bullseye
17+
FROM golang:1.22.3-bullseye
1818

1919
RUN apt-get update
2020
RUN apt-get install -y ruby ruby-dev rubygems build-essential

docker/Dockerfile.raft

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.3-bullseye
1+
FROM golang:1.22.3-bullseye
22
LABEL maintainer="[email protected]"
33

44
RUN apt-get update -q -y

docker/Dockerfile.system

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.3-bullseye
1+
FROM golang:1.22.3-bullseye
22
LABEL maintainer="[email protected]"
33

44
ARG ci_env_repo="https://github.com/percona/orchestrator-ci-env.git"

docker/Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.3-bullseye
1+
FROM golang:1.22.3-bullseye
22
LABEL maintainer="[email protected]"
33

44
RUN apt-get update

go/collection/collection.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
/*
18-
1918
Package collection holds routines for collecting "high frequency"
2019
metrics and handling their auto-expiry based on a configured retention
2120
time. This becomes more interesting as the number of MySQL servers
@@ -31,10 +30,10 @@ data or the raw data for custom analysis over the period requested.
3130
3231
This is expected to be used for the following types of metric:
3332
34-
* discovery metrics (time to poll a MySQL server and collect status)
35-
* queue metrics (statistics within the discovery queue itself)
36-
* query metrics (statistics on the number of queries made to the
37-
backend MySQL database)
33+
- discovery metrics (time to poll a MySQL server and collect status)
34+
- queue metrics (statistics within the discovery queue itself)
35+
- query metrics (statistics on the number of queries made to the
36+
backend MySQL database)
3837
3938
Orchestrator code can just add a new metric without worrying about
4039
removing it later, and other code which serves API requests can
@@ -57,7 +56,6 @@ orchestrator run out of memory eventually.
5756
5857
Current code uses DiscoveryCollectionRetentionSeconds as the
5958
time to keep metric data.
60-
6159
*/
6260
package collection
6361

go/inst/cluster_alias_dao.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ func updateClusterAliasesUsingReplace() error {
152152
//
153153
// The data which is going to be inserted originates from database_instance
154154
// table, in particular the following columns:
155-
// 1. `cluster_name` varchar(128) NOT NULL
156-
// 2. `suggested_cluster_alias` varchar(128) CHARACTER SET ascii COLLATE
157-
// ascii_general_ci NOT NULL
155+
// 1. `cluster_name` varchar(128) NOT NULL
156+
// 2. `suggested_cluster_alias` varchar(128) CHARACTER SET ascii COLLATE
157+
// ascii_general_ci NOT NULL
158158
//
159159
// So it is possible to end up in the following situation when we use this
160160
// approach:

go/inst/instance_binlog.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ type BinlogEvent struct {
5151
Info string
5252
}
5353

54-
//
5554
func (this *BinlogEvent) NextBinlogCoordinates() BinlogCoordinates {
5655
return BinlogCoordinates{LogFile: this.Coordinates.LogFile, LogPos: this.NextEventPos, Type: this.Coordinates.Type}
5756
}
5857

59-
//
6058
func (this *BinlogEvent) NormalizeInfo() {
6159
for reg, replace := range eventInfoTransformations {
6260
this.Info = reg.ReplaceAllString(this.Info, replace)
@@ -76,7 +74,6 @@ func (this *BinlogEvent) EqualsIgnoreCoordinates(other *BinlogEvent) bool {
7674

7775
const maxEmptyEventsEvents int = 10
7876

79-
//
8077
type BinlogEventCursor struct {
8178
cachedEvents []BinlogEvent
8279
currentEventIndex int

go/inst/instance_binlog_dao.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ func getLastPseudoGTIDEntryInBinlog(pseudoGTIDRegexp *regexp.Regexp, instanceKey
133133
}
134134

135135
// getLastPseudoGTIDEntryInInstance will search for the last pseudo GTID entry in an instance's binary logs. Arguments:
136-
// - instance
137-
// - minBinlogCoordinates: a hint, suggested coordinates to start with. The search will _attempt_ to begin search from
138-
// these coordinates, but if search is empty, then we failback to full search, ignoring this hint
139-
// - maxBinlogCoordinates: a hard limit on the maximum position we're allowed to investigate.
140-
// - exhaustiveSearch: when 'true', continue iterating binary logs. When 'false', only investigate most recent binary log.
136+
// - instance
137+
// - minBinlogCoordinates: a hint, suggested coordinates to start with. The search will _attempt_ to begin search from
138+
// these coordinates, but if search is empty, then we failback to full search, ignoring this hint
139+
// - maxBinlogCoordinates: a hard limit on the maximum position we're allowed to investigate.
140+
// - exhaustiveSearch: when 'true', continue iterating binary logs. When 'false', only investigate most recent binary log.
141141
func getLastPseudoGTIDEntryInInstance(instance *Instance, minBinlogCoordinates *BinlogCoordinates, maxBinlogCoordinates *BinlogCoordinates, exhaustiveSearch bool) (*BinlogCoordinates, string, error) {
142142
pseudoGTIDRegexp, err := compilePseudoGTIDPattern()
143143
if err != nil {

go/inst/instance_dao.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ func (this InstancesByCountReplicas) Less(i, j int) bool {
7070
}
7171

7272
// InstancesByDc is a sortable type for Instance
73-
// 1. Instances are sorted by DC
74-
// 2. Within DC group instances are sorted by replicas count
75-
// 3. Within ReplicasCount group insances are:
76-
// a) not sorted if ReplicasCount > 0
77-
// b) sorted by replication lag if ReplicasCount == 0
73+
// 1. Instances are sorted by DC
74+
// 2. Within DC group instances are sorted by replicas count
75+
// 3. Within ReplicasCount group insances are:
76+
// a) not sorted if ReplicasCount > 0
77+
// b) sorted by replication lag if ReplicasCount == 0
7878
//
7979
// DC1 < DC2
8080
// if DC1 == DC2 => len(Replicas1) < len (Replicas2)
@@ -1209,9 +1209,9 @@ func (this byNamePort) Less(i, j int) bool {
12091209
}
12101210

12111211
// BulkReadInstance returns a list of all instances from the database
1212-
// - I only need the Hostname and Port fields.
1213-
// - I must use readInstancesByCondition to ensure all column
1214-
// settings are correct.
1212+
// - I only need the Hostname and Port fields.
1213+
// - I must use readInstancesByCondition to ensure all column
1214+
// settings are correct.
12151215
func BulkReadInstance() ([](*InstanceKey), error) {
12161216
// no condition (I want all rows) and no sorting (but this is done by Hostname, Port anyway)
12171217
const (

0 commit comments

Comments
 (0)