crossplane-contrib / provider-kafka

Crossplane provider for Kafka
Apache License 2.0
27 stars 30 forks source link

Replication Factor Update Error Handling. Fixes #23 #24

Closed jograca closed 2 years ago

jograca commented 2 years ago

Description of your changes

This PR addresses a bug where Replication Factors are attempted to be updated by a user. This is not supported functionality in Kafka, so the user needs to be thrown a meaningful error message. A new function UpdateReplicationFactor handles throwing the error to the user.

Fixes #23

I have:

How has this code been tested

Tested manually by applying a config with 1 replication factor and attempting to change it to three:

2022-01-19T13:51:41.617-0500 DEBUG controller-runtime.manager.events Warning {"object": {"kind":"Topic","name":"sample-topic","uid":"2887e9c0-6e4c-4bff-843f-196bd688edbb","apiVersion":"topic.kafka.crossplane.io/v1alpha1","resourceVersion":"886110"}, "reason": "CannotUpdateExternalResource", "message": "updating replication factor is not supported"}