Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
S slapos.core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • slapos.core
  • Merge requests
  • !594

Merged
Created Jan 11, 2024 by Titouan Soulard@tsoulardDeveloper

cli/request: allow enforcing a given serialisation

  • Overview 13
  • Commits 1
  • Pipelines 3
  • Changes 2

Description of the problem

When passing a parameters file (option --parameters-file) to slapos request, parameters can be sent in two ways: as XML, or using JSON-in-XML. In order to decide which of the two types of serialisation should be used, we currently fetch the schema and use the serialisation parameter embedded in it. If no schema is found, for any reason whatsoever (no schema in the repository, flawed Internet access, etc), then the request will fail.

For most cases, since the schema is only required on request, this is not a huge issue: the schema can be added or it is possible to retry. However, when the network is not accessible at all, is not possible: deploying SRs will fail in any case. I encountered this case when deploying SRs without Internet access, using only a local cache: everything works except this one thing.

Proposed solution

This MR fixes the problem by adding a --force-serialisation to slapos request. The default behaviour is kept when the parameter is not set, but when set, this parameter will override anything else. This means that setting --force-serialisation xml will always send parameters in XML, even if a schema defines another serialisation format.

Edited Jan 11, 2024 by Titouan Soulard
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: enforcement-as-casual-work
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7