Skip to content

Commit 7b0582e

Browse files
authored
Merge pull request #7 from slashdevops/fix-test
refactor: remove unnecessary pipeline
2 parents b710bc5 + a011405 commit 7b0582e

File tree

6 files changed

+34
-154
lines changed

6 files changed

+34
-154
lines changed

.github/workflows/codeql-analysis.yml

-72
This file was deleted.

.github/workflows/develop.yml

-47
This file was deleted.

.github/workflows/master.yml renamed to .github/workflows/main.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Set up Go 1.x
27-
uses: actions/setup-go@v4
27+
uses: actions/setup-go@v5
2828
with:
29-
go-version: ^1.18
29+
go-version: ^1.22.4
3030
id: go
3131

3232
- name: Check out code into the Go module directory
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434

3535
- name: Install promu
3636
run: make promu
@@ -47,13 +47,13 @@ jobs:
4747
runs-on: ubuntu-latest
4848
steps:
4949
- name: Set up Go 1.x
50-
uses: actions/setup-go@v4
50+
uses: actions/setup-go@v5
5151
with:
52-
go-version: ^1.18
52+
go-version: ^1.22.4
5353
id: go
5454

5555
- name: Check out code into the Go module directory
56-
uses: actions/checkout@v3
56+
uses: actions/checkout@v4
5757

5858
- name: Install promu
5959
run: make promu
@@ -68,7 +68,7 @@ jobs:
6868
run: ls -la .build
6969

7070
- name: Upload .build artifacts
71-
uses: actions/upload-artifact@v2
71+
uses: actions/upload-artifact@v4
7272
with:
7373
name: .build
7474
path: .build
@@ -79,13 +79,13 @@ jobs:
7979
runs-on: ubuntu-latest
8080
steps:
8181
- name: Set up Go 1.x
82-
uses: actions/setup-go@v4
82+
uses: actions/setup-go@v5
8383
with:
84-
go-version: ^1.18
84+
go-version: ^1.22.4
8585
id: go
8686

8787
- name: Check out code into the Go module directory
88-
uses: actions/checkout@v3
88+
uses: actions/checkout@v4
8989

9090
- name: Install promu
9191
run: make promu
@@ -94,7 +94,7 @@ jobs:
9494
run: docker version
9595

9696
- name: Download .build artifacts from Build Step
97-
uses: actions/download-artifact@v2
97+
uses: actions/download-artifact@v4
9898
with:
9999
name: .build
100100
path: .build

.github/workflows/release.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Set up Go 1.x
19-
uses: actions/setup-go@v4
19+
uses: actions/setup-go@v5
2020
with:
21-
go-version: ^1.18
21+
go-version: ^1.22.4
2222
id: go
2323

2424
- name: Check out code into the Go module directory
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Install promu
2828
run: make promu
@@ -39,13 +39,13 @@ jobs:
3939
runs-on: ubuntu-latest
4040
steps:
4141
- name: Set up Go 1.x
42-
uses: actions/setup-go@v4
42+
uses: actions/setup-go@v5
4343
with:
44-
go-version: ^1.18
44+
go-version: ^1.22.4
4545
id: go
4646

4747
- name: Check out code into the Go module directory
48-
uses: actions/checkout@v3
48+
uses: actions/checkout@v4
4949

5050
- name: Install promu
5151
run: make promu
@@ -60,7 +60,7 @@ jobs:
6060
run: ls -la .build
6161

6262
- name: Upload .build artifacts
63-
uses: actions/upload-artifact@v2
63+
uses: actions/upload-artifact@v4
6464
with:
6565
name: .build
6666
path: .build
@@ -71,13 +71,13 @@ jobs:
7171
runs-on: ubuntu-latest
7272
steps:
7373
- name: Set up Go 1.x
74-
uses: actions/setup-go@v4
74+
uses: actions/setup-go@v5
7575
with:
76-
go-version: ^1.18
76+
go-version: ^1.22.4
7777
id: go
7878

7979
- name: Check out code into the Go module directory
80-
uses: actions/checkout@v3
80+
uses: actions/checkout@v4
8181

8282
- name: Install promu
8383
run: make promu
@@ -89,7 +89,7 @@ jobs:
8989
run: docker version
9090

9191
- name: Download .build artifacts from Build Step
92-
uses: actions/download-artifact@v2
92+
uses: actions/download-artifact@v4
9393
with:
9494
name: .build
9595
path: .build
@@ -134,7 +134,7 @@ jobs:
134134
runs-on: ubuntu-latest
135135
steps:
136136
- name: Checkout code
137-
uses: actions/checkout@v3
137+
uses: actions/checkout@v4
138138

139139
- name: Create Release
140140
id: create_github_release
@@ -154,13 +154,13 @@ jobs:
154154
runs-on: ubuntu-latest
155155
steps:
156156
- name: Set up Go 1.x
157-
uses: actions/setup-go@v4
157+
uses: actions/setup-go@v5
158158
with:
159-
go-version: ^1.18
159+
go-version: ^1.22.4
160160
id: go
161161

