Skip to content

Commit

Permalink
bump go to 1.19.3 (chaos-mesh#3770)
Browse files Browse the repository at this point in the history
Signed-off-by: JACQUES Francois <[email protected]>
  • Loading branch information
hypnoce authored Nov 15, 2022
1 parent 191c9ae commit 8dc83ab
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "1.18"
go-version: "1.19.3"
- name: Build Chaos Mesh Build Env
if: ${{ github.event.pull_request }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload_latest_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/setup-python@v2
- uses: actions/setup-go@v2
with:
go-version: "1.18"
go-version: "1.19.3"
- name: Configure awscli
run: |
pip3 install awscli
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload_release_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- uses: actions/setup-python@v2
- uses: actions/setup-go@v2
with:
go-version: "1.18"
go-version: "1.19.3"
- name: Configure awscli
run: |
pip3 install awscli
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ For more information and how-to, see [RFC: Keep A Changelog](https://github.com/
### Changed

- Use the next generation `New Workflow` UI by default [#3718](https://github.com/chaos-mesh/chaos-mesh/pull/3718)
- Bump go to v1.19.3 [#3770](https://github.com/chaos-mesh/chaos-mesh/pull/3770)

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/chaos-mesh/chaos-mesh/api

go 1.18
go 1.19

require (
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a
Expand Down
5 changes: 3 additions & 2 deletions api/v1alpha1/jvmchaos_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ type JVMStressCfgSpec struct {
// JVMMySQLSpec is the specification of MySQL fault injection in JVM
// only when SQL match the Database, Table and SQLType, JVMChaos mesh will inject fault
// for examle:
// SQL is "select * from test.t1",
// only when ((Database == "test" || Database == "") && (Table == "t1" || Table == "") && (SQLType == "select" || SQLType == "")) is true, JVMChaos will inject fault
//
// SQL is "select * from test.t1",
// only when ((Database == "test" || Database == "") && (Table == "t1" || Table == "") && (SQLType == "select" || SQLType == "")) is true, JVMChaos will inject fault
type JVMMySQLSpec struct {
// the version of mysql-connector-java, only support 5.X.X(set to "5") and 8.X.X(set to "8") now
MySQLConnectorVersion string `json:"mysqlConnectorVersion,omitempty"`
Expand Down
34 changes: 19 additions & 15 deletions controllers/action/multiplexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,30 @@ var _ impltypes.ChaosImpl = (*Multiplexer)(nil)
// Multiplexer could combine ChaosImpl implementations into one, and route them by Action in the ChaosSpec.
// Field impl should be a struct which contains several fields with struct tag "action", each field should be an implementation of ChaosImpl.
// For example:
// type tempStruct struct {
// Impl1 impltypes.ChaosImpl `action:"action1"`
// Impl2 impltypes.ChaosImpl `action:"action2"`
// }
//
// type tempStruct struct {
// Impl1 impltypes.ChaosImpl `action:"action1"`
// Impl2 impltypes.ChaosImpl `action:"action2"`
// }
//
// is valid to be the field in Multiplexer.
//
// Because we use reflect fo iterate fields in tempStruct, so fields in tempStruct should be public/exported.
//
// When some Chaos like:
// type SomeChaos struct {
// ***
// Spec SomeChaosSpec `json:"spec"`
// ***
// }
// type SomeChaosSpec struct {
// ***
// // available actions: action1, action2
// Action string `json:"action"`
// ***
// }
//
// type SomeChaos struct {
// ***
// Spec SomeChaosSpec `json:"spec"`
// ***
// }
// type SomeChaosSpec struct {
// ***
// // available actions: action1, action2
// Action string `json:"action"`
// ***
// }
//
// is created, the corresponding ChaosImpl(s) for each action will be invoked by struct tag.
type Multiplexer struct {
impl interface{}
Expand Down
2 changes: 1 addition & 1 deletion e2e-test/cmd/e2e_helper/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine3.15
FROM golang:1.19-alpine3.15

WORKDIR /src

Expand Down
2 changes: 1 addition & 1 deletion e2e-test/cmd/e2e_helper/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/chaos-mesh/chaos-mesh/test/cmd/e2e_helper

go 1.18
go 1.19

require github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68

Expand Down
2 changes: 1 addition & 1 deletion e2e-test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ replace (
vbom.ml/util => github.com/fvbommel/util v0.0.2
)

go 1.18
go 1.19
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,4 @@ replace (
k8s.io/sample-controller => k8s.io/sample-controller v0.24.5
)

go 1.18
go 1.19
2 changes: 1 addition & 1 deletion images/build-env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN if [[ -n "$HTTP_PROXY" ]]; then yarn config set proxy $HTTP_PROXY; fi

ARG TARGET_PLATFORM=amd64

RUN curl -vvv https://dl.google.com/go/go1.18.linux-$TARGET_PLATFORM.tar.gz | tar -xz -C /usr/local
RUN curl -vvv https://dl.google.com/go/go1.19.3.linux-$TARGET_PLATFORM.tar.gz | tar -xz -C /usr/local
ENV PATH "/usr/local/go/bin:${PATH}"
ENV GO111MODULE=on
ENV GOCACHE /tmp/go-build
Expand Down
4 changes: 2 additions & 2 deletions images/chaos-dlv/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# syntax=docker/dockerfile:experimental

FROM golang:1.18 AS build-env
FROM golang:1.19 AS build-env
ENV GO111MODULE on
RUN go install github.com/go-delve/delve/cmd/dlv@v1.8.0
RUN go install github.com/go-delve/delve/cmd/dlv@v1.9.1

FROM debian:buster

Expand Down
2 changes: 1 addition & 1 deletion images/dev-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:experimental

FROM golang:1.18 AS go_install
FROM golang:1.19 AS go_install

ENV GO111MODULE=on
ENV GOPATH /go
Expand Down
6 changes: 4 additions & 2 deletions pkg/chaosdaemon/tasks/task_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ type TaskExecutor interface {
// A task base on a target marked with its IsID.
// We assume task should implement Injectable.
// We use TaskConfig.Data which implement TaskExecutor to:
//
// Sum task configs on same IsID into one.
// Create task.
// Assign or update task.
// Create task.
// Assign or update task.
//
// SO if developers wants to use functions in TaskManager ,
// their imported TaskConfig need to implement interface TaskExecutor.
// If developers wants to recover task successfully,
Expand Down
37 changes: 21 additions & 16 deletions pkg/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,29 @@ const ExecTag = "exec"
// SubCommandTag stands for the sub command in common command.
// We can use it in struct fields as a tag.
// Just like MatchExtension below
// type Iptables Struct {
// Exec
// MatchExtension Match `sub_command:""`
// }
//
// type Match Struct {
// Exec
// Port string `para:"-p"`
// }
// type Iptables Struct {
// Exec
// MatchExtension Match `sub_command:""`
// }
//
// type Match Struct {
// Exec
// Port string `para:"-p"`
// }
//
// Field with SubcommandTag needs to be a struct with Exec.
const SubCommandTag = "sub_command"

// ParaTag stands for parameters in command.
// We can use it in struct fields as a tag.
// Just like Port below
// type Iptables Struct {
// Exec
// Port string `para:"-p"`
// }
//
// type Iptables Struct {
// Exec
// Port string `para:"-p"`
// }
//
// If the field is not string type or []string type , it will bring an error.
// If the tag value like "-p" is empty string ,
// the para will just add the field value into the command just as some single value parameter in command.
Expand All @@ -61,10 +65,11 @@ const ParaTag = "para"
// We need to inherit it in the struct of command.
// User must add ExecTag as the tag of Exec field.
// Example:
// type Iptables struct {
// Exec `exec:"iptables"`
// Tables string `para:"-t"`
// }
//
// type Iptables struct {
// Exec `exec:"iptables"`
// Tables string `para:"-t"`
// }
type Exec struct {
active bool
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/log/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func NewDefaultZapLogger() (logr.Logger, error) {
return logger, nil
}

//NewZapLoggerWithWriter creates a new logger with io.writer
//The provided encoder presets NewDevelopmentEncoderConfig used by NewDevelopmentConfig do not enable function name logging.
//To enable function name, a non-empty value for config.EncoderConfig.FunctionKey.
// NewZapLoggerWithWriter creates a new logger with io.writer
// The provided encoder presets NewDevelopmentEncoderConfig used by NewDevelopmentConfig do not enable function name logging.
// To enable function name, a non-empty value for config.EncoderConfig.FunctionKey.
func NewZapLoggerWithWriter(out io.Writer) logr.Logger {
bWriter := out
config := zap.NewDevelopmentConfig()
Expand Down

0 comments on commit 8dc83ab

Please sign in to comment.