Skip to content

Commit

Permalink
Health check (easegress-io#1143)
Browse files Browse the repository at this point in the history
* add health check code and integration test

* add more integration test

* add more test for health check

* github actions

* add health check for websocket

* add more test for websocket health check

* update go.mod

* update doc

* update based on views
  • Loading branch information
suchen-sci committed Dec 4, 2023
1 parent 0571abe commit a1496ab
Show file tree
Hide file tree
Showing 20 changed files with 1,931 additions and 148 deletions.
10 changes: 5 additions & 5 deletions build/test/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func createResource(yamlFile string) error {
cmd := egctlCmd("create", "-f", "-")
cmd.Stdin = strings.NewReader(yamlFile)
_, stderr, err := runCmd(cmd)
if err != nil {
if err != nil || stderr != "" {
return fmt.Errorf("create resource failed\nstderr: %v\nerr: %v", stderr, err)
}
return nil
Expand All @@ -58,7 +58,7 @@ func applyResource(yamlFile string) error {
cmd := egctlCmd("apply", "-f", "-")
cmd.Stdin = strings.NewReader(yamlFile)
_, stderr, err := runCmd(cmd)
if err != nil {
if err != nil || stderr != "" {
return fmt.Errorf("apply resource failed\nstderr: %v\nerr: %v", stderr, err)
}
return nil
Expand All @@ -70,7 +70,7 @@ func deleteResource(kind string, args ...string) error {
cmd.Args = append(cmd.Args, args...)
}
_, stderr, err := runCmd(cmd)
if err != nil {
if err != nil || stderr != "" {
return fmt.Errorf("delete resource failed\nstderr: %v\nerr: %v", stderr, err)
}
return nil
Expand All @@ -82,7 +82,7 @@ func describeResource(kind string, args ...string) (string, error) {
cmd.Args = append(cmd.Args, args...)
}
stdout, stderr, err := runCmd(cmd)
if err != nil {
if err != nil || stderr != "" {
return "", fmt.Errorf("describe resource failed\nstderr: %v\nerr: %v", stderr, err)
}
return stdout, nil
Expand All @@ -94,7 +94,7 @@ func getResource(kind string, args ...string) (string, error) {
cmd.Args = append(cmd.Args, args...)
}
stdout, stderr, err := runCmd(cmd)
if err != nil {
if err != nil || stderr != "" {
return "", fmt.Errorf("describe resource failed\nstderr: %v\nerr: %v", stderr, err)
}
return stdout, nil
Expand Down
Loading

0 comments on commit a1496ab

Please sign in to comment.