Skip to content
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
8 changes: 8 additions & 0 deletions internal/cmd/ksql/command_cluster_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ksql
import (
"context"
"fmt"
"os"

schedv1 "github.com/confluentinc/cc-structs/kafka/scheduler/v1"
"github.com/gogo/protobuf/types"
Expand Down Expand Up @@ -104,5 +105,12 @@ func (c *ksqlCommand) create(cmd *cobra.Command, args []string) error {
utils.ErrPrintln(cmd, errors.EndPointNotPopulatedMsg)
}

if os.Getenv("XX_DATAPLANE_3_ENABLE") != "" {
srCluster, _ := c.Context.FetchSchemaRegistryByAccountId(context.Background(), c.EnvironmentId())
if srCluster != nil {
utils.ErrPrintln(cmd, errors.SchemaRegistryRoleBindingRequiredForKsqlWarning)
}
}

return output.DescribeObject(cmd, c.updateKsqlClusterForDescribeAndList(cluster), describeFields, describeHumanRenames, describeStructuredRenames)
}
4 changes: 4 additions & 0 deletions internal/pkg/errors/warning_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ const (
RetentionTimeDiscrepancyWarning = "Retention Time Discrepancy Warning: Topic %q had discrepancies in retention time." +
" Using max: %v. Discrepancies in retention time occur when two cluster configurations have the same topic in a" +
" router configuration, but different retention times. The maximum specified retention time will be used."

// ksql cluster create
SchemaRegistryRoleBindingRequiredForKsqlWarning = "IMPORTANT: Confirm that the users or service accounts that will interact " +
"with this cluster have the required privileges to access Schema Registry."
)
12 changes: 12 additions & 0 deletions test/fixtures/output/ksql/app/create-result-rbac-stage3.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
`confluent ksql app` is deprecated: Use the equivalent `confluent ksql cluster` commands instead.
IMPORTANT: Confirm that the users or service accounts that will interact with this cluster have the required privileges to access Schema Registry.
+-------------------------+--------------------------+
| Id | lksqlc-ksql5 |
| Name | account ksql |
| Topic Prefix | pksqlc-abcde |
| Kafka | lkc-qwert |
| Storage | 101 |
| Endpoint | SASL_SSL://ksql-endpoint |
| Status | PROVISIONING |
| Detailed Processing Log | true |
+-------------------------+--------------------------+
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
IMPORTANT: Confirm that the users or service accounts that will interact with this cluster have the required privileges to access Schema Registry.
+-------------------------+--------------------------+
| Id | lksqlc-ksql5 |
| Name | account ksql |
| Topic Prefix | pksqlc-abcde |
| Kafka | lkc-qwert |
| Storage | 101 |
| Endpoint | SASL_SSL://ksql-endpoint |
| Status | PROVISIONING |
| Detailed Processing Log | true |
+-------------------------+--------------------------+
2 changes: 2 additions & 0 deletions test/ksql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func (s *CLITestSuite) TestKSQL() {
{args: "ksql app create --help", fixture: "ksql/app/create-help.golden"},
{args: "ksql app create test_ksql --cluster lkc-12345", fixture: "ksql/app/create-result-missing-api-key.golden", wantErrCode: 1},
{args: "ksql app create test_ksql --cluster lkc-12345 --api-key key --api-secret secret", fixture: "ksql/app/create-result.golden"},
{args: "ksql app create test_ksql --cluster lkc-12345 --api-key key --api-secret secret", env: []string{"XX_DATAPLANE_3_ENABLE=1"}, fixture: "ksql/app/create-result-rbac-stage3.golden"},
{args: "ksql app create test_ksql_json --cluster lkc-12345 --api-key key --api-secret secret -o json", fixture: "ksql/app/create-result-json.golden"},
{args: "ksql app create test_ksql_yaml --cluster lkc-12345 --api-key key --api-secret secret -o yaml", fixture: "ksql/app/create-result-yaml.golden"},
{args: "ksql app create test_ksql --cluster lkc-processLogFalse --api-key key --api-secret secret --log-exclude-rows", fixture: "ksql/app/create-log-exclude-rows-result.golden"},
Expand All @@ -35,6 +36,7 @@ func (s *CLITestSuite) TestKSQL() {
{args: "ksql cluster create --help", fixture: "ksql/cluster/create-help.golden"},
{args: "ksql cluster create test_ksql --cluster lkc-12345", fixture: "ksql/cluster/create-result-missing-api-key.golden", wantErrCode: 1},
{args: "ksql cluster create test_ksql --cluster lkc-12345 --api-key key --api-secret secret", fixture: "ksql/cluster/create-result.golden"},
{args: "ksql cluster create test_ksql --cluster lkc-12345 --api-key key --api-secret secret", env: []string{"XX_DATAPLANE_3_ENABLE=1"}, fixture: "ksql/cluster/create-result-rbac-stage3.golden"},
{args: "ksql cluster create test_ksql_json --cluster lkc-12345 --api-key key --api-secret secret -o json", fixture: "ksql/cluster/create-result-json.golden"},
{args: "ksql cluster create test_ksql_yaml --cluster lkc-12345 --api-key key --api-secret secret -o yaml", fixture: "ksql/cluster/create-result-yaml.golden"},
{args: "ksql cluster create test_ksql --cluster lkc-processLogFalse --api-key key --api-secret secret --log-exclude-rows", fixture: "ksql/cluster/create-result-log-exclude-rows.golden"},
Expand Down