Skip to content

Commit

Permalink
Merge pull request #61 from Cray-HPE/CASMHMS-6281-imgstat
Browse files Browse the repository at this point in the history
CASMHMS-6281 imgstat
  • Loading branch information
rustydb authored Sep 30, 2024
2 parents 1847f88 + 6273204 commit 896d2c9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ kubernetes/.packaged/

# compiled go command
boot-script-service
!**/boot-script-service/
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.26.0
1.27.0
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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).

## [1.27.0]

### Changed

- CASMHMS-6281: Call `imgstat` after an initrd is downloaded to print out its filesize.

## [1.26.0] - 2023-07-06

### Added
Expand Down
30 changes: 16 additions & 14 deletions cmd/boot-script-service/default_api.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MIT License
//
// (C) Copyright [2021-2022] Hewlett Packard Enterprise Development LP
// (C) Copyright [2021-2024] 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 @@ -628,21 +628,23 @@ func buildBootScript(bd BootData, sp scriptParams, chain, role, subRole, descr s
}
u := bd.Kernel.Path
u, err = checkURL(u)
if err == nil {
script += "kernel --name kernel " + u + " " + strings.Trim(params, " ")
script += " || goto boot_retry\n"
if bd.Initrd.Path != "" {
u, err = checkURL(bd.Initrd.Path)
if err == nil {
script += "initrd --name initrd " + u + " || goto boot_retry\n"
}
if err != nil {
return script, err
}
script += "kernel --name kernel " + u + " " + strings.Trim(params, " ")
script += " || goto boot_retry\n"
if bd.Initrd.Path != "" {
u, err = checkURL(bd.Initrd.Path)
if err == nil {
script += "initrd --name initrd " + u + " || goto boot_retry\n"
script += "imgstat || echo Could not show image information."
}
script += "boot || goto boot_retry\n:boot_retry\n"
// We could vary the length of the sleep based on retry count or some
// other criteria.
// For now, just sleep a bit
script += fmt.Sprintf("sleep %d\n", retryDelay) + chain + "\n"
}
script += "boot || goto boot_retry\n:boot_retry\n"
// We could vary the length of the sleep based on retry count or some
// other criteria.
// For now, just sleep a bit
script += fmt.Sprintf("sleep %d\n", retryDelay) + chain + "\n"
return script, err
}

Expand Down
6 changes: 3 additions & 3 deletions runUnitTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ echo "COMPOSE_FILE: $COMPOSE_FILE"


function cleanup() {
docker-compose down
docker compose down
if ! [[ $? -eq 0 ]]; then
echo "Failed to decompose environment!"
exit 1
Expand All @@ -45,8 +45,8 @@ function cleanup() {


echo "Starting containers..."
docker-compose build
docker-compose up --exit-code-from unit-tests unit-tests
docker compose build
docker compose up --exit-code-from unit-tests unit-tests

test_result=$?

Expand Down

0 comments on commit 896d2c9

Please sign in to comment.