-
Notifications
You must be signed in to change notification settings - Fork 199
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
Allow creating KafkaTopic CR for topic that already present on the Kafka cluster #914
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the use case behind this?
- If the topic was created without a CR then it's either an internal topic, which means there is probably an other system managing this topic already
- or the user created it manually inside kafka which means they know what they are doing and skipped the CR creation on purpose
Also I think just because we remove the validation from the webhook, kafka will still come back with an error that the topic already exists because our reconciler will try to create the topic in kafka.
@hi-im-aren One example use case is for the replicated/migrated Kafka topics: for example, if users want to migrate their legacy Kafka clusters to under Koperator's management, they will need to create the |
Not sure that the correct way of doing this is removing the validation from the webhook. We are removing a feature because it gets in the way 1% of the time while it's useful in 99% of other use cases. I'm sure we can figure something better out than removing the check all together. |
|
This is also my case:
|
The problem is when the topic is internal or it is managed by 3rd party application and we let the user to create KafkaTopic CR for it
Solution A
Solution B
|
* add Unwrap method to package errorfactory and a unit test for it * temporary: add webhooks err check functions and unit tests * rename removingStorageMsg var and add comment about the use of errorDuringValidationMsg * sanitize error unit tests and reorder public error check functions * refactor to use errors.As instead of errors.Cause which no longer fits * replace pkg alias apiErrors with apierrors in pkg webhooks * camelCase testName and testCases in errors_test.go from pkg webhooks * add comment for Unwrap method and shorten public error comparison functions in pkg webhooks
* add just kubebuilder validation markers; code generation NOT run * update CRDs via make manifests
…929) * chore(go-mod): fixed Koperator submodule tags Previously invalid tags were specified for Koperator sub-Go-modules (api, properties), tagged these and referenced the latest tags. * chore(go-mod): removed local replacements Previously the local sub-Go-modules (api, properties) were depended upon by the root Go module using a local replacement. Removed this because it is not transitive to downstream usage - where Koperator is also a dependency - and is anyway only neede for development purposes which can be kept on local machine instead of having it committed to the repo.
* pkg webhooks: update new error functions names to IsAdmission prefix; NOT API breaking * pkg webhooks: update IsInvalidReplicationFactor exported func name with IsAdmission prefix; API breaking change
* chore(README): removed obsolete badges We transitioned from docker.io to ghcr.io and from CircleCI to GHA so those badges are not relevant anymore. * chore(README): refactored badges Added CI and image. Added Go version and released version and date. --------- Co-authored-by: Darren Lau <[email protected]>
As a preparation for the release of 0.23.0.
…and re-creation cycles indefinitely (#928) * Prevent kafka controller from running into NodePort service deletion and re-creation cycles indefinitely * Rename variable * Refactor existing implementation to improve readability * Fix unintended change * Update logs and comments to reduce confusion
This PR has been closed because it is re-created here: #934 |
What's in this PR?
It allows to create a KafkaTopic CR when the referenced topic is already present on the Kafka cluster.
Why?
Let the user create KafkaTopic resources for that topic which is already on the Kafka cluster
Users can modify the topic configuration and partition number for that topic through the created KafkaTopic CR
Checklist