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

Add patch for writefile action #2441

Merged
merged 2 commits into from
Aug 28, 2023
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
2 changes: 1 addition & 1 deletion projects/tinkerbell/hub/CHECKSUMS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
e004f52237340707b753fd226c6c369931d9d6c1f966615d6475d4c2fd13dcf0 _output/bin/hub/linux-amd64/image2disk
dcfec6b7c4fc2452defdaaec7a611fbe6cdf00e8e5dae86768447578849a4766 _output/bin/hub/linux-amd64/kexec
cdf00127e3c815c792e3eb7e61fa858095a62afb98bda2714f92e463ca95f0cb _output/bin/hub/linux-amd64/oci2disk
9bbedaca313d22dd326665c84f308808bb73a593436d881b8929a887844b8ba6 _output/bin/hub/linux-amd64/writefile
5d1d786bf1b4c7e658b01282ff9a4df6342903115a8660031e60be70c04b9cf7 _output/bin/hub/linux-amd64/writefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 1f42fd3edda7bd83a1b1770e6038c7c6d6de6ece Mon Sep 17 00:00:00 2001
From: Prow Bot <prow@amazonaws.com>
Date: Mon, 28 Aug 2023 11:05:36 -0600
Subject: [PATCH] Allow BOOTCONFIG_CONTENTS and CONTENTS to be checked:

Without this a Bottlerocket action that only
specifies BOOTCONFIG_CONTENTS will fail.

Signed-off-by: Prow Bot <prow@amazonaws.com>
---
actions/writefile/v1/main.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/actions/writefile/v1/main.go b/actions/writefile/v1/main.go
index bf9f4ac..d5f923c 100644
--- a/actions/writefile/v1/main.go
+++ b/actions/writefile/v1/main.go
@@ -259,8 +259,8 @@ func main() {
}
}

- if contents == "" {
- log.Fatal("No content. Either the CONTENTS env var was not set or a data retrieval action failed.")
+ if contents == "" && bootconfig == "" {
+ log.Fatal("No content. Either the CONTENTS or BOOTCONFIG_CONTENTS env vars were not set or a data retrieval action failed.")
}

// If bootconfig is set, contents will be empty and will serve as output initrd file provided
--
2.41.0