-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: generate /etc/os-release file static way
The file which is exported back to source via `make generate` is using short tag (vX.Y.Z), while the one generated for the actual build comes with full version tag. Fixes #8898 Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
- Loading branch information
Showing
7 changed files
with
83 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,5 @@ func DefaultTasks() []Task { | |
SetEnvironmentVariables, | ||
WriteIMAPolicy, | ||
CreateSystemCgroups, | ||
OSRelease, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
//go:build generate | ||
|
||
package main | ||
|
||
import ( | ||
"log" | ||
"os" | ||
|
||
"github.com/siderolabs/talos/pkg/machinery/version" | ||
) | ||
|
||
func main() { | ||
data, err := version.OSRelease() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
if err = os.WriteFile("os-release", data, 0o644); err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NAME="Talos" | ||
ID=talos | ||
VERSION_ID=v1.10.0-alpha.0 | ||
PRETTY_NAME="Talos (v1.10.0-alpha.0)" | ||
HOME_URL="https://www.talos.dev/" | ||
BUG_REPORT_URL="https://github.com/siderolabs/talos/issues" | ||
VENDOR_NAME="Sidero Labs" | ||
VENDOR_URL="https://www.siderolabs.com/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
|
||
package version | ||
|
||
//go:generate go run ./gen.go | ||
|
||
import ( | ||
"bytes" | ||
"strings" | ||
|