You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Endpoints returning response object configuration in working form (with defaults, transformations, etc.) rather than exactly how they were configured
#1000
Issue where the API responses for Post /task, Get /task and Get /task/:name return objects which have been mutated into their working form (e.g. with defaults, transformations, etc) rather than responding with the configuration exactly as configured.
The response objects returned by Get /task/:name, Get /tasks and Post /tasks for the same task are equivalent
The response objects are reflective of the tasks as they are configured
Actual Behavior
The response objects for Get /task/:name and Get /tasks are equivalent for tasks of the same name, however response objects returned by Post /tasks are different.
The objects returned also contain transformations that occur after configuration has been processed and converted to an internal task object for use with automation.
Examples:
task.working_dir, if unset, will be populated with the parent working_dir which is not what was configured.
task.buffer_period, if unset, will be populated with the parent buffer_period which is not what was configured.
When using a local task.module this field is populated with an absolute path, rather than the configured relative path.
The above transformations are required when using the task for automations, so fixing this bug would not change any of the existing behaviour, tasks will still inherit qualities from the parent configuration on usage. This fix will instead create consistency between endpoints and convey to the user exactly what was configured.
Steps to Reproduce
Create a task via the api
Assess the response
Get the same task
Assess the response
Get all tasks
Assess the object pertaining to the task created in (1)
The text was updated successfully, but these errors were encountered:
wilkermichael
changed the title
Endpoints returning incorrect configuration information
Endpoints returning configuration in working form rather than exactly how they were configured
Jul 25, 2022
wilkermichael
changed the title
Endpoints returning configuration in working form rather than exactly how they were configured
Endpoints returning response object configuration in working form (with defaults, transformations, etc.) rather than exactly how they were configured
Jul 25, 2022
Describe the bug
Issue where the API responses for
Post /task
,Get /task
andGet /task/:name
return objects which have been mutated into their working form (e.g. with defaults, transformations, etc) rather than responding with the configuration exactly as configured.Versions
Consul-Terraform-Sync
Consul Version
Terraform Version
Expected Behavior
Expect the following:
Get /task/:name
,Get /tasks
andPost /tasks
for the same task are equivalentActual Behavior
The response objects for
Get /task/:name
andGet /tasks
are equivalent for tasks of the same name, however response objects returned byPost /tasks
are different.The objects returned also contain transformations that occur after configuration has been processed and converted to an internal task object for use with automation.
Examples:
task.working_dir
, if unset, will be populated with the parentworking_dir
which is not what was configured.task.buffer_period
, if unset, will be populated with the parentbuffer_period
which is not what was configured.task.module
this field is populated with an absolute path, rather than the configured relative path.The above transformations are required when using the task for automations, so fixing this bug would not change any of the existing behaviour, tasks will still inherit qualities from the parent configuration on usage. This fix will instead create consistency between endpoints and convey to the user exactly what was configured.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: