Cannot edit SGCluster if it has init scripts
Summary
If a SGCluster is created with init scripts cannot be edited in the UI
Current Behaviour
The javascripts of UI fails
Steps to reproduce
- Create a SGCluster with two init script with the respective content:
CREATE USER pguser WITH PASSWORD 'pguser';
CREATE DATABASE pgbench OWNER pguser;
- Wait for the cluster to be created
- Edit any field of the SGCluser
Expected Behaviour
It should be possible to edit a SGCluster with init scripts
Environment
- StackGres version: 1.0.0-RC1
- Kubernetes version: 1.16.15
- Cloud provider or hardware configuration: eks
Relevant logs and/or screenshots
The browser console shows the following error:
vue.esm.js:1906 TypeError: Cannot read properties of undefined (reading 'length')
at CreateCluster.vue:1288
at Array.forEach (<anonymous>)
at s.cleanupScripts (CreateCluster.vue:1281)
at s.createCluster (CreateCluster.vue:1311)
at at (vue.esm.js:1872)
at HTMLAnchorElement.n (vue.esm.js:2197)
at HTMLAnchorElement.a._wrapper (vue.esm.js:7609)