Skip to content

feat: Add CRD previewer #1030

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

Merged
merged 19 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
xtask = "run --package xtask --"
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
crates/stackable-operator/crds/*.yaml linguist-generated
*.stderr linguist-generated
*.snap linguist-generated
28 changes: 20 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ repos:
args: ["--allow-missing-credentials"]
- id: detect-private-key

- repo: https://github.com/doublify/pre-commit-rust
rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0
hooks:
- id: clippy
args: ["--all-targets", "--", "-D", "warnings"]
- repo: https://github.com/adrienverge/yamllint
rev: 79a6b2b1392eaf49cdd32ac4f14be1a809bbd8f7 # 1.37.1
hooks:
Expand Down Expand Up @@ -52,10 +47,27 @@ repos:
stages: [pre-commit, pre-merge-commit, manual]
pass_filenames: false

- id: rustfmt
name: rustfmt
- id: cargo-rustfmt
name: cargo-rustfmt
language: system
# Pinning to a specific rustc version, so that we get consistent formatting
entry: cargo +nightly-2025-05-26 fmt --all -- --check
stages: [pre-commit]
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$

- id: cargo-clippy
name: cargo-clippy
language: system
entry: cargo clippy --all-targets -- -D warnings
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$

- id: crd-preview
name: crd-preview
language: system
entry: cargo xtask crd preview
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$
5 changes: 4 additions & 1 deletion .scripts/verify_crate_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ set -euo pipefail
# stackable-webhook-0.3.1

for CRATE in $(find ./crates/ -mindepth 2 -name Cargo.toml -print0 | xargs -0 -n 1 dirname | xargs -n 1 basename | sort); do
if [ "$CRATE" = "xtask" ]; then
continue # Skip xtask binary, because it is not published and only used for internal tooling
fi

# Get the version in Cargo.toml
CRATE_VERSION=$(grep 'version' "./crates/$CRATE/Cargo.toml" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
[ -n "$CRATE_VERSION" ] || (
Expand Down Expand Up @@ -40,7 +44,6 @@ for CRATE in $(find ./crates/ -mindepth 2 -name Cargo.toml -print0 | xargs -0 -n
echo "Ensure the version in ./crates/$CRATE/Cargo.toml matches the version in ./crates/$ASSOCIATED_CRATE/Cargo.toml" >&2
exit 23
)

else
# Get the latest documented version from the CHANGELOG.md
CHANGELOG_VERSION=$(grep -oE '\[[0-9]+\.[0-9]+\.[0-9]+\]' "./crates/$CRATE/CHANGELOG.md" | head -1 | tr -d '[]')
Expand Down
3 changes: 3 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ rules:
check-keys: false
comments:
min-spaces-from-content: 1 # Needed due to https://github.com/adrienverge/yamllint/issues/443
indentation:
ignore:
crates/stackable-operator/crds/*.yaml
11 changes: 11 additions & 0 deletions Cargo.lock

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

294 changes: 294 additions & 0 deletions crates/stackable-operator/crds/AuthenticationClass.yaml

Large diffs are not rendered by default.

1,137 changes: 1,137 additions & 0 deletions crates/stackable-operator/crds/DummyCluster.yaml

Large diffs are not rendered by default.

123 changes: 123 additions & 0 deletions crates/stackable-operator/crds/Listener.yaml

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

84 changes: 84 additions & 0 deletions crates/stackable-operator/crds/ListenerClass.yaml

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

86 changes: 86 additions & 0 deletions crates/stackable-operator/crds/PodListeners.yaml

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

Loading