Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hirenko-v committed Sep 30, 2024
1 parent ca0f35e commit d9b374f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions cmd/job/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,11 @@ func (e *MsgExecutor) Execute(ctx context.Context, in executor.ExecuteInput) (ex
return executor.ExecuteOutput{
Message: api.NewCodeBlockMessage(fmt.Sprintf("Failed to MarshalIndent %s", err), true),
}, nil
}
// else {
// return executor.ExecuteOutput{
// Message: api.NewCodeBlockMessage(fmt.Sprintf("%s", string(slackStateJSON)), true),
// }, nil
// }
} else {
return executor.ExecuteOutput{
Message: api.NewCodeBlockMessage(fmt.Sprintf("%s", in.Context.IncomingWebhook), true),
}, nil
}

// Kubernetes client setup
kubeConfigPath, deleteFn, err := plugin.PersistKubeConfig(ctx, in.Context.KubeConfig)
Expand Down Expand Up @@ -195,7 +194,7 @@ func (e *MsgExecutor) Execute(ctx context.Context, in executor.ExecuteInput) (ex
}

if strings.TrimSpace(in.Command) == pluginName {
return initialMessages(ctx, envs, e, in.Context.SlackState), nil
return initialMessages(ctx, envs, e), nil
}

msg := fmt.Sprintf("Plain command: %s", in.Command)
Expand Down Expand Up @@ -297,7 +296,7 @@ func getBotkubeJobs(ctx context.Context, envs map[string]string) ([]Job) {
return jobList
}

func initialMessages(ctx context.Context, envs map[string]string, e *MsgExecutor, slackState *slack.BlockActionStates) executor.ExecuteOutput {
func initialMessages(ctx context.Context, envs map[string]string, e *MsgExecutor) executor.ExecuteOutput {
var jobList []api.OptionItem
jobs := getBotkubeJobs(ctx, envs)
for _, job := range jobs {
Expand All @@ -316,7 +315,7 @@ func initialMessages(ctx context.Context, envs map[string]string, e *MsgExecutor
return executor.ExecuteOutput{
Message: api.Message{
BaseBody: api.Body{
Plaintext: fmt.Sprintf("%s", slackState),
Plaintext: "Please select the Job name",
},
Sections: []api.Section{
{
Expand Down

0 comments on commit d9b374f

Please sign in to comment.