Skip to content

Validate parameters before persisting them to parameters.yaml #109

@arvind4501

Description

@arvind4501

When parameter persistence is enabled (OBSAH_PERSIST_PARAMS=true), invalid parameters are written to parameters.yaml without validation . This causes the invalid values to persist across runs, forcing users to encounter the same validation errors on every subsequent execution until they manually edit or reset the parameter.

Steps to Reproduce

  1. Enable parameter persistence: OBSAH_PERSIST_PARAMS=true
  2. Run a command with an invalid parameter:
    ./foremanctl deploy --add-feature invalid-feature
  3. Observe that:
    • The invalid value invalid-feature is written to parameters.yaml
    • A validation error is displayed to the user
    • The command exits with an error
  4. Run the command again without any parameters:
    ./foremanctl deploy
  5. The same validation error occurs because invalid-feature is loaded from parameters.yaml

Similar issue can be see while Setting tuning higher than the system supports as they persists and blocks all later deployments

Expected Behavior

Parameters should only be persisted after successful validation. If validation fails, the parameter file should remain unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions