Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CASMHMS-6281 imgstat #61

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading