Skip to content

Commit ff49a2b

Browse files
committed
Fix cluster update
1 parent 98ed239 commit ff49a2b

File tree

5 files changed

+16
-1238
lines changed

5 files changed

+16
-1238
lines changed

frontend/src/old-pages/Clusters/Actions.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,13 @@ export default function Actions() {
9393

9494
const editConfiguration = React.useCallback(() => {
9595
setState(['app', 'wizard', 'clusterName'], clusterName)
96-
setState(['app', 'wizard', 'page'], 'cluster')
96+
setState(['app', 'wizard', 'page'], 'version')
9797
setState(['app', 'wizard', 'editing'], true)
98+
setState(['app', 'wizard', 'version'], clusterVersion)
9899

99100
navigate('/configure')
100101
loadTemplateFromCluster(clusterName)
101-
}, [clusterName, navigate])
102+
}, [clusterName, navigate, clusterVersion])
102103

103104
const deleteCluster = React.useCallback(() => {
104105
console.log(`Deleting: ${clusterName}`)

frontend/src/old-pages/Clusters/Costs/costs.queries.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export function useCostMonitoringDataQuery(clusterName: string) {
4242

4343
export function useCostMonitoringStatus() {
4444
const isCostMonitoringActive = useFeatureFlag('cost_monitoring')
45-
console.log("UseCostMonitoringStatus")
4645
return useQuery(
4746
COST_MONITORING_STATUS_QUERY_KEY,
4847
() => GetCostMonitoringStatus(),

frontend/src/old-pages/Configure/Create.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ function handleCreate(
9696
const dryRun = false
9797
const region = getState(['app', 'wizard', 'config', 'Region'])
9898
const selectedRegion = getState(['app', 'selectedRegion'])
99-
const version = getState(['app', 'wizard', 'version'])
99+
const clusterPath = ['clusters', 'index', clusterName]
100+
const version = getState([...clusterPath, 'version'])
101+
const cluster = getState(clusterPath)
100102
setClusterLoadingMsg(clusterName, editing, dryRun)
101103
setState(wizardSubmissionLoading, true)
102104

@@ -121,9 +123,9 @@ function handleCreate(
121123
UpdateCluster(
122124
clusterName,
123125
clusterConfig,
124-
version,
125126
dryRun,
126127
forceUpdate,
128+
version,
127129
successHandler,
128130
errHandler,
129131
)

frontend/src/old-pages/Configure/util.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
1111
// limitations under the License.
1212

13-
import {setState, getState, clearState} from '../../store'
13+
import {setState, getState, clearState, useState} from '../../store'
1414
import {DescribeCluster, GetConfiguration, LoadAwsConfig} from '../../model'
1515
import {getIn, setIn} from '../../util'
1616
import {mapComputeResources} from './Queues/queues.mapper'
@@ -169,13 +169,15 @@ const wizardLoadingPath = ['app', 'wizard', 'source', 'loading']
169169

170170
function loadTemplateFromCluster(clusterName: string) {
171171
setState(wizardLoadingPath, true)
172-
DescribeCluster(clusterName).then(data => {
173-
const version = data.version
174-
GetConfiguration(clusterName, (configuration: any) => {
175-
setState(['app', 'wizard', 'version'], version)
176-
loadTemplate(load(configuration), () => setState(wizardLoadingPath, false))
177-
})
172+
const clusterPath = ['clusters', 'index', clusterName]
173+
const version = getState([...clusterPath, 'version'])
174+
175+
console.log("GOT HERE")
176+
GetConfiguration(clusterName, (configuration: any) => {
177+
setState(['app', 'wizard', 'version'], version)
178+
loadTemplate(load(configuration), () => setState(wizardLoadingPath, false))
178179
})
180+
179181
}
180182

181183
export {loadTemplate, subnetName, loadTemplateFromCluster}

0 commit comments

Comments
 (0)