Skip to content

Commit

Permalink
remove explicit ai allowlist
Browse files Browse the repository at this point in the history
Because we don't include the ollama package in cloud, we can just have a
single list.
  • Loading branch information
rockwotj committed Aug 27, 2024
1 parent 0567e69 commit 8e40533
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cmd/redpanda-connect-ai/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ var (
)

func main() {
schema := schema.Cloud(Version, DateBuilt, true)
schema := schema.Cloud(Version, DateBuilt)
cli.InitEnterpriseCLI(BinaryName, Version, DateBuilt, schema, service.CLIOptSetEnvironment(schema.Environment()))
}
2 changes: 1 addition & 1 deletion cmd/redpanda-connect-cloud/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ var (
)

func main() {
schema := schema.Cloud(Version, DateBuilt, false)
schema := schema.Cloud(Version, DateBuilt)
cli.InitEnterpriseCLI(BinaryName, Version, DateBuilt, schema, service.CLIOptSetEnvironment(schema.Environment()))
}
3 changes: 0 additions & 3 deletions public/schema/ai_allow_list.txt

This file was deleted.

2 changes: 2 additions & 0 deletions public/schema/cloud_allow_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ nats
nats_jetstream
nats_kv
nats_request_reply
ollama_chat
ollama_embeddings
openai_chat
openai_chat_completion
openai_embeddings
Expand Down
12 changes: 2 additions & 10 deletions public/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
package schema

import (
"fmt"
"strings"

"github.com/redpanda-data/benthos/v4/public/bloblang"
Expand All @@ -21,10 +20,7 @@ import (
)

//go:embed cloud_allow_list.txt
var cloudAllowList string

//go:embed ai_allow_list.txt
var aiAllowList string
var allowList string

func redpandaTopLevelConfigField() *service.ConfigField {
return service.NewObjectField("redpanda", enterprise.TopicLoggerFields()...)
Expand All @@ -43,11 +39,7 @@ func Standard(version, dateBuilt string) *service.ConfigSchema {
}

// Cloud returns the config schema of a cloud build of Redpanda Connect.
func Cloud(version, dateBuilt string, aiEnabled bool) *service.ConfigSchema {
allowList := cloudAllowList
if aiEnabled {
allowList = fmt.Sprintf("%s\n%s", allowList, aiAllowList)
}
func Cloud(version, dateBuilt string) *service.ConfigSchema {
var allowSlice []string
for _, s := range strings.Split(allowList, "\n") {
s = strings.TrimSpace(s)
Expand Down

0 comments on commit 8e40533

Please sign in to comment.