metio / kube-custom-resources-rs

Kubernetes Custom Resource Bindings for Rust
https://crates.io/crates/kube-custom-resources-rs
BSD Zero Clause License
24 stars 5 forks source link

./code-generator/generate.sh relies on "advanced" / non cross platform features of bash #335

Open banool opened 1 month ago

banool commented 1 month ago

I had to upgrade my bash version to 4.x.x to make the globstar option work.

To make adjust-cargo-toml.sh work (I'm on a Mac, this sed issue is classic) I had to do this:

sed -i '' '/\[features\]/,$d' ./kube-custom-resources-rs/Cargo.toml

I had to set K8S_OPENAPI_ENABLED_VERSION=1.31 for steps 3 and 4.

In create-custom-resources.sh I had to use mkdir -p "${version_directory}", not --parents.

At first I was using the wrong project_name. This one is mostly user error, I didn't read at first you that you have to update catalog.rs, it would've been obvious if I had. But it'd be nice if the tool errored out if the given project name is not present rather than silently "succeed".

Related to https://github.com/metio/kube-custom-resources-rs/pull/336.

I can open a PR later.

sebhoss commented 1 month ago

yeah thanks for opening this & sorry for the trouble!

I have a unwritten todo list that contains at least some of those:

I'll be away for a couple of days, therefore sorry in advance for slow replies..

sebhoss commented 1 month ago

I've pushed some changes in #339 that might work fine on Mac - would love to get some feedback whether that helped! I've used shellcheck to verify that each script is not using anything bash specific and re-wrote that one script with some rust code.