diff --git a/src/sdl/index.ts b/src/sdl/index.ts index 836c8e6..fafed34 100644 --- a/src/sdl/index.ts +++ b/src/sdl/index.ts @@ -258,7 +258,7 @@ export class SDL { const pairs = Object.keys(attributes).map(key => ({ key, value: attributes[key].toString() })); - if (attributes.class === "ram" && !attributes.persistent) { + if (attributes.class === "ram" && !("persistent" in attributes)) { pairs.push({ key: "persistent", value: "false" }); } diff --git a/tests/__snapshots__/sdl_persistent_storage_attributes.spec.ts.snap b/tests/__snapshots__/sdl_persistent_storage_attributes.spec.ts.snap index c055655..eef08d4 100644 --- a/tests/__snapshots__/sdl_persistent_storage_attributes.spec.ts.snap +++ b/tests/__snapshots__/sdl_persistent_storage_attributes.spec.ts.snap @@ -194,6 +194,22 @@ exports[`test sdl persistent storage SDL: Persistent Storage Manifest: SDL: Pers "val": 1073741824, }, }, + { + "attributes": [ + { + "key": "class", + "value": "ram", + }, + { + "key": "persistent", + "value": "false", + }, + ], + "name": "shm2", + "size": { + "val": 1073741824, + }, + }, ], }, "params": { diff --git a/tests/fixtures/persistent_storage_valid.sdl.yml b/tests/fixtures/persistent_storage_valid.sdl.yml index 0462bd1..7ed5dfb 100644 --- a/tests/fixtures/persistent_storage_valid.sdl.yml +++ b/tests/fixtures/persistent_storage_valid.sdl.yml @@ -79,6 +79,11 @@ profiles: size: 1Gi attributes: class: ram + - name: shm2 + size: 1Gi + attributes: + class: ram + persistent: false placement: akash: #######################################################