Closed
Description
I AS A USER want to not put in random big integer numbers in CRDs such as terminationgraceperiodseconds: 8763762374
, but instead want to have some human readable duration such as terminationgraceperiod: 42h
.
I AS A STACKABLE DEVELOPER want to not implement this in all operators, so have it in operator-rs
Requirements
- Must: Try to stick to the k8s way of specifying durations. It is ok to omit or add more features if this makes sense. In general its always easy to add new features, and hard to remove them again.
- Must: Having support for
s,m,h,d,w
- Could: Having support for
M,y
as the implementation is more complicated but we might need this for ca certificate lifetime. - Could: Millisecond support
- Must NOT: Support long variants
5seconds
or42minutes
. K8s does not support this as well - Should: You should be able to do all the stuff std::time::Duration supports
Implementation decisions
- Custom struct
Duration
with inner typestd::time::Duration
impl Deref for Duration
withTarget = std::time::Duration
- operators should use the Duration struct everywhere in their code possible and prefer that over
std::time::Duration
so that, for example, log messages are consistent to the k8s way of formatting durations.
Implementation checklists
### Tasks
- [x] https://github.com/stackabletech/operator-rs/pull/647
- [x] https://github.com/stackabletech/operator-rs/pull/654
- [ ] https://github.com/stackabletech/trino-operator/pull/474
- [ ] https://github.com/stackabletech/operator-rs/pull/671
- [ ] https://github.com/stackabletech/documentation/pull/467
### Operator Tasks
- [ ] https://github.com/stackabletech/airflow-operator/pull/333
- [ ] https://github.com/stackabletech/druid-operator/pull/478
- [ ] https://github.com/stackabletech/hbase-operator/pull/401
- [ ] https://github.com/stackabletech/hdfs-operator/pull/408
- [ ] https://github.com/stackabletech/hive-operator/pull/378
- [ ] https://github.com/stackabletech/spark-k8s-operator/pull/292
- [ ] https://github.com/stackabletech/superset-operator/pull/412
- [ ] https://github.com/stackabletech/zookeeper-operator/pull/733
- [ ] https://github.com/stackabletech/opa-operator/pull/483
- [ ] https://github.com/stackabletech/secret-operator/pull/306
- [ ] https://github.com/stackabletech/listener-operator/pull/115
Metadata
Metadata
Labels
No labels
Type
Projects
Status
Done