Skip to content

Commit

Permalink
Add documentation for saptuneapplysolution operator
Browse files Browse the repository at this point in the history
  • Loading branch information
CDimonaco committed Jan 14, 2025
1 parent cc5c36b commit 7185b27
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ It follows a transactional approach, where each operation has distinct stages:
- VERIFY
- ROLLBACK


The documentation for each of the operators can be found in the operators go source.

#### PLAN

The goal of the PLAN stage is to collect information about the operations and verify prerequisites.
Expand Down
27 changes: 27 additions & 0 deletions pkg/operator/saptuneapplysolution_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,33 @@ type saptuneApplySolutionArguments struct {
solution string
}

// SaptuneApplySolution is an operator responsible for applying a saptune solution.
//
// The operator requires an argument in the form of a map containing a key named "solution".
// This value will be passed to the saptune command-line tool.
//
// All considerations related to applying a solution using the saptune CLI apply here as well.
//
// # Execution Phases
//
// - PLAN:
// The operator checks for the presence of the saptune binary and verifies its version.
// The minimum required version is 3.1.0. If saptune is not installed or the version does not meet the minimum requirement,
// the operation will fail. The current state of the applied saptune solution is collected as the "before" diff.
//
// - COMMIT:
// The operator checks if the requested solution is already applied. If it is, no action is taken,
// ensuring idempotency without returning an error. If the solution is not applied, the saptune command
// to apply the solution will be executed.
//
// - VERIFY:
// The operator verifies whether the solution has been correctly applied to the system.
// If not, an error is raised. If successful, the current state of the applied solution is collected as the "after" diff.
//
// - ROLLBACK:
// If an error occurs during the COMMIT or VERIFY phase, the saptune revert command is executed
// to undo the applied solution.

type SaptuneApplySolution struct {
baseOperation
executor support.CmdExecutor
Expand Down

0 comments on commit 7185b27

Please sign in to comment.