Skip to content

Commit

Permalink
Remove imgid field in coreos aleph
Browse files Browse the repository at this point in the history
This commit removes the dependency of the imgid field in the coreos
aleph file. As per the discussion in the following PR to OSBuild,
as decision was made to remove the field:

dustymabe/osbuild#10 (comment)

A decision was also made to log the entire aleph file since it is more
verbose.
  • Loading branch information
lukewarmtemp committed Dec 1, 2023
1 parent d469add commit 85ab0d5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/daemon/coreos.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ import (
// information see e.g. https://github.com/coreos/fedora-coreos-tracker/blob/main/internals%2FREADME-internals.md#aleph-version
const alephPath = "/sysroot/.coreos-aleph-version.json"

type coreosAleph struct {
Build string `json:"build"`
Imgid string `json:"imgid"`
}

// ignitionProvisioningPath is written by Ignition, see
// https://github.com/coreos/ignition/commit/556bc9404cfff08ea63c2a865bd3586ece7e8e44
const ignitionProvisioningPath = "/etc/.ignition-result.json"
Expand All @@ -47,11 +42,15 @@ func logAlephInformation() error {
if err != nil {
return err
}
var alephData coreosAleph
var alephData map[string]any
if err := json.Unmarshal(contents, &alephData); err != nil {
return err
}
klog.Infof("CoreOS aleph version: mtime=%v build=%v imgid=%v\n", stat.ModTime().UTC(), alephData.Build, alephData.Imgid)
prettyAlephData, err := json.MarshalIndent(alephData, "", " ")
if err != nil {
klog.Fatalf("marshaling error: %s", err)
}
klog.Infof("CoreOS aleph version: mtime=%v\n%v", stat.ModTime().UTC(), string(prettyAlephData))
return nil
}

Expand Down

0 comments on commit 85ab0d5

Please sign in to comment.