Skip to content

Commit

Permalink
Merge pull request #110 from Cray-HPE/hotfix/CASMCMS-9068
Browse files Browse the repository at this point in the history
Add correction logic for whitespace characters from helmchart
  • Loading branch information
jsl-hpe authored Jan 6, 2025
2 parents 60b0fe9 + baa4a27 commit 431bdbf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ 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).

## [Unreleased]
## [1.15.1] - 2025-1-6
### Changed
- Added additional logic to correct for whitespace characters in helm options file

## [1.15.0] - 2024-12-16
### Added
- Added passthrough option for affecting global build options through the associated configset (global_additional_build_options).

## [1.14.2] - 2024-09-05

Expand Down
9 changes: 8 additions & 1 deletion kubernetes/cms-ipxe/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# MIT License
#
# (C) Copyright 2021-2024 Hewlett Packard Enterprise Development LP
# (C) Copyright 2021-2025 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -167,6 +167,13 @@ ipxe:
# support kpxe/undionly variants.
build_kind: ipxe

# This allows injection of new custom build options for ipxe. This is a GLOBAL SETTING, so every build will have these
# values included at build time. The format of this value is a comma delimited string. By default, this string is
# empty. Changing this value to anything that is not supported by the ipxe build makefile will likely break ALL
# builds. Only change this value if you have a solid understanding of the internals of the ipxe build chain, as the
# contents of this setting are passed in to the build process as is.
global_additional_build_options: ""

# These options are specific to x86_64 ipxe builds
build_x86: true
cray_ipxe_binary_name: ipxe.efi
Expand Down
15 changes: 14 additions & 1 deletion src/crayipxe/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# MIT License
#
# (C) Copyright 2023-2024 Hewlett Packard Enterprise Development LP
# (C) Copyright 2023-2025 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -135,6 +135,17 @@ def global_settings(self):
self.recreation_necessary = True
return self._global_settings

@property
def global_additional_build_options(self):
"""
A list of strings that correspond to MAKE targets for building. These are typically user supplied values that
affect the overall build of all ipxe flavors.
:return: A list of build options to append at build time.
"""
return [option.strip()
for option in self.global_settings.get('global_additional_build_options', '').strip().split(',')
if option.strip()]

@property
def build_kind(self):
"""
Expand Down Expand Up @@ -385,6 +396,8 @@ def build_command(self):
build_command.append('BEARER_TOKEN=%s' % self.bearer_token)
LOGGER.debug("Build command generated as: [%s]" % ' '.join(build_command[:-1]))
LOGGER.debug("BEARER_TOKEN=<omitted> for reasons of security.")
if self.global_additional_build_options:
build_command.extend(self.global_additional_build_options)
return build_command

@property
Expand Down

0 comments on commit 431bdbf

Please sign in to comment.