Skip to content

Commit

Permalink
CRAYSAT-1841: Add support for CFS v2 or v3 to sat bootprep
Browse files Browse the repository at this point in the history
Add support for using either the CFS v2 or v3 API in `sat bootprep`
based on the value of the command-line option `--cfs-version` or the
config-file option `cfs.api_version`. Before this change, `sat bootprep`
was hard-coded to always use CFS v2.

Update the `InputConfiguration`, `InputConfigurationLayer`, and
`AdditionalInventory` classes to keep a reference to the instance of the
version-specific subclass of `CFSClientBase`, so that they can delegate
operations to the appropriate version of the CFS API.

This removes a lot of code that required knowledge of the CFS API and
instead uses classes and methods defined in the `csm_api_client`
library, which has already been updated to support both CFS v2 and v3.
This should reduce code duplication across `sat` and `csm_api_client`.

Some unit tests are no longer needed here because that functionality is
tested in the `csm_api_client` instead. Other unit tests are updated to
include the `cfs_client` instance that needs to be passed into the input
layer and configuration objects.

This also makes the `playbook` property required in the schema because
the CFS v3 API requires that the playbook be specified. This is
technically a backwards-incompatible schema change because it can
invalidate certain bootprep input files if they define layers without
playbooks. The default bootprep files contain a playbook for every
layer and do not depend on the CFS default playbook value, so this
should be a pretty safe and non-disruptive change.

Test Description:
Unit tests only so far.

Still needs to be tested on a real system.
  • Loading branch information
haasken-hpe committed Nov 15, 2024
1 parent 663015b commit f2c4833
Show file tree
Hide file tree
Showing 6 changed files with 363 additions and 393 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.33.0] - 2024-11-15

### Added
- Added support for using either the CFS v2 or v3 API in `sat bootprep`,
depending on the value of the `--cfs-version` command-line option or the
`cfs.api_version` config-file option.

### Changed
- Modified the `sat bootprep` input file schema to require the `playbook` field
be specified for each layer of a CFS configuration. The CFS v3 API requires a
playbook for each layer.

## [3.32.10] - 2024-11-04

### Fixed
Expand Down
Loading

0 comments on commit f2c4833

Please sign in to comment.