- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.4k
Add version field to KafkaConnector and KafkaMirrorMaker2 CR #12002
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 version field to KafkaConnector and KafkaMirrorMaker2 CR #12002
Conversation
| .onComplete(reconciliationResult -> { | ||
| // Extract warning conditions from reconciliation | ||
| List<Condition> warningConditions = kafkaMirrorMaker2Status.getConditions(); | ||
| StatusUtils.setStatusConditionAndObservedGeneration(kafkaMirrorMaker2, kafkaMirrorMaker2Status, reconciliationResult.cause()); | 
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.
Here the call to setStatusConditionAndObservedGeneration overwrites any of the conditions set in the status previously. Since in a future release the connector.plugin.version will be added to the forbidden list I decided not to add an additional method to StatusUtils to add the status condition and observed generation. Instead storing and adding the warning afterwards means we can more easily remove this new code when it is no longer needed.
We could of course change this behaviour to properly handle any status that has been set, but that is out of scope for this particular issue.
0f47387    to
    9895074      
    Compare
  
    Signed-off-by: Kate Stanley <[email protected]>
9895074    to
    3fc343d      
    Compare
  
    | Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@             Coverage Diff              @@
##               main   #12002      +/-   ##
============================================
+ Coverage     74.90%   74.94%   +0.03%     
- Complexity     6441     6448       +7     
============================================
  Files           343      343              
  Lines         24324    24337      +13     
  Branches       3196     3200       +4     
============================================
+ Hits          18221    18239      +18     
+ Misses         4829     4826       -3     
+ Partials       1274     1272       -2     
 🚀 New features to boost your workflow:
 | 
| /azp run regression | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
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.
Some nits. LGTM otherwise.
        
          
                CHANGELOG.md
              
                Outdated
          
        
      | * The `.spec.build.output.additionalKanikoOptions` field in the `KafkaConnect` custom resource is deprecated and will be removed in the future. | ||
| * Use `.spec.build.output.additionalBuildOptions` field instead. | ||
| * Kafka nodes are now configured with PEM certificates instead of P12/JKS for keystore and truststore. | ||
| * Configuring `connector.plugin.version` under `spec.config` in the `KafkaConnector` custom resource, and under `spec.mirrors[].sourceConnector.config`, `spec.mirrors[].checkpointConnector.config`, and `spec.mirrors[].heartbeatConnector.config` in the `KafkaMirrorMaker2` custom resource is deprecated and will be forbidden in the future. | 
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.
Should you say right away that it will be forbidden from Strimzi 0.50 on?
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.
Yeah good point, I'll update it
        
          
                CHANGELOG.md
              
                Outdated
          
        
      | * Use `.spec.build.output.additionalBuildOptions` field instead. | ||
| * Kafka nodes are now configured with PEM certificates instead of P12/JKS for keystore and truststore. | ||
| * Configuring `connector.plugin.version` under `spec.config` in the `KafkaConnector` custom resource, and under `spec.mirrors[].sourceConnector.config`, `spec.mirrors[].checkpointConnector.config`, and `spec.mirrors[].heartbeatConnector.config` in the `KafkaMirrorMaker2` custom resource is deprecated and will be forbidden in the future. | ||
| * Use `spec.version` in the `KafkaConnecter` custom resource, and `spec.mirrors[].sourceConnector.version`, `spec.mirrors[].checkpointConnector.version`, and `spec.mirrors[].heartbeatConnector.version` in the `KafkaMirrorMaker2` custom resource. | 
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.
Would it be more readable as a single bullet point?
| * Use `spec.version` in the `KafkaConnecter` custom resource, and `spec.mirrors[].sourceConnector.version`, `spec.mirrors[].checkpointConnector.version`, and `spec.mirrors[].heartbeatConnector.version` in the `KafkaMirrorMaker2` custom resource. | |
| Use `spec.version` in the `KafkaConnecter` custom resource, and `spec.mirrors[].sourceConnector.version`, `spec.mirrors[].checkpointConnector.version`, and `spec.mirrors[].heartbeatConnector.version` in the `KafkaMirrorMaker2` custom resource. | 
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.
I'm not sure, it's quite a wall of text so the bullet point helps to distinguish the part that's deprecated from the new advice. Do you think we need to have the full description of the new fields? Does this make it more readable:
| * Use `spec.version` in the `KafkaConnecter` custom resource, and `spec.mirrors[].sourceConnector.version`, `spec.mirrors[].checkpointConnector.version`, and `spec.mirrors[].heartbeatConnector.version` in the `KafkaMirrorMaker2` custom resource. | |
| * Use `spec.version` in the `KafkaConnecter` custom resource, and the connector specific `version` fields in the `KafkaMirrorMaker2` custom resource. | 
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.
TBH, I think too much formatting in the CHANGELOG makes it much harder to read as it makes it harder to process what the different changes are and what is part of the same change. Especially when you see it as raw markdown. That is why I see the second-level bullet point as a distraction rather than something that helps the readability.
I think the shorter description is fine over the long one. I understand that adding the version field to the MM2 connectors makes sense in the long term for symmetry with KafkaConnector. But we do not expect today any environments with different versions of the MM2 connectors, as they are built-in. So I think the MM2 part of this is mostly irrelevant and can be reduced to minimal text like this.
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.
I was viewing in preview rather than raw markdown, but regardless I'm happy with removing the bullet point with the shorter text, so I've updated it. Take a look and see if that looks better
        
          
                ...tor/src/main/java/io/strimzi/operator/cluster/operator/assembly/AbstractConnectOperator.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      Signed-off-by: Kate Stanley <[email protected]>
The version fields are not expected to be used much in the KafkaMirrorMaker2 CR since the connectors are part of the Connect image already. Also the heartbeat connector is being removed from the KafkaMirrorMaker2 CR. As a result it seems unnecessary to fully list the new fields for KafkaMirrorMaker2 CR. Signed-off-by: Kate Stanley <[email protected]>
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.
LGTM. Thanks.
Type of change
Select the type of your PR
Description
Add version field to KafkaConnector and KafkaMirrorMaker2 CR. This implements proposal #118
Checklist
Please go through this checklist and make sure all applicable tasks have been done