Skip to content
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

Sanitize Cassandra version before use it #6596

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

rubenvp8510
Copy link
Contributor

@rubenvp8510 rubenvp8510 commented Jan 23, 2025

Which problem is this PR solving?

Description of the changes

  • This issue arises when I was trying to release the operator, for some reason (may be the cassandra version) the returned version contains spaces. This result in trying to fallback to /cassandra-schema/v004-go-tmpl.cql.tmpl which is a golang template. This produced the following error

This migh be happen only with 3.x and I know we dropped support for it. but it could also happens with others.

Using template file /cassandra-schema/v004-go-tmpl.cql.tmpl with parameters:
    mode = test
    datacenter = datacenter3
    keyspace = jaeger_v1_datacenter3
    replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}
    trace_ttl = 172800
    dependencies_ttl = 0
    compaction_window_size = 96
    compaction_window_unit = MINUTES
<stdin>:5:SyntaxException: line 1:0 no viable alternative at input 'HOLA' ([HOLA]...)
<stdin>:15:SyntaxException: line 1:26 no viable alternative at input '{' (CREATE TYPE IF NOT EXISTS [{]...)
<stdin>:20:SyntaxException: line 1:26 no viable alternative at input '{' (CREATE TYPE IF NOT EXISTS [{]...)
<stdin>:26:SyntaxException: line 1:26 no viable alternative at input '{' (CREATE TYPE IF NOT EXISTS [{]...)
<stdin>:31:SyntaxException: line 1:26 no viable alternative at input '{' (CREATE TYPE IF NOT EXISTS [{]...

How was this change tested?

  • I build a new image with the change and tested with the jaeger-operator unit tests. Now I see the migration applied.

Checklist

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.21%. Comparing base (3cfff2d) to head (96ec6f4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6596      +/-   ##
==========================================
- Coverage   96.23%   96.21%   -0.02%     
==========================================
  Files         377      377              
  Lines       21421    21421              
==========================================
- Hits        20614    20611       -3     
- Misses        614      616       +2     
- Partials      193      194       +1     
Flag Coverage Δ
badger_v1 10.63% <ø> (ø)
badger_v2 2.78% <ø> (ø)
cassandra-4.x-v1-manual 16.64% <ø> (ø)
cassandra-4.x-v2-auto 2.72% <ø> (ø)
cassandra-4.x-v2-manual 2.72% <ø> (ø)
cassandra-5.x-v1-manual 16.64% <ø> (ø)
cassandra-5.x-v2-auto 2.72% <ø> (ø)
cassandra-5.x-v2-manual 2.72% <ø> (ø)
elasticsearch-6.x-v1 20.43% <ø> (ø)
elasticsearch-7.x-v1 20.51% <ø> (ø)
elasticsearch-8.x-v1 20.66% <ø> (ø)
elasticsearch-8.x-v2 2.88% <ø> (+0.10%) ⬆️
grpc_v1 12.20% <ø> (ø)
grpc_v2 9.05% <ø> (ø)
kafka-3.x-v1 10.36% <ø> (ø)
kafka-3.x-v2 2.78% <ø> (ø)
memory_v2 2.77% <ø> (-0.01%) ⬇️
opensearch-1.x-v1 20.55% <ø> (ø)
opensearch-2.x-v1 20.56% <ø> (+<0.01%) ⬆️
opensearch-2.x-v2 2.77% <ø> (ø)
tailsampling-processor 0.51% <ø> (ø)
unittests 95.07% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pavolloffay
Copy link
Member

@yurishkuro could you please review as well?

@yurishkuro yurishkuro merged commit b34cbf3 into jaegertracing:main Jan 23, 2025
56 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Cassandra schema creation script is failing
3 participants