Skip to content

Commit

Permalink
update go version
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha committed Jan 13, 2025
1 parent f693c7c commit 296bdb6
Show file tree
Hide file tree
Showing 31 changed files with 464 additions and 1,837 deletions.
4 changes: 2 additions & 2 deletions tests/ociswrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Also, see `./bin/ociswrapper help` for more information.
- `200 OK` - oCIS server is stopped
- `500 Internal Server Error` - Unable to stop oCIS server

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

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

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

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

Stop individually running oCIS service

Expand Down
6 changes: 3 additions & 3 deletions tests/ociswrapper/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module ociswrapper

go 1.20
go 1.22

require (
github.com/creack/pty v1.1.21 // indirect
github.com/creack/pty v1.1.24
github.com/spf13/cobra v1.8.1
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
)
10 changes: 5 additions & 5 deletions tests/ociswrapper/go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0=
github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
14 changes: 4 additions & 10 deletions tests/ociswrapper/ocis/ocis.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var EnvConfigs = []string{}
var runningServices = make(map[string]int)

func Start(envMap []string) {
log.Println("Starting oCIS service........\n")
StartService("", envMap)
}

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

for service := range runningServices {
StopService(service)
go StopService(service)
}

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

func RunOcisService(service string, envMap []string) {
log.Println(fmt.Sprintf("Environment variable envMap: %s\n", envMap))
StartService(service, envMap)
}

// startService is a common function for starting a service (ocis or other)
func StartService(service string, envMap []string) {
log.Println(fmt.Sprintf("Start service: %s with Environment variable envMap: %s\n", service, envMap))
// Initialize command args based on service presence
cmdArgs := []string{"server"} // Default command args

Expand Down Expand Up @@ -245,7 +239,7 @@ func StartService(service string, envMap []string) {
}

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

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

process, err := os.FindProcess(pid)
Expand Down
2 changes: 1 addition & 1 deletion tests/ociswrapper/vendor/github.com/creack/pty/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

141 changes: 141 additions & 0 deletions tests/ociswrapper/vendor/github.com/creack/pty/pty_zos.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 12 additions & 17 deletions tests/ociswrapper/vendor/github.com/spf13/cobra/.golangci.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tests/ociswrapper/vendor/github.com/spf13/cobra/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions tests/ociswrapper/vendor/github.com/spf13/cobra/active_help.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 296bdb6

Please sign in to comment.