lsst-sqre / strimzi-registry-operator

A Kubernetes Operator for running the Confluent Schema Registry with a Strimzi-based Kafka cluster
MIT License
79 stars 16 forks source link

Incompatible with Strimzi v0.23+ #5

Closed spenczar closed 2 years ago

spenczar commented 2 years ago

The operator fetches Strimzi custom resources under the API version v1beta1. For example: https://github.com/lsst-sqre/strimzi-registry-operator/blob/652abb9a9f87f57f4e1182dfa06322e1f89b0026/strimziregistryoperator/handlers/createregistry.py#L38

v1beta1 was replaced with v1beta2 in Strimzi v0.22. As explained from this April 29, 2021 blog post, the v1beta1 API was entirely removed in Strimzi v0.23.

As a result, the create_registry handler never succeeds on Strimzi versions past 0.22; they just get a 404:

[2021-10-20 17:42:03,636] kopf.objects         [INFO    ] [kafka/confluent-schema-registry] Creating a new registry deployment: "confluent-schema-registry"
[2021-10-20 17:42:03,654] kopf.objects         [ERROR   ] [kafka/confluent-schema-registry] Handler 'create_registry' failed with an exception. Will retry.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/kopf/reactor/handling.py", line 391, in _execute
    lifecycle=lifecycle,  # just a default for the sub-handlers, not used directly.
  File "/usr/local/lib/python3.7/site-packages/kopf/reactor/handling.py", line 488, in _call_handler
    **kwargs,
  File "/usr/local/lib/python3.7/site-packages/kopf/reactor/invocation.py", line 79, in invoke
    result = await loop.run_in_executor(config.WorkersConfig.get_syn_executor(), real_fn)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/strimziregistryoperator/handlers/createregistry.py", line 41, in create_registry
    name=cluster_name
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/custom_objects_api.py", line 931, in get_namespaced_custom_object
    (data) = self.get_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/custom_objects_api.py", line 1031, in get_namespaced_custom_object_with_http_info
    collection_formats=collection_formats)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 334, in call_api
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 168, in __call_api
    _request_timeout=_request_timeout)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 355, in request
    headers=headers)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 231, in GET
    query_params=query_params)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 222, in request
    raise ApiException(http_resp=r)
kubernetes.client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': 'c3ae11a8-efb8-47eb-a55e-767109e1bd2a', 'Cache-Control': 'no-cache, private', 'Content-Type': 'text/plain; charset=utf-8', 'X-Content-Type-Options': 'nosniff', 'X-Kubernetes-Pf-Flowschema-Uid': '82ffa779-dd6e-4979-9073-6d6527a12a67', 'X-Kubernetes-Pf-Prioritylevel-Uid': '7ab3ebaf-3c64-43ed-accc-590d562d6d4d', 'Date': 'Wed, 20 Oct 2021 17:42:03 GMT', 'Content-Length': '19'})
HTTP response body: 404 page not found
jonathansick commented 2 years ago

Fixed in #7 ! Good catch. I really need to upgrade the installation on Roundtable to keep up with this now :)