Skip to content

Commit

Permalink
fix(actor): parse default value of string fields
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Nov 14, 2024
1 parent 5e36887 commit 04d10fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 4 additions & 3 deletions crates/cassette/src/components/actor/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ pub fn build_form(

let value = match default {
Value::String(value) => value.clone(),
value => ::serde_json::to_string_pretty(value)
.ok()
.or_else(|| spec.default.clone())
value => spec
.default
.clone()
.or_else(|| ::serde_json::to_string_pretty(value).ok())
.unwrap_or_default(),
};

Expand Down
11 changes: 7 additions & 4 deletions examples/helm_actor_nvidia_isaac_sim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ spec:
string: {}
- name: Amount of CPUs
path: /values/resources/limits/cpu
string:
default: "4"
string: {}
- name: Amount of Memory
path: /values/resources/limits/memory
string:
default: 16Gi
string: {}
- name: Number of GPUs
path: /values/resources/limits/nvidia.com~1gpu
number:
Expand All @@ -50,3 +48,8 @@ spec:
repo: https://smartx-team.github.io/mobilex-api
name: omni01
namespace: name-twin
values:
resources:
limits:
cpu: "4"
memory: 16Gi

0 comments on commit 04d10fe

Please sign in to comment.