Skip to content

Add v1 version of the Strimzi API and the related conversion tool#12014

Merged
scholzj merged 7 commits intostrimzi:mainfrom
scholzj:add-v1-version-to-user-and-topic-APIs
Oct 22, 2025
Merged

Add v1 version of the Strimzi API and the related conversion tool#12014
scholzj merged 7 commits intostrimzi:mainfrom
scholzj:add-v1-version-to-user-and-topic-APIs

Conversation

@scholzj
Copy link
Copy Markdown
Member

@scholzj scholzj commented Oct 10, 2025

Type of change

  • Enhancement / new feature

Description

Note: This PR is currently a draft used to make sure all tests are passing.

This PR delivers the Strimzi v1 API and v1 APi Conversion Tool. It is based on the proposals 113 - Strimzi v1 CRD API and 1.0.0 release and 117 - v1 CRD API Conversion Tool.

It does the following:

  • Updates the API to support the v1 version
  • Includes the v1 version of the API in the CRDs in packaging/
  • Creates a separate set of CRDs for testing purposes in the api module resources (this is important to make sure we do not need to change the API Conversion Tool tests later when changing the CRD versions in packaging/)
  • Keeps v1beta2 as the stored API version
  • Moves the User and Topic Operator to use the v1 API version when communicating with the Kubernetes API
  • Adds the v1 CRD API Conversion Tool for converting the CRDs and upgrading them

It should help to resolve the issues #11932, #11933, #10074, and #11809.

Documentation will be delivered in separate PRs. But the conversion tool and all conversions it does are covered in its README.md file. This should be the source for documenting the manual conversions as well.

Checklist

  • Write tests
  • Make sure all tests pass
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md

@scholzj scholzj added this to the 0.49.0 milestone Oct 10, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 72.47984% with 273 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.79%. Comparing base (005d1a1) to head (9ed1056).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...onversion/v1/converter/conversions/Conversion.java 38.37% 50 Missing and 3 partials ⚠️
...on/v1/converter/conversions/SharedConversions.java 50.76% 13 Missing and 19 partials ⚠️
...converter/conversions/MirrorMaker2Conversions.java 72.38% 7 Missing and 22 partials ⚠️
...ion/v1/converter/conversions/KafkaConversions.java 66.19% 9 Missing and 15 partials ⚠️
...api/conversion/v1/converter/AbstractConverter.java 64.40% 14 Missing and 7 partials ⚠️
...afka/api/conversion/v1/cli/ConvertFileCommand.java 74.54% 6 Missing and 8 partials ⚠️
.../api/conversion/v1/cli/ConvertResourceCommand.java 82.35% 7 Missing and 5 partials ⚠️
...strimzi/kafka/api/conversion/v1/utils/IoUtils.java 57.14% 10 Missing and 2 partials ⚠️
...rsion/v1/converter/conversions/ConversionUtil.java 78.00% 8 Missing and 3 partials ⚠️
...converter/conversions/BridgeMetricsConversion.java 82.45% 4 Missing and 6 partials ⚠️
... and 18 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12014      +/-   ##
============================================
- Coverage     74.91%   74.79%   -0.13%     
- Complexity     6454     6616     +162     
============================================
  Files           343      376      +33     
  Lines         24336    25325     +989     
  Branches       3207     3389     +182     
============================================
+ Hits          18231    18941     +710     
- Misses         4832     4998     +166     
- Partials       1273     1386     +113     
Files with missing lines Coverage Δ
...uster/operator/assembly/KafkaAssemblyOperator.java 83.84% <ø> (ø)
...ter/operator/assembly/StrimziPodSetController.java 85.08% <100.00%> (-1.32%) ⬇️
...ion/v1/converter/ApiConversionFailedException.java 100.00% <100.00%> (ø)
.../conversion/v1/converter/KafkaBridgeConverter.java 100.00% <100.00%> (ø)
...nversion/v1/converter/KafkaConnectorConverter.java 100.00% <100.00%> (ø)
...nversion/v1/converter/KafkaRebalanceConverter.java 100.00% <100.00%> (ø)
...rsion/v1/converter/conversions/ListConversion.java 100.00% <100.00%> (ø)
...on/v1/converter/conversions/MultipartResource.java 100.00% <100.00%> (ø)
...conversion/v1/converter/KafkaConnectConverter.java 90.90% <90.90%> (ø)
...ka/api/conversion/v1/converter/KafkaConverter.java 96.55% <96.55%> (ø)
... and 26 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 10, 2025

