Skip to content
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

Generate CoreDB Spec from Stack Spec #772

Merged
merged 11 commits into from
May 8, 2024
Merged

Generate CoreDB Spec from Stack Spec #772

merged 11 commits into from
May 8, 2024

Conversation

ChuckHend
Copy link
Collaborator

Quick way to generate a CoreDB Spec from a Stack spec. This wont work for all cases, and definitely not for production usage but will be handy for local development.

@ChuckHend ChuckHend marked this pull request as ready for review May 8, 2024 16:36
metadata: serde_json::json!({
"name": resource_name,
}),
spec: spec.clone(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a short-lived CLI tool, so it probably doesn't matter, but I'm trying to practice with the borrow checker and think it would be pretty easy to just pass ownership of spec to this function at the point of calling it, right? It's never used again in the calling function.

That said, it won't affect correctness or performance to use clone, I'm just reading to learn Rust better.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

@@ -175,6 +214,20 @@ fn default_storage() -> String {
"10Gi".to_owned()
}

pub fn merge_options<T>(opt1: Option<Vec<T>>, opt2: Option<Vec<T>>) -> Option<Vec<T>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I missed something, this isn't called in the changes in this review, right? What's it for?

@ChuckHend ChuckHend merged commit fb457d8 into main May 8, 2024
7 checks passed
@ChuckHend ChuckHend deleted the stack-to-coredb branch May 8, 2024 16:53
Copy link
Contributor

@jasonmp85 jasonmp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Left two non-blocking comments as questions for myself, but they're not related to approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants