Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warnings when unused fields are set when Node Pools or Kraft are used #9553

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented Jan 13, 2024

Type of change

  • Enhancement / new feature

Description

With UseKRaft now being enabled by default, users are not required to set the following sections in the Kafka CR:

  • .spec.kafka.replicas
  • .spec.kafka.storage
  • .spec.zookeeper

When Node Pools are used, the storage and replicas configuration in the KAfka CR are ignored. When KRaft is used in addition to Node Pools, the ZooKeeper section is not used either. This PR adds warning conditions when these ignored sections are set in the custom resource to get the users to remove them.

I originally considered setting those in the KafkaSpecChecker class. But that adds warning conditions based on the model classes and not based on the custom resources. It would require passing additional parameters through several classes. That seemed like a lot of effort for something that will eventually go away once ZooKeeper support is dropped completely by Kafka and Strimzi. So at the end, I added them as static methods that are called in the place where the validation of these fields happens in the KafkaAsssemblyOperator

Checklist

  • Write tests
  • Make sure all tests pass
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally

…used

Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj scholzj added this to the 0.40.0 milestone Jan 13, 2024
Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Jakub Scholz <www@scholzj.com>
Copy link
Member

@see-quick see-quick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@scholzj
Copy link
Member Author

scholzj commented Jan 13, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj
Copy link
Member Author

scholzj commented Jan 14, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Member Author

scholzj commented Jan 14, 2024

/azp run kraft-regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj scholzj merged commit 00f7d6c into strimzi:main Jan 14, 2024
29 checks passed
@scholzj scholzj deleted the add-warnings-when-unsused-fields-are-used-with-node-pools-or-kraft branch January 14, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants