Skip to content

Commit

Permalink
chore: Version CRD (#661)
Browse files Browse the repository at this point in the history
* chore: migrate crd crate to operator-binary module

* chore: add stackable-versioned dependency

* chore: separate impls from crd data structures

This makes way for the versioned module we will soon introduce

* chore: version the crd

At this point, errors will appear in any crates using the crd.
It has only been done separately to illustrate the ease in versioning a CRD without all of the other necessary changes.

* chore: version any other structures defined outside of the main crd

This is helpful for later crd version sharing substructures that might not change.
For example: v1alpha2::OpaCluster might still use user_info_fetcher::v1alpha1::Config,
or perhaps it uses user_info_fetcher::v1beta1::Config.

Similarly, shared structures from stackable-operators can then be
versioned in the same way.

* chore: update references in the crates

The versioned module is imported rather than the individual structs and enums (when there is no conflict, eg: if also importing a versioned shared struct) so that that usages show the version explicitly.

There might be times where this isn't possible, for example, once structs and enums are versioned in stackable-operator, there could be multiple modules with the same name.

In this case, user-info-fetcher is also versioned with v1alpha1, so it is referred to as user_info_fetcher::v1alpha1 in crd/mod.rs so as to not conflict with the crds v1alpha1.

* chore: add attribution

Co-authored-by: Techassi <[email protected]>

* docs: Update references to include the version

---------

Co-authored-by: Techassi <[email protected]>
  • Loading branch information
NickLarsenNZ and Techassi authored Feb 5, 2025
1 parent 1cf815c commit 25f4e2b
Show file tree
Hide file tree
Showing 20 changed files with 2,366 additions and 1,044 deletions.
531 changes: 392 additions & 139 deletions Cargo.lock

Large diffs are not rendered by default.

1,616 changes: 1,330 additions & 286 deletions Cargo.nix

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
snafu = "0.8"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" }
stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.0" }
strum = { version = "0.26", features = ["derive"] }
tar = "0.4"
tokio = { version = "1.40", features = ["full"] }
Expand Down
3 changes: 3 additions & 0 deletions crate-hashes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions rust/crd/Cargo.toml

This file was deleted.

Loading

0 comments on commit 25f4e2b

Please sign in to comment.