66 "strings"
77
88 "github.com/kagent-dev/kagent/go/api/v1alpha2"
9- "github.com/kagent-dev/kagent/go/core/pkg/sandboxbackend/channels "
9+ "github.com/kagent-dev/kagent/go/core/pkg/sandboxbackend/channel_helpers "
1010 corev1 "k8s.io/api/core/v1"
1111 "sigs.k8s.io/controller-runtime/pkg/client"
1212)
@@ -52,12 +52,12 @@ func hermesTelegramEnv(ctx context.Context, kube client.Client, namespace string
5252 if spec == nil {
5353 return nil , fmt .Errorf ("channel %q: telegram spec is required" , ch .Name )
5454 }
55- botEnv , err := channels .CredentialContainerEnv (spec .BotToken , "TELEGRAM_BOT_TOKEN" )
55+ botEnv , err := channel_helpers .CredentialContainerEnv (spec .BotToken , "TELEGRAM_BOT_TOKEN" )
5656 if err != nil {
5757 return nil , fmt .Errorf ("channel %q telegram bot token: %w" , ch .Name , err )
5858 }
5959 out := []corev1.EnvVar {botEnv }
60- allow , err := channels .ResolveAllowedUserIDs (ctx , kube , namespace , spec .AllowedUserIDs , spec .AllowedUserIDsFrom )
60+ allow , err := channel_helpers .ResolveAllowedUserIDs (ctx , kube , namespace , spec .AllowedUserIDs , spec .AllowedUserIDsFrom )
6161 if err != nil {
6262 return nil , fmt .Errorf ("channel %q telegram allowed users: %w" , ch .Name , err )
6363 }
@@ -72,17 +72,17 @@ func hermesSlackEnv(ctx context.Context, kube client.Client, namespace string, c
7272 if spec == nil {
7373 return nil , fmt .Errorf ("channel %q: slack spec is required" , ch .Name )
7474 }
75- botEnv , err := channels .CredentialContainerEnv (spec .BotToken , "SLACK_BOT_TOKEN" )
75+ botEnv , err := channel_helpers .CredentialContainerEnv (spec .BotToken , "SLACK_BOT_TOKEN" )
7676 if err != nil {
7777 return nil , fmt .Errorf ("channel %q slack bot token: %w" , ch .Name , err )
7878 }
79- appEnv , err := channels .CredentialContainerEnv (spec .AppToken , "SLACK_APP_TOKEN" )
79+ appEnv , err := channel_helpers .CredentialContainerEnv (spec .AppToken , "SLACK_APP_TOKEN" )
8080 if err != nil {
8181 return nil , fmt .Errorf ("channel %q slack app token: %w" , ch .Name , err )
8282 }
8383 out := []corev1.EnvVar {botEnv , appEnv }
8484 if opts := spec .Hermes ; opts != nil {
85- allow , err := channels .ResolveAllowedUserIDs (ctx , kube , namespace , opts .AllowedUserIDs , opts .AllowedUserIDsFrom )
85+ allow , err := channel_helpers .ResolveAllowedUserIDs (ctx , kube , namespace , opts .AllowedUserIDs , opts .AllowedUserIDsFrom )
8686 if err != nil {
8787 return nil , fmt .Errorf ("channel %q slack allowed users: %w" , ch .Name , err )
8888 }
0 commit comments