Skip to content

Commit

Permalink
Update default sentinel file location (#26)
Browse files Browse the repository at this point in the history
* Update default sentinel file location

Uses current Kured location

* Don't run GoReleaser on branches

Where is it going to push the binary?

* Keep /run location
  • Loading branch information
george-angel authored Aug 30, 2023
1 parent bfec211 commit 8a7c2dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
tags:
- "v*"
pull_request:
branches:
- "master"

permissions:
contents: write
Expand All @@ -22,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- name: Install test dependencies
run: go get .
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/utilitywarehouse/flatcar-pxe-update-engine

go 1.20
go 1.21

require (
github.com/godbus/dbus/v5 v5.1.0
Expand Down
3 changes: 2 additions & 1 deletion update_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const (
var (
// Flag file location for kured:
// https://github.com/flatcar-linux/update_engine/commit/93f6cdddd46e9fba6c336c1db3baa6c89d85979b
// https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html
kuredReleasePath = "/run/reboot-required"
)

Expand Down Expand Up @@ -257,7 +258,7 @@ func touchFile(fileName string) error {

// fuzzDuration adds a random jitter to a given duration. It's adapted from the
// equivalent method in the original update_engine:
// - https://github.com/kinvolk/update_engine/blob/v0.4.10/src/update_engine/utils.cc#L510-L515
// - https://github.com/kinvolk/update_engine/blob/v0.4.10/src/update_engine/utils.cc#L510-L515
func fuzzDuration(r *rand.Rand, value time.Duration, fuzz time.Duration) time.Duration {
min := int64(value.Nanoseconds() - (fuzz.Nanoseconds() / 2))
max := int64(value.Nanoseconds() + (fuzz.Nanoseconds() / 2))
Expand Down

0 comments on commit 8a7c2dc

Please sign in to comment.