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
Deal with conflict between Connect and Connect S2I #2463
Deal with conflict between Connect and Connect S2I #2463
Conversation
Signed-off-by: Jakub Scholz <www@scholzj.com>
Signed-off-by: Jakub Scholz <www@scholzj.com>
Signed-off-by: Jakub Scholz <www@scholzj.com>
9911eea
to
eece637
Compare
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.
Does this actually work? I would expect that the check in the connector reconciliation (which is to prefer KafkaConnect
over KafkaConnectS2I
clusters) will need to be taken out.
// There is a KafkaConnectS2I with the same name which is older than this KafkaConnect | ||
&& kafkaConnect.getMetadata().getCreationTimestamp().compareTo(otherConnect.getMetadata().getCreationTimestamp()) > 0) { | ||
return Future.failedFuture("Both KafkaConnect and KafkaConnectS2I exist with the same name. " + | ||
"KafkaConnectS2I seems to exists longer and will be used while this custom resource will be ignored."); |
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.
"KafkaConnectS2I seems to exists longer and will be used while this custom resource will be ignored."); | |
"KafkaConnectS2I is older and will be used while this custom resource will be ignored."); |
// There is a KafkaConnect with the same name which is older than or equally old as this KafkaConnectS2I | ||
&& kafkaConnectS2I.getMetadata().getCreationTimestamp().compareTo(otherConnect.getMetadata().getCreationTimestamp()) >= 0) { | ||
return Future.failedFuture("Both KafkaConnect and KafkaConnectS2I exist with the same name. " + | ||
"KafkaConnect seems to exists longer and will be used while this custom resource will be ignored."); |
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.
"KafkaConnect seems to exists longer and will be used while this custom resource will be ignored."); | |
"KafkaConnect is older and will be used while this custom resource will be ignored."); |
Signed-off-by: Jakub Scholz <www@scholzj.com>
Hehe, good catch. It did work, because the service names are the same, so it actually still connects somewhere and handles the connector. But I fixed the code to make it a bit more clean now. |
@scholzj I think you might need to make a small change to the docs, which IIRC mentions the old " |
@tombentley Any idea where in the docs? I didn't found anything. |
@scholzj I took a look and I don't see it either. Maybe I misremembered. |
Type of change
Description
When both Kafka Connect and Kafka Connect S2I exist in the same namespace with the same name they conflict with each other. They share (and overwrite) each others services, config maps etc. This PR adds checks and only the older one from the two will be reconciled. The older or newer one is decided based on the Creation timestamp in metadata.
This PR doesn't really deal with situation where such two Connect and Connect S2I instances already exist - it will error the status and stop reconciling one of them, but not delete the pods etc. But given how disfunctional they would be I guess nobody is using this. When the user deletes one of the CRs thi should be resolved through the garbage collection.
Checklist