Skip to content

Commit

Permalink
fix: auto-initialize storage for services
Browse files Browse the repository at this point in the history
  • Loading branch information
jtary committed Aug 30, 2023
1 parent 53b9c2e commit 5244578
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web/src/components/SdlConfiguration/Storage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,14 @@ export const Storage: React.FC<StorageProps> = ({
variant="outlined"
size="small"
onClick={() => {
const sdl = arrayHelpers.form.values.sdl as SDLSpec;

if (sdl.services[serviceName]?.params?.storage === undefined) {
sdl.services[serviceName].params = {
storage: {},
};
}

arrayHelpers.insert(
profiles.compute[currentProfile]?.resources.storage?.length + 1 ?? 0,
{
Expand Down

0 comments on commit 5244578

Please sign in to comment.