Skip to content

Commit

Permalink
Fix counting plugins migrated via migrate command
Browse files Browse the repository at this point in the history
  • Loading branch information
pkosiec committed Aug 10, 2023
1 parent 633c591 commit 402e28d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
9 changes: 7 additions & 2 deletions internal/cli/migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,15 @@ func migrate(ctx context.Context, status *printer.StatusPrinter, opts Options, b
if err != nil {
return "", errors.Wrap(err, "while converting plugins")
}
status.Step("Converted %d plugins", len(plugins))

pluginsCount := 0
if len(plugins) != 0 || len(plugins[0].Groups) != 0 {
pluginsCount = len(plugins[0].Groups)
}
status.Step("Converted %d plugins", pluginsCount)

actions := converter.ConvertActions(botkubeClusterConfig.Actions)
status.Step("Converted %d action", len(actions))
status.Step("Converted %d actions", len(actions))

platforms := converter.ConvertPlatforms(botkubeClusterConfig.Communications)
status.Step(`Converted platforms:
Expand Down
30 changes: 16 additions & 14 deletions internal/executor/doctor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,22 @@ func (d *Executor) Metadata(context.Context) (api.MetadataOutput, error) {
Description: "Doctor is a ChatGPT integration project that knows how to diagnose Kubernetes problems and suggest solutions.",
JSONSchema: api.JSONSchema{
Value: heredoc.Doc(`{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "doctor",
"description": "Doctor is a ChatGPT integration project that knows how to diagnose Kubernetes problems and suggest solutions.",
"type": "object",
"properties": {
"apiKey": {
"description": "API Key",
"type": "string"
"title": "OpenAI API Key"
}
},
"required": ["apiKey"],
"additionalProperties": false
}`),
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "doctor",
"description": "Doctor is a ChatGPT integration project that knows how to diagnose Kubernetes problems and suggest solutions.",
"type": "object",
"properties": {
"apiKey": {
"description": "API Key",
"type": "string",
"title": "OpenAI API Key"
}
},
"required": [
"apiKey"
],
"additionalProperties": false
}`),
},
}, nil
}
Expand Down

0 comments on commit 402e28d

Please sign in to comment.