api: Remove dry-run parameter
Armada's dry-run option is incomplete, no longer maintained, and offers little value for the complexity required to maintain it. This commit is the first in a series of changes to remove the dry-run feature. Specifically, this change removes the parameter as an option for the API. Story: 2005121 Change-Id: If5bd2639fe3e9af3f4cc669cd627b47c1d8fec16 Signed-off-by: Drew Walters <andrew.walters@att.com>
This commit is contained in:
parent
243022d16c
commit
d6ad0e5e46
@ -118,7 +118,7 @@ class BaseResource(object):
|
|||||||
self.log_error(ctx, log.ERROR, msg)
|
self.log_error(ctx, log.ERROR, msg)
|
||||||
|
|
||||||
def get_tiller(self, req, resp):
|
def get_tiller(self, req, resp):
|
||||||
return Tiller(dry_run=req.get_param_as_bool('dry_run'))
|
return Tiller()
|
||||||
|
|
||||||
|
|
||||||
class ArmadaRequestContext(object):
|
class ArmadaRequestContext(object):
|
||||||
|
@ -94,7 +94,6 @@ class Apply(api.BaseResource):
|
|||||||
disable_update_pre=req.get_param_as_bool('disable_update_pre'),
|
disable_update_pre=req.get_param_as_bool('disable_update_pre'),
|
||||||
disable_update_post=req.get_param_as_bool('disable_update_post'),
|
disable_update_post=req.get_param_as_bool('disable_update_post'),
|
||||||
enable_chart_cleanup=req.get_param_as_bool('enable_chart_cleanup'),
|
enable_chart_cleanup=req.get_param_as_bool('enable_chart_cleanup'),
|
||||||
dry_run=req.get_param_as_bool('dry_run'),
|
|
||||||
force_wait=req.get_param_as_bool('wait'),
|
force_wait=req.get_param_as_bool('wait'),
|
||||||
timeout=req.get_param_as_int('timeout'),
|
timeout=req.get_param_as_int('timeout'),
|
||||||
tiller=tiller,
|
tiller=tiller,
|
||||||
|
@ -48,7 +48,6 @@ class Rollback(api.BaseResource):
|
|||||||
|
|
||||||
@lock_and_thread()
|
@lock_and_thread()
|
||||||
def handle(self, req, release, tiller):
|
def handle(self, req, release, tiller):
|
||||||
dry_run = req.get_param_as_bool('dry_run')
|
|
||||||
tiller.rollback_release(
|
tiller.rollback_release(
|
||||||
release,
|
release,
|
||||||
req.get_param_as_int('version') or 0,
|
req.get_param_as_int('version') or 0,
|
||||||
@ -57,5 +56,4 @@ class Rollback(api.BaseResource):
|
|||||||
force=req.get_param_as_bool('force'),
|
force=req.get_param_as_bool('force'),
|
||||||
recreate_pods=req.get_param_as_bool('recreate_pods'))
|
recreate_pods=req.get_param_as_bool('recreate_pods'))
|
||||||
|
|
||||||
return ('(dry run) ' if dry_run else '') + \
|
return 'Rollback of {} complete.'.format(release)
|
||||||
'Rollback of {} complete.'.format(release)
|
|
||||||
|
@ -44,7 +44,6 @@ class ArmadaControllerTest(base.BaseControllerTest):
|
|||||||
'disable_update_post': 'false',
|
'disable_update_post': 'false',
|
||||||
'enable_chart_cleanup': 'false',
|
'enable_chart_cleanup': 'false',
|
||||||
'skip_pre_flight': 'false',
|
'skip_pre_flight': 'false',
|
||||||
'dry_run': 'false',
|
|
||||||
'wait': 'false',
|
'wait': 'false',
|
||||||
'timeout': '100'
|
'timeout': '100'
|
||||||
}
|
}
|
||||||
@ -56,7 +55,6 @@ class ArmadaControllerTest(base.BaseControllerTest):
|
|||||||
'disable_update_pre': False,
|
'disable_update_pre': False,
|
||||||
'disable_update_post': False,
|
'disable_update_post': False,
|
||||||
'enable_chart_cleanup': False,
|
'enable_chart_cleanup': False,
|
||||||
'dry_run': False,
|
|
||||||
'force_wait': False,
|
'force_wait': False,
|
||||||
'timeout': 100,
|
'timeout': 100,
|
||||||
'tiller': m_tiller,
|
'tiller': m_tiller,
|
||||||
@ -89,7 +87,7 @@ class ArmadaControllerTest(base.BaseControllerTest):
|
|||||||
}], **expected_armada_options)
|
}], **expected_armada_options)
|
||||||
mock_armada.return_value.sync.assert_called()
|
mock_armada.return_value.sync.assert_called()
|
||||||
|
|
||||||
mock_tiller.assert_called_with(dry_run=False)
|
mock_tiller.assert_called()
|
||||||
m_tiller.__exit__.assert_called()
|
m_tiller.__exit__.assert_called()
|
||||||
|
|
||||||
def test_armada_apply_no_href(self):
|
def test_armada_apply_no_href(self):
|
||||||
@ -103,7 +101,6 @@ class ArmadaControllerTest(base.BaseControllerTest):
|
|||||||
'disable_update_post': 'false',
|
'disable_update_post': 'false',
|
||||||
'enable_chart_cleanup': 'false',
|
'enable_chart_cleanup': 'false',
|
||||||
'skip_pre_flight': 'false',
|
'skip_pre_flight': 'false',
|
||||||
'dry_run': 'false',
|
|
||||||
'wait': 'false',
|
'wait': 'false',
|
||||||
'timeout': '100'
|
'timeout': '100'
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,6 @@ class RollbackReleaseControllerTest(base.BaseControllerTest):
|
|||||||
|
|
||||||
release = 'test-release'
|
release = 'test-release'
|
||||||
version = '2'
|
version = '2'
|
||||||
dry_run = 'false'
|
|
||||||
wait = 'true'
|
wait = 'true'
|
||||||
timeout = '123'
|
timeout = '123'
|
||||||
force = 'true'
|
force = 'true'
|
||||||
@ -47,7 +46,6 @@ class RollbackReleaseControllerTest(base.BaseControllerTest):
|
|||||||
resp = self.app.simulate_post(
|
resp = self.app.simulate_post(
|
||||||
'/api/v1.0/rollback/{}'.format(release),
|
'/api/v1.0/rollback/{}'.format(release),
|
||||||
params={
|
params={
|
||||||
'dry_run': dry_run,
|
|
||||||
'version': version,
|
'version': version,
|
||||||
'wait': wait,
|
'wait': wait,
|
||||||
'timeout': timeout,
|
'timeout': timeout,
|
||||||
@ -55,7 +53,7 @@ class RollbackReleaseControllerTest(base.BaseControllerTest):
|
|||||||
'recreate_pods': recreate_pods
|
'recreate_pods': recreate_pods
|
||||||
})
|
})
|
||||||
|
|
||||||
mock_tiller.assert_called_once_with(dry_run=False)
|
mock_tiller.assert_called_once()
|
||||||
|
|
||||||
rollback_release.assert_called_once_with(
|
rollback_release.assert_called_once_with(
|
||||||
release, 2, wait=True, timeout=123, force=True, recreate_pods=True)
|
release, 2, wait=True, timeout=123, force=True, recreate_pods=True)
|
||||||
|
@ -45,7 +45,7 @@ class TillerControllerTest(base.BaseControllerTest):
|
|||||||
|
|
||||||
self.assertEqual(expected, result.json)
|
self.assertEqual(expected, result.json)
|
||||||
self.assertEqual('application/json', result.headers['content-type'])
|
self.assertEqual('application/json', result.headers['content-type'])
|
||||||
mock_tiller.assert_called_once_with(dry_run=None)
|
mock_tiller.assert_called_once()
|
||||||
m_tiller.__exit__.assert_called()
|
m_tiller.__exit__.assert_called()
|
||||||
|
|
||||||
@mock.patch.object(api, 'Tiller')
|
@mock.patch.object(api, 'Tiller')
|
||||||
@ -70,7 +70,7 @@ class TillerControllerTest(base.BaseControllerTest):
|
|||||||
|
|
||||||
self.assertEqual(expected, result.json)
|
self.assertEqual(expected, result.json)
|
||||||
self.assertEqual('application/json', result.headers['content-type'])
|
self.assertEqual('application/json', result.headers['content-type'])
|
||||||
mock_tiller.assert_called_once_with(dry_run=None)
|
mock_tiller.assert_called_once()
|
||||||
m_tiller.__exit__.assert_called()
|
m_tiller.__exit__.assert_called()
|
||||||
|
|
||||||
@mock.patch.object(api, 'Tiller')
|
@mock.patch.object(api, 'Tiller')
|
||||||
@ -100,7 +100,7 @@ class TillerControllerTest(base.BaseControllerTest):
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.assertEqual(expected, result.json)
|
self.assertEqual(expected, result.json)
|
||||||
mock_tiller.assert_called_once_with(dry_run=None)
|
mock_tiller.assert_called_once()
|
||||||
m_tiller.list_releases.assert_called_once_with()
|
m_tiller.list_releases.assert_called_once_with()
|
||||||
m_tiller.__exit__.assert_called()
|
m_tiller.__exit__.assert_called()
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ class TillerControllerTest(base.BaseControllerTest):
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.assertEqual(expected, result.json)
|
self.assertEqual(expected, result.json)
|
||||||
mock_tiller.assert_called_once_with(dry_run=None)
|
mock_tiller.assert_called_once()
|
||||||
m_tiller.list_releases.assert_called_once_with()
|
m_tiller.list_releases.assert_called_once_with()
|
||||||
m_tiller.__exit__.assert_called()
|
m_tiller.__exit__.assert_called()
|
||||||
|
|
||||||
|
@ -92,7 +92,6 @@ paths:
|
|||||||
- $ref: "#/parameters/disable-update-pre"
|
- $ref: "#/parameters/disable-update-pre"
|
||||||
- $ref: "#/parameters/disable-update-post"
|
- $ref: "#/parameters/disable-update-post"
|
||||||
- $ref: "#/parameters/enable-chart-cleanup"
|
- $ref: "#/parameters/enable-chart-cleanup"
|
||||||
- $ref: "#/parameters/dry-run"
|
|
||||||
- $ref: "#/parameters/wait"
|
- $ref: "#/parameters/wait"
|
||||||
- $ref: "#/parameters/timeout"
|
- $ref: "#/parameters/timeout"
|
||||||
- name: request_body
|
- name: request_body
|
||||||
@ -194,7 +193,6 @@ paths:
|
|||||||
- $ref: "#/parameters/tiller-host"
|
- $ref: "#/parameters/tiller-host"
|
||||||
- $ref: "#/parameters/tiller-port"
|
- $ref: "#/parameters/tiller-port"
|
||||||
- $ref: "#/parameters/tiller-namespace"
|
- $ref: "#/parameters/tiller-namespace"
|
||||||
- $ref: "#/parameters/dry-run"
|
|
||||||
- $ref: "#/parameters/wait"
|
- $ref: "#/parameters/wait"
|
||||||
- $ref: "#/parameters/timeout"
|
- $ref: "#/parameters/timeout"
|
||||||
- $ref: "#/parameters/force"
|
- $ref: "#/parameters/force"
|
||||||
@ -287,13 +285,6 @@ parameters:
|
|||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: False
|
default: False
|
||||||
dry-run:
|
|
||||||
in: query
|
|
||||||
name: dry_run
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
description: Flag to simulate an action if set to True
|
|
||||||
default: False
|
|
||||||
wait:
|
wait:
|
||||||
in: query
|
in: query
|
||||||
name: wait
|
name: wait
|
||||||
|
@ -118,7 +118,6 @@ paths:
|
|||||||
- $ref: "#/components/parameters/disable-update-pre"
|
- $ref: "#/components/parameters/disable-update-pre"
|
||||||
- $ref: "#/components/parameters/disable-update-post"
|
- $ref: "#/components/parameters/disable-update-post"
|
||||||
- $ref: "#/components/parameters/enable-chart-cleanup"
|
- $ref: "#/components/parameters/enable-chart-cleanup"
|
||||||
- $ref: "#/components/parameters/dry-run"
|
|
||||||
- $ref: "#/components/parameters/wait"
|
- $ref: "#/components/parameters/wait"
|
||||||
- $ref: "#/components/parameters/timeout"
|
- $ref: "#/components/parameters/timeout"
|
||||||
requestBody:
|
requestBody:
|
||||||
@ -219,7 +218,6 @@ paths:
|
|||||||
- $ref: "#/components/parameters/tiller-host"
|
- $ref: "#/components/parameters/tiller-host"
|
||||||
- $ref: "#/components/parameters/tiller-port"
|
- $ref: "#/components/parameters/tiller-port"
|
||||||
- $ref: "#/components/parameters/tiller-namespace"
|
- $ref: "#/components/parameters/tiller-namespace"
|
||||||
- $ref: "#/components/parameters/dry-run"
|
|
||||||
- $ref: "#/components/parameters/wait"
|
- $ref: "#/components/parameters/wait"
|
||||||
- $ref: "#/components/parameters/timeout"
|
- $ref: "#/components/parameters/timeout"
|
||||||
- $ref: "#/components/parameters/force"
|
- $ref: "#/components/parameters/force"
|
||||||
@ -345,13 +343,6 @@ components:
|
|||||||
description: Flag to test disabled tests
|
description: Flag to test disabled tests
|
||||||
schema:
|
schema:
|
||||||
type: boolean
|
type: boolean
|
||||||
dry-run:
|
|
||||||
in: query
|
|
||||||
name: dry_run
|
|
||||||
required: false
|
|
||||||
description: Flag to simulate an install if set to True
|
|
||||||
schema:
|
|
||||||
type: boolean
|
|
||||||
timeout:
|
timeout:
|
||||||
in: query
|
in: query
|
||||||
name: timeout
|
name: timeout
|
||||||
|
Loading…
Reference in New Issue
Block a user