/gha run pipeline=upgrade

@github-actions
Copy link
Copy Markdown

⏳ System test verification started: link

The following 4 job(s) will be executed:

  • upgrade-azp_kraft_upgrade-amd64 (oracle-vm-4cpu-16gb-x86-64)
  • upgrade-azp_kafka_upgrade-amd64 (oracle-vm-4cpu-16gb-x86-64)
  • upgrade-azp_kraft_upgrade-arm64 (oracle-vm-4cpu-16gb-arm64)
  • upgrade-azp_kafka_upgrade-arm64 (oracle-vm-4cpu-16gb-arm64)

Tests will start after successful build completion.

@github-actions
Copy link
Copy Markdown

❌ System test verification failed: link

@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 11, 2025

/gha run pipeline=regression

@github-actions
Copy link
Copy Markdown

⏳ System test verification started: link

The following 6 job(s) will be executed:

  • regression-brokers-and-security-amd64 (oracle-vm-8cpu-32gb-x86-64)
  • regression-operators-amd64 (oracle-vm-8cpu-32gb-x86-64)
  • regression-operands-amd64 (oracle-vm-8cpu-32gb-x86-64)
  • regression-brokers-and-security-arm64 (oracle-vm-8cpu-32gb-arm64)
  • regression-operators-arm64 (oracle-vm-8cpu-32gb-arm64)
  • regression-operands-arm64 (oracle-vm-8cpu-32gb-arm64)

Tests will start after successful build completion.

@github-actions
Copy link
Copy Markdown

❌ System test verification failed: link

@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 11, 2025

/azp run build

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 11, 2025

/azp run regression

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj scholzj force-pushed the add-v1-version-to-user-and-topic-APIs branch from 5800df4 to b331e22 Compare October 12, 2025 20:56
@scholzj scholzj added this to Roadmap Oct 12, 2025
@scholzj scholzj moved this to 0.49.0 (Work in Progress) in Roadmap Oct 12, 2025
@scholzj scholzj force-pushed the add-v1-version-to-user-and-topic-APIs branch 2 times, most recently from 650d66c to ed1fedc Compare October 13, 2025 00:15
@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 13, 2025

/azp run build

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 13, 2025

/azp run regression

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 13, 2025

/azp run build

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 13, 2025

/azp run build

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 13, 2025

/azp run build

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj scholzj force-pushed the add-v1-version-to-user-and-topic-APIs branch from ed1fedc to b0d61a2 Compare October 13, 2025 14:28
@scholzj scholzj marked this pull request as ready for review October 13, 2025 16:04
@scholzj scholzj requested a review from ppatierno October 13, 2025 16:05
Copy link
Copy Markdown
Contributor

@PaulRMellor PaulRMellor left a comment

Choose a reason for hiding this comment

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

I reviewed the readme for the tool only.
Looks good.
I left a few suggestions as I read through.

Comment thread v1-api-conversion/README.md Outdated
Comment thread v1-api-conversion/README.md Outdated
Comment thread v1-api-conversion/README.md Outdated
Comment thread v1-api-conversion/README.md Outdated
Comment thread v1-api-conversion/README.md Outdated
Comment thread v1-api-conversion/README.md Outdated
Comment thread v1-api-conversion/README.md
Comment thread v1-api-conversion/README.md Outdated
Comment thread v1-api-conversion/README.md Outdated
Comment thread v1-api-conversion/README.md Outdated
Copy link
Copy Markdown
Contributor

@PaulRMellor PaulRMellor left a comment

Choose a reason for hiding this comment

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

I reviewed the readme for the tool only.
Looks good.
I left a few suggestions as I read through.

@scholzj scholzj force-pushed the add-v1-version-to-user-and-topic-APIs branch from b0d61a2 to 6667c82 Compare October 17, 2025 18:38
@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 17, 2025

@PaulRMellor Thanks, your review comments should be in or replied to.

LOGGER.info("Scaling subresource replicas to {}", scaleTo);

