Skip to content

Commit 296bdb6

Browse files
update go version
1 parent f693c7c commit 296bdb6

31 files changed

+464
-1837
lines changed

tests/ociswrapper/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Also, see `./bin/ociswrapper help` for more information.
125125
- `200 OK` - oCIS server is stopped
126126
- `500 Internal Server Error` - Unable to stop oCIS server
127127

128-
6. `POST /services/<service-name>`
128+
6. `POST /services/{service-name}`
129129

130130
Restart oCIS with service excluded and start excluded oCIS service individually, not covered by the oCIS supervisor.
131131

@@ -143,7 +143,7 @@ Also, see `./bin/ociswrapper help` for more information.
143143
- `200 OK` - oCIS server is stopped
144144
- `500 Internal Server Error` - Unable to stop oCIS server
145145

146-
7. `DELETE /services/<service-name>`
146+
7. `DELETE /services/{service-name}`
147147

148148
Stop individually running oCIS service
149149

tests/ociswrapper/go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module ociswrapper
22

3-
go 1.20
3+
go 1.22
44

55
require (
6-
github.com/creack/pty v1.1.21 // indirect
6+
github.com/creack/pty v1.1.24
7+
github.com/spf13/cobra v1.8.1
78
github.com/inconshreveable/mousetrap v1.1.0 // indirect
8-
github.com/spf13/cobra v1.7.0 // indirect
99
github.com/spf13/pflag v1.0.5 // indirect
1010
)

tests/ociswrapper/go.sum

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
2-
github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0=
3-
github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
1+
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
2+
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
3+
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
44
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
55
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
66
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
7-
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
8-
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
7+
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
8+
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
99
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
1010
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
1111
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

tests/ociswrapper/ocis/ocis.go

+4-10
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var EnvConfigs = []string{}
2929
var runningServices = make(map[string]int)
3030

3131
func Start(envMap []string) {
32+
log.Println("Starting oCIS service........\n")
3233
StartService("", envMap)
3334
}
3435

@@ -37,7 +38,7 @@ func Stop() (bool, string) {
3738
stopSignal = true
3839

3940
for service := range runningServices {
40-
StopService(service)
41+
go StopService(service)
4142
}
4243

4344
success, message := waitUntilCompleteShutdown()
@@ -188,14 +189,7 @@ func RunCommand(command string, inputs []string) (int, string) {
188189
return c.ProcessState.ExitCode(), cmdOutput
189190
}
190191

191-
func RunOcisService(service string, envMap []string) {
192-
log.Println(fmt.Sprintf("Environment variable envMap: %s\n", envMap))
193-
StartService(service, envMap)
194-
}
195-
196-
// startService is a common function for starting a service (ocis or other)
197192
func StartService(service string, envMap []string) {
198-
log.Println(fmt.Sprintf("Start service: %s with Environment variable envMap: %s\n", service, envMap))
199193
// Initialize command args based on service presence
200194
cmdArgs := []string{"server"} // Default command args
201195

@@ -245,7 +239,7 @@ func StartService(service string, envMap []string) {
245239
}
246240

247241
for listservice, pid := range runningServices {
248-
log.Println(fmt.Sprintf("Service started: %s with process and id: %v\n", listservice, pid))
242+
log.Println(fmt.Sprintf("%s service started with process id %v\n", listservice, pid))
249243
}
250244

251245
// Read the logs when the 'ocis server' command is running
@@ -303,7 +297,7 @@ func StartService(service string, envMap []string) {
303297
func StopService(service string) (bool, string) {
304298
pid, exists := runningServices[service]
305299
if !exists {
306-
return false, fmt.Sprintf("Service %s is not running", service)
300+
return false, fmt.Sprintf("Running service doesn't not include %s service", service)
307301
}
308302

309303
process, err := os.FindProcess(pid)

tests/ociswrapper/vendor/github.com/creack/pty/README.md

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/ociswrapper/vendor/github.com/creack/pty/pty_unsupported.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/ociswrapper/vendor/github.com/creack/pty/pty_zos.go

+141
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/ociswrapper/vendor/github.com/creack/pty/ztypes_openbsd_32bit_int.go

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/ociswrapper/vendor/github.com/spf13/cobra/.golangci.yml

+12-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/ociswrapper/vendor/github.com/spf13/cobra/README.md

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/ociswrapper/vendor/github.com/spf13/cobra/active_help.go

+5-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)