Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • slapos slapos
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 129
    • Merge requests 129
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • slaposslapos
  • Merge requests
  • !1638

Introduce slapconfiguration:jsonschema recipe

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Xavier Thompson requested to merge xavier_thompson/slapos:feat/slapconfiguration-with-jsonschema into master Sep 05, 2024
  • Overview 49
  • Commits 6
  • Pipelines 0
  • Changes 3
  • Enable <= slap-connection in slapconfiguration usage
    This is for convenience, to allow

    [slap-configuration]
    <= slap-connection
    recipe = slapos.cookbook:slapconfiguration
  • Add slapconfiguration:jsonschema recipe. This validates the parameter dict against the JSON schema, and fills in defaults from the schema first if the property is not set by the user. This allows for a unique source of truth in default parameters :) It also uses the serialisation in the schema to determine how the parameters should be parsed (xml or json-in-xml). It requires downloading the JSON schemas in the SR.

    • This works for both regular instance parameters and for shared instance parameters.
    • Errors in the regular instance parameters lead to a raised exception, but errors in shared instance parameters just result in this shared instance being collected in invalid-shared-instance-list, while valid shared instances are collected in valid-shared-instance-list.
  • Add toggle parameters to slapconfiguration:jsonschema to allow selecting whether validating parameters and setting defaults apply to main or shared parameters or both or neither:

apply to validate-parameters set-default
neither main nor shared none none
shared parameters main main
main parameters shared shared
main and shared all all
Edited Jan 10, 2025 by Xavier Thompson
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feat/slapconfiguration-with-jsonschema
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7