KubeResourceManager.get().kubeCmdClient().inNamespace(testStorage.getNamespaceName()).scaleByName(KafkaMirrorMaker2.RESOURCE_KIND, testStorage.getClusterName(), scaleTo);
// We use the KafkaMirrorMaker2.v1beta2.kafka.strimzi.io kind to use the v1beta2 API. It should be removed once the KafkaConnect CR used is a valid v1 resource.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we create an issue for it (to replace it)? Or do you think that once the tests start failing, we will figure it out? :D

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I will open an issue if this ever gets approved.

Comment thread v1-api-conversion/README.md
@PaulRMellor
Copy link
Copy Markdown
Contributor

@PaulRMellor Thanks, your review comments should be in or replied to.

Thanks. I've seen the replies. No more comments on the readme

Copy link
Copy Markdown
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.

I had a first pass.
Regarding the conversion tool, I focused mostly on reviewing the specific conversions you put in place (for all custom resources) but I guess that the boilerplate code is coming from the old conversion tool. Is that right?

Comment thread .checkstyle/import-control.xml Outdated
Comment thread api/pom.xml
Comment thread v1-api-conversion/README.md Outdated
Comment thread v1-api-conversion/bin/v1-api-conversion.cmd
@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 20, 2025

I had a first pass. Regarding the conversion tool, I focused mostly on reviewing the specific conversions you put in place (for all custom resources) but I guess that the boilerplate code is coming from the old conversion tool. Is that right?

@ppatierno Yeah, the core logic of the conversion tool is the same as last time. I pretty much:

  • Removed the old conversions / added the new ones
  • Updated the tests to test the new conversions
  • Changed the Fabric8 related to code to work with current Fabric8 versions

Copy link
Copy Markdown
Member

@Frawless Frawless left a comment

Choose a reason for hiding this comment

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

Just a nit, overall it looks good to me.

Comment thread pom.xml Outdated
@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 21, 2025

@ppatierno Any chance you can get back to this? It would be nice to be able to merge this and proceed with the next steps.

Copy link
Copy Markdown
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.

It took me a while to review this PR. Thanks for working on this 👍 . I didn't find any issues just a nit. LGTM!

Comment thread .checkstyle/import-control.xml Outdated
scholzj and others added 7 commits October 21, 2025 14:09
Signed-off-by: Jakub Scholz <www@scholzj.com>
Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com>
Signed-off-by: Jakub Scholz <www@scholzj.com>
Signed-off-by: Jakub Scholz <www@scholzj.com>
Signed-off-by: Jakub Scholz <www@scholzj.com>
Signed-off-by: Jakub Scholz <www@scholzj.com>
Signed-off-by: Jakub Scholz <www@scholzj.com>
Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj scholzj force-pushed the add-v1-version-to-user-and-topic-APIs branch from 585c293 to 9ed1056 Compare October 21, 2025 12:09
@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 21, 2025

/gha run pipeline=regression

@scholzj
Copy link
Copy Markdown
Member Author

scholzj commented Oct 21, 2025

/azp run regression

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@github-actions
Copy link
Copy Markdown

⏳ System test verification started: link

The following 6 job(s) will be executed:

  • regression-brokers-and-security-amd64 (oracle-vm-8cpu-32gb-x86-64)
  • regression-operators-amd64 (oracle-vm-8cpu-32gb-x86-64)
  • regression-operands-amd64 (oracle-vm-8cpu-32gb-x86-64)
  • regression-brokers-and-security-arm64 (oracle-vm-8cpu-32gb-arm64)
  • regression-operators-arm64 (oracle-vm-8cpu-32gb-arm64)
  • regression-operands-arm64 (oracle-vm-8cpu-32gb-arm64)

Tests will start after successful build completion.

@github-actions
Copy link
Copy Markdown

❌ System test verification failed: link

1 similar comment
@github-actions
Copy link
Copy Markdown

❌ System test verification failed: link

@scholzj scholzj merged commit 160ad2f into strimzi:main Oct 22, 2025
39 of 41 checks passed
@scholzj scholzj deleted the add-v1-version-to-user-and-topic-APIs branch October 22, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 0.49.0

Development

Successfully merging this pull request may close these issues.

6 participants