`ProductImage::resolve` panics on some product versions
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- kubernetes, rust
- Domain
- backend, distributed-systems
Research direction
Start at crates/stackable-operator/src/commons/product_image_selection.rs:333 and compare its truncation with utils/length_enforcement.rs and the existing truncate_at_char_boundary method. Reproduce with the supplied KafkaCluster manifest, whose product version triggers a panic at a UTF-8 character boundary. Done means resolving that version no longer panics and the operator can continue reconciling.
Written by the indexing model from the issue text.
Description
That uses truncate which panics when the new_len doesn't fall on a char boundary.
`product_image_selection.rs:333:31` (`assertion failed: self.is_char_boundary(new_len)`), `main` exits via `JoinError::Panic`
A fix could/would be to use truncate(formatted.floor_char_boundary(LABEL_VALUE_MAX_LEN)), as utils/length_enforcement.rs already does, or reject non-ASCII versions and tags. And I actually see that we have a truncate_at_char_boundary method as well but it's private right now.
The problem here is that a single "bad" CR kills the entire operator and no other thing reconciles.
To reproduce:
# productVersion: 40 x U+00E9 (two bytes each), so byte 63 falls inside a character.
apiVersion: kafka.stackable.tech/v1alpha1
kind: KafkaCluster
metadata:
name: bad-version
spec:
image:
productVersion: "éééééééééééééééééééééééééééééééééééééééé"
clusterConfig:
metadataManager: KRaft
controllers:
roleGroups:
default:
replicas: 1
brokers:
roleGroups:
default:
replicas: 1
- Dominant language
- Rust
- Stars
- 170
- Forks
- 20
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 17
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stackabletech/operator-rs
-
scheduled-for/27.3.0
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stackabletech/operator-rs#1331 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
stackabletech/operator-rs#1273 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
stackabletech/operator-rs#1317 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
stackabletech/operator-rs#1316 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
stackabletech/operator-rs#1077 ·
Maintainers usually reply within 1 day
All issues in stackabletech/operator-rs
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
zellij-org/zellij#5929 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
swc-project/swc-next-issues#396 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
nautechsystems/nautilus_trader#5685 ·
Maintainers usually reply within 1 day
-
bug db/postgres user-priority/P1
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day