Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix doctor plugin schema #1161

Merged
merged 3 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/executor/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Only Slack integration is described, but described steps are the same for all co
cacheDir: "/tmp/plugins"
repositories:
botkube:
url: http://host.k3d.internal:3000/botkube.yaml
url: http://host.k3d.internal:3010/botkube.yaml

rbac:
create: true
Expand All @@ -71,7 +71,7 @@ Only Slack integration is described, but described steps are the same for all co
1. Start plugin server:

```bash
env PLUGIN_SERVER_HOST=http://host.k3d.internal go run test/helpers/plugin_server.go
env PLUGIN_SERVER_HOST=http://host.k3d.internal env PLUGIN_SERVER_PORT=3010 go run test/helpers/plugin_server.go
```

1. Install Botkube
Expand Down
2 changes: 1 addition & 1 deletion internal/executor/doctor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (d *Executor) Metadata(context.Context) (api.MetadataOutput, error) {
Description: "Doctor helps in finding the root cause of a k8s problem.",
JSONSchema: api.JSONSchema{
Value: heredoc.Doc(`{
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "doctor",
"description": "Doctor helps in finding the root cause of a k8s problem.",
"type": "object",
Expand Down
9 changes: 8 additions & 1 deletion test/helpers/plugin_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"log"
"os"
"path/filepath"
"strconv"

"github.com/kubeshop/botkube/test/fake"
)
Expand All @@ -13,16 +14,22 @@ func main() {
exitOnErr(err)

host := os.Getenv("PLUGIN_SERVER_HOST")
port := os.Getenv("PLUGIN_SERVER_PORT")
if host == "" {
host = "http://localhost"
}
if port == "" {
port = "3010"
}
portInt, err := strconv.Atoi(port)
exitOnErr(err)

binDir := filepath.Join(dir, "plugin-dist")
indexEndpoint, startServerFn := fake.NewPluginServer(fake.PluginConfig{
BinariesDirectory: binDir,
Server: fake.PluginServer{
Host: host,
Port: 3000,
Port: portInt,
},
})

Expand Down
Loading