Skip to content

Commit 5529745

Browse files
committed
fix create cluster from template
1 parent 40fd88c commit 5529745

File tree

4 files changed

+9
-23
lines changed

4 files changed

+9
-23
lines changed

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
1010
// limitations under the License.
1111
import {ClusterStatus, ClusterDescription} from '../../types/clusters'
12-
import React, {PropsWithChildren, ReactElement} from 'react'
12+
import React from 'react'
1313
import {Trans, useTranslation} from 'react-i18next'
1414
import {findFirst, clusterDefaultUser} from '../../util'
1515
import {useState, setState, ssmPolicy} from '../../store'
@@ -39,7 +39,6 @@ import InfoLink from '../../components/InfoLink'
3939
import {useClusterPoll} from '../../components/useClusterPoll'
4040
import {ValueWithLabel} from '../../components/ValueWithLabel'
4141
import {EnableCostMonitoringButton} from './Costs/EnableCostMonitoringButton'
42-
import {DescribeCluster, GetConfiguration} from "../../model";
4342

4443
export default function ClusterProperties() {
4544
const {t} = useTranslation()
@@ -50,11 +49,6 @@ export default function ClusterProperties() {
5049
const defaultRegion = useState(['aws', 'region'])
5150
const region = useState(['app', 'selectedRegion']) || defaultRegion
5251

53-
DescribeCluster(clusterName).then(data => {
54-
const version = data.version
55-
setState(['app', 'wizard', 'version'], version)
56-
})
57-
5852
function isSsmPolicy(p: any) {
5953
return p.hasOwnProperty('Policy') && p.Policy === ssmPolicy(region)
6054
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ function Configure() {
116116
const [refreshing, setRefreshing] = React.useState(false)
117117
let navigate = useNavigate()
118118

119-
setState(['app', 'wizard', 'version'], null)
120-
121119
const clusterPath = ['clusters', 'index', clusterName]
122120
const fleetStatus: ComputeFleetStatus = useState([
123121
...clusterPath,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ function Version() {
3434
// Get the current version
3535
const currentVersion = getState(['app', 'wizard', 'version'])
3636

37-
// Clear version only if we're not editing and there's no version set,
38-
// or if we're explicitly not in editing mode
39-
if (!editing && (currentVersion === undefined || currentVersion === null)) {
37+
// Clear version only if we're not editing
38+
if (!editing) {
4039
setState(['app', 'wizard', 'version'], null)
4140
}
4241
}, [editing])

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ function loadTemplateLazy(config: any, callback?: () => void) {
122122
setState(['app', 'wizard', 'loaded'], true)
123123
setState(['app', 'wizard', 'config'], config)
124124

125-
// if (version) {
126-
// setState(['app', 'wizard', 'version'], version)
127-
// }
128-
129125
if (keypairs.length > 0 && !keypairNames.has(getIn(config, keypairPath)))
130126
setState(['app', 'wizard', 'config', ...keypairPath], keypairs[0].KeyName)
131127
setState(['app', 'wizard', 'page'], 'version')
@@ -169,15 +165,14 @@ const wizardLoadingPath = ['app', 'wizard', 'source', 'loading']
169165

170166
function loadTemplateFromCluster(clusterName: string) {
171167
setState(wizardLoadingPath, true)
172-
const clusterPath = ['clusters', 'index', clusterName]
173-
const version = getState([...clusterPath, 'version'])
174168

175-
console.log("GOT HERE")
176-
GetConfiguration(clusterName, (configuration: any) => {
177-
setState(['app', 'wizard', 'version'], version)
178-
loadTemplate(load(configuration), () => setState(wizardLoadingPath, false))
169+
DescribeCluster(clusterName).then(data => {
170+
const version = data.version
171+
GetConfiguration(clusterName, (configuration: any) => {
172+
setState(['app', 'wizard', 'version'], version)
173+
loadTemplate(load(configuration), () => setState(wizardLoadingPath, false))
174+
})
179175
})
180-
181176
}
182177

183178
export {loadTemplate, subnetName, loadTemplateFromCluster}

0 commit comments

Comments
 (0)