162162
- name: Check out code into the Go module directory
163-
uses: actions/checkout@v3
163+
uses: actions/checkout@v4
164164

165165
- name: Install promu
166166
run: make promu
@@ -169,7 +169,7 @@ jobs:
169169
run: promu info
170170

171171
- name: Download .build artifacts from Build Step
172-
uses: actions/download-artifact@v2
172+
uses: actions/download-artifact@v4
173173
with:
174174
name: .build
175175
path: .build
@@ -195,7 +195,7 @@ jobs:
195195
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
196196

197197
- name: Upload Artifacts to Github
198-
uses: actions/upload-artifact@v2
198+
uses: actions/upload-artifact@v4
199199
with:
200200
name: releases
201201
path: .tarballs

.promu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
go:
22
# Whenever the Go version is updated here, .circle/config.yml should also
33
# be updated.
4-
version: 1.18
4+
version: 1.22.4
55

66
repository:
77
path: github.com/slashdevops/aws_cloudwatch_exporter

cmd/server.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,25 @@ func init() {
7070
}
7171

7272
// ReadTimeout
73-
serverCmd.PersistentFlags().DurationVar(&conf.Server.ReadTimeout, "readTimeout", 2*time.Second, "ReadTimeout is the maximum duration for reading the entire request, including the body. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/master/docs/server.md")
73+
serverCmd.PersistentFlags().DurationVar(&conf.Server.ReadTimeout, "readTimeout", 2*time.Second, "ReadTimeout is the maximum duration for reading the entire request, including the body. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/main/docs/server.md")
7474
if err := viper.BindPFlag("server.readTimeout", serverCmd.PersistentFlags().Lookup("readTimeout")); err != nil {
7575
log.Error(err)
7676
}
7777

7878
// WriteTimeout
79-
serverCmd.PersistentFlags().DurationVar(&conf.Server.WriteTimeout, "writeTimeout", 5*time.Second, "WriteTimeout is the maximum duration before timing out writes of the response. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/master/docs/server.md")
79+
serverCmd.PersistentFlags().DurationVar(&conf.Server.WriteTimeout, "writeTimeout", 5*time.Second, "WriteTimeout is the maximum duration before timing out writes of the response. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/main/docs/server.md")
8080
if err := viper.BindPFlag("server.writeTimeout", serverCmd.PersistentFlags().Lookup("writeTimeout")); err != nil {
8181
log.Error(err)
8282
}
8383

8484
// IdleTimeout
85-
serverCmd.PersistentFlags().DurationVar(&conf.Server.IdleTimeout, "idleTimeout", 60*time.Second, "IdleTimeout is the maximum amount of time to wait for the next request when keep-alives are enabled. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/master/docs/server.md")
85+
serverCmd.PersistentFlags().DurationVar(&conf.Server.IdleTimeout, "idleTimeout", 60*time.Second, "IdleTimeout is the maximum amount of time to wait for the next request when keep-alives are enabled. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/main/docs/server.md")
8686
if err := viper.BindPFlag("server.idleTimeout", serverCmd.PersistentFlags().Lookup("idleTimeout")); err != nil {
8787
log.Error(err)
8888
}
8989

9090
// ReadHeaderTimeout
91-
serverCmd.PersistentFlags().DurationVar(&conf.Server.ReadHeaderTimeout, "readHeaderTimeout", 5*time.Second, "ReadHeaderTimeout is the amount of time allowed to read request headers. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/master/docs/server.md")
91+
serverCmd.PersistentFlags().DurationVar(&conf.Server.ReadHeaderTimeout, "readHeaderTimeout", 5*time.Second, "ReadHeaderTimeout is the amount of time allowed to read request headers. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/main/docs/server.md")
9292
if err := viper.BindPFlag("server.readHeaderTimeout", serverCmd.PersistentFlags().Lookup("readHeaderTimeout")); err != nil {
9393
log.Error(err)
9494
}
@@ -100,7 +100,7 @@ func init() {
100100
}
101101

102102
// KeepAlivesEnabled
103-
serverCmd.PersistentFlags().BoolVar(&conf.Server.KeepAlivesEnabled, "keepAlivesEnabled", true, "KeepAlivesEnabled controls whether HTTP keep-alives are enabled. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/master/docs/server.md")
103+
serverCmd.PersistentFlags().BoolVar(&conf.Server.KeepAlivesEnabled, "keepAlivesEnabled", true, "KeepAlivesEnabled controls whether HTTP keep-alives are enabled. see: https://github.com/slashdevops/aws_cloudwatch_exporter/blob/main/docs/server.md")
104104
if err := viper.BindPFlag("server.keepAlivesEnabled", serverCmd.PersistentFlags().Lookup("keepAlivesEnabled")); err != nil {
105105
log.Error(err)
106106
}
@@ -113,7 +113,6 @@ func init() {
113113
}
114114

115115
func startCmd(cmd *cobra.Command, args []string) {
116-
117116
loadFromConfigFiles(conf.Application.ServerFile, &conf)
118117
loadFromMetricsFiles(&conf)
119118
validateMetricsQueries(&conf)

0 commit comments

Comments
 (0)