diff --git a/internal/kafka/command_topic.go b/internal/kafka/command_topic.go index cc676b7d9f..afb45b3a31 100644 --- a/internal/kafka/command_topic.go +++ b/internal/kafka/command_topic.go @@ -118,11 +118,8 @@ func (c *command) validateTopic(client *ckgo.AdminClient, topic string, cluster } } if !foundTopic { - log.CliLogger.Trace("validateTopic failed due to topic not being found in the client's topic list") - return errors.NewErrorWithSuggestions( - fmt.Sprintf(errors.TopicDoesNotExistOrMissingPermissionsErrorMsg, topic), - fmt.Sprintf(errors.TopicDoesNotExistOrMissingPermissionsSuggestions, cluster.ID), - ) + log.CliLogger.Tracef("validateTopic: Topic '%s' not visible in metadata, this could be due to ACL restrictions. Proceeding with operation to allow Kafka to handle authorization.", topic) + return nil } log.CliLogger.Tracef("validateTopic succeeded") diff --git a/internal/kafka/command_topic_onprem.go b/internal/kafka/command_topic_onprem.go index c0eb41fe08..d06cfdae8b 100644 --- a/internal/kafka/command_topic_onprem.go +++ b/internal/kafka/command_topic_onprem.go @@ -6,7 +6,6 @@ import ( ckgo "github.com/confluentinc/confluent-kafka-go/v2/kafka" - "github.com/confluentinc/cli/v4/pkg/errors" "github.com/confluentinc/cli/v4/pkg/log" ) @@ -26,11 +25,8 @@ func ValidateTopic(adminClient *ckgo.AdminClient, topic string) error { } } if !foundTopic { - log.CliLogger.Tracef("validateTopic failed due to topic not being found in the client's topic list") - return errors.NewErrorWithSuggestions( - fmt.Sprintf(errors.TopicDoesNotExistOrMissingPermissionsErrorMsg, topic), - fmt.Sprintf(errors.TopicDoesNotExistOrMissingPermissionsSuggestions, ""), - ) + log.CliLogger.Tracef("validateTopic: Topic '%s' not visible in metadata, this could be due to ACL restrictions. Proceeding with operation to allow Kafka to handle authorization.", topic) + return nil } log.CliLogger.Tracef("validateTopic succeeded") diff --git a/pkg/errors/error_message.go b/pkg/errors/error_message.go index 5ec1198112..670704e509 100644 --- a/pkg/errors/error_message.go +++ b/pkg/errors/error_message.go @@ -26,11 +26,9 @@ const ( RequiredFlagNotSetErrorMsg = "required flag `--%s` not set" // kafka cluster commands - CkuMoreThanZeroErrorMsg = "`--cku` value must be greater than 0" - TopicDoesNotExistOrMissingPermissionsErrorMsg = `topic "%s" does not exist or user does not have the ACLs or role bindings required to describe it` - TopicDoesNotExistOrMissingPermissionsSuggestions = "To list topics for Kafka cluster \"%[1]s\", use `confluent kafka topic list --cluster %[1]s`.\nTo list ACLs use `confluent kafka acl list --cluster %[1]s`.\nTo list role bindings use `confluent iam rbac role-binding list`." - KafkaClusterNotFoundErrorMsg = `Kafka cluster "%s" not found` - ChooseRightEnvironmentSuggestions = "Ensure the cluster ID you entered is valid.\n" + + CkuMoreThanZeroErrorMsg = "`--cku` value must be greater than 0" + KafkaClusterNotFoundErrorMsg = `Kafka cluster "%s" not found` + ChooseRightEnvironmentSuggestions = "Ensure the cluster ID you entered is valid.\n" + "Ensure the cluster you are specifying belongs to the currently selected environment with `confluent kafka cluster list`, `confluent environment list`, and `confluent environment use`." UnknownTopicErrorMsg = `unknown topic "%s"` KafkaClusterMissingPrefixErrorMsg = `Kafka cluster "%s" is missing required prefix "lkc-"`