Skip to content

Commit 9940444

Browse files
Mattia Franchettomtfranchetto
Mattia Franchetto
authored andcommitted
Remove disable rollback when creating a cluster
1 parent 1f12341 commit 9940444

File tree

4 files changed

+1
-46
lines changed

4 files changed

+1
-46
lines changed

frontend/locales/en/strings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,8 +1054,7 @@
10541054
"title": "Cluster configuration",
10551055
"description": "Check/edit the yaml file that is used to create the cluster",
10561056
"pending": "{{action}} request pending...",
1057-
"forceUpdate": "Force update: Edit the cluster while the compute fleet is still running.",
1058-
"disableRollback": "Disable rollback: Retain the cluster resources in case of a cluster create failure."
1057+
"forceUpdate": "Force update: Edit the cluster while the compute fleet is still running."
10591058
},
10601059
"flashBar": {
10611060
"success": "Success"

frontend/src/__tests__/CreateCluster.test.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ describe('given a CreateCluster command and a cluster configuration', () => {
5454
mockRegion,
5555
mockSelectedRegion,
5656
false,
57-
false,
5857
mockSuccessCallback,
5958
)
6059
expect(mockSuccessCallback).toHaveBeenCalledTimes(1)
@@ -70,7 +69,6 @@ describe('given a CreateCluster command and a cluster configuration', () => {
7069
clusterConfiguration,
7170
mockRegion,
7271
mockSelectedRegion,
73-
false,
7472
mockDryRun,
7573
)
7674
expect(mockRequest).toHaveBeenCalledTimes(1)
@@ -83,28 +81,6 @@ describe('given a CreateCluster command and a cluster configuration', () => {
8381
)
8482
})
8583
})
86-
87-
describe('when stack rollback on failure is disabled', () => {
88-
const mockDisableRollback = true
89-
90-
it('should add set the rollbackOnFailure query parameter', async () => {
91-
await CreateCluster(
92-
clusterName,
93-
clusterConfiguration,
94-
mockRegion,
95-
mockSelectedRegion,
96-
mockDisableRollback,
97-
)
98-
expect(mockRequest).toHaveBeenCalledTimes(1)
99-
expect(mockRequest).toHaveBeenCalledWith(
100-
'post',
101-
'api?path=/v3/clusters&rollbackOnFailure=false&region=some-region',
102-
expect.any(Object),
103-
expect.any(Object),
104-
expect.any(Object),
105-
)
106-
})
107-
})
10884
})
10985

11086
describe('when the cluster creation fails', () => {
@@ -129,7 +105,6 @@ describe('given a CreateCluster command and a cluster configuration', () => {
129105
mockRegion,
130106
mockSelectedRegion,
131107
false,
132-
false,
133108
undefined,
134109
mockErrorCallback,
135110
)

frontend/src/model.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,12 @@ function CreateCluster(
7676
clusterConfig: any,
7777
region: string,
7878
selectedRegion: string,
79-
disableRollback = false,
8079
dryrun = false,
8180
successCallback?: Callback,
8281
errorCallback?: Callback,
8382
) {
8483
var url = 'api?path=/v3/clusters'
8584
url += dryrun ? '&dryrun=true' : ''
86-
url += disableRollback ? '&rollbackOnFailure=false' : ''
8785
url += region ? `&region=${region}` : ''
8886
var body = {clusterName: clusterName, clusterConfiguration: clusterConfig}
8987
request('post', url, body)

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ function handleCreate(
5858
) {
5959
const clusterName = getState(['app', 'wizard', 'clusterName'])
6060
const editing = getState(['app', 'wizard', 'editing'])
61-
const disableRollback =
62-
getState(['app', 'wizard', 'disableRollback']) || false
6361
const forceUpdate = getState(['app', 'wizard', 'forceUpdate'])
6462
const clusterConfig = getState(configPath) || ''
6563
const dryRun = false
@@ -99,7 +97,6 @@ function handleCreate(
9997
clusterConfig,
10098
region,
10199
selectedRegion,
102-
disableRollback,
103100
dryRun,
104101
successHandler,
105102
errHandler,
@@ -114,7 +111,6 @@ function handleDryRun() {
114111
const clusterConfig = getState(configPath) || ''
115112
const region = getState(['app', 'wizard', 'config', 'Region'])
116113
const selectedRegion = getState(['app', 'selectedRegion'])
117-
const disableRollback = false
118114
const dryRun = true
119115
var errHandler = (err: any) => {
120116
setState(['app', 'wizard', 'errors', 'create'], err)
@@ -141,7 +137,6 @@ function handleDryRun() {
141137
clusterConfig,
142138
region,
143139
selectedRegion,
144-
disableRollback,
145140
dryRun,
146141
successHandler,
147142
errHandler,
@@ -196,8 +191,6 @@ function Create() {
196191
const {t} = useTranslation()
197192
const clusterConfig = useState(configPath)
198193
const forceUpdate = useState(['app', 'wizard', 'forceUpdate']) || false
199-
const disableRollback =
200-
useState(['app', 'wizard', 'disableRollback']) || false
201194
const errors = useState(['app', 'wizard', 'errors', 'create'])
202195
const pending = useState(['app', 'wizard', 'pending'])
203196
const editing = getState(['app', 'wizard', 'editing'])
@@ -254,16 +247,6 @@ function Create() {
254247
{t('wizard.create.configuration.forceUpdate')}
255248
</Checkbox>
256249
)}
257-
{!editing && (
258-
<Checkbox
259-
checked={disableRollback}
260-
onChange={() =>
261-
setState(['app', 'wizard', 'disableRollback'], !disableRollback)
262-
}
263-
>
264-
{t('wizard.create.configuration.disableRollback')}
265-
</Checkbox>
266-
)}
267250
</SpaceBetween>
268251
</Container>
269252
)

0 commit comments

Comments
 (0)