Skip to content

[container_upgrade] Convert parameters.json from string to list format#23343

Open
wangxinbot wants to merge 1 commit intosonic-net:masterfrom
wangxinbot:xiwang5/container-upgrade-list-format
Open

[container_upgrade] Convert parameters.json from string to list format#23343
wangxinbot wants to merge 1 commit intosonic-net:masterfrom
wangxinbot:xiwang5/container-upgrade-list-format

Conversation

@wangxinbot
Copy link
Contributor

Description of PR

Summary:
Convert docker parameters in parameters.json from single string format to list format for better readability and to align with the internal repo format, reducing merge conflicts during public-to-internal sync.

Update create_parameters_mapping() to join the list with spaces, producing the same runtime result as before.

Type of change

  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Approach

What is the motivation for this PR?

The internal repo uses list format for docker parameters in parameters.json, while the public repo uses string format. This difference causes merge conflicts every time we sync public to internal. By aligning the format, future syncs will be clean.

How did you do it?

  1. Converted parameters.json entries from strings (e.g., "param1 param2") to lists (e.g., ["param1", "param2"])
  2. Updated create_parameters_mapping() in container_upgrade_helper.py to use ' '.join(details['parameters']) to reconstruct the string at runtime

How did you verify/test it?

The create_parameters_mapping() function joins the list back into a space-separated string, producing identical output to the previous string format. The docker run commands are unchanged.

Any platform specific information?

N/A

Supported testbed topology if it's a new test case?

N/A - existing test improvement

Documentation

N/A

Convert docker parameters from single string format to list format
for better readability and to align with the internal repo format,
reducing merge conflicts during public-to-internal sync.

Update create_parameters_mapping() to join the list with spaces,
producing the same runtime result as before.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Xin Wang <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@wangxinbot
Copy link
Contributor Author

@maipbui Can you help review this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants