Merge pull request #5 from kairos-io/fix-version-bug-and-typpos

Fix typo in name, bad function call and version of the binary
This commit is contained in:
Dimitris Karakasilis
2022-11-15 15:13:05 +02:00
committed by GitHub
2 changed files with 9 additions and 5 deletions

View File

@@ -6,9 +6,11 @@ ARG BASE_IMAGE=quay.io/kairos/core-opensuse
build-kcrypt:
FROM golang:alpine
RUN apk add git
COPY . /work
WORKDIR /work
RUN CGO_ENABLED=0 go build -o kcrypt
ARG VERSION="$(git describe --tags)"
RUN CGO_ENABLED=0 go build -o kcrypt -ldflags "-X main.Version=$VERSION"
SAVE ARTIFACT /work/kcrypt AS LOCAL kcrypt
build-dracut:

10
main.go
View File

@@ -21,6 +21,8 @@ import (
pi "github.com/kairos-io/kcrypt/pkg/partition_info"
)
var Version = "v0.0.0-dev"
func waitdevice(device string, attempts int) error {
for tries := 0; tries < attempts; tries++ {
sh("udevadm settle")
@@ -279,7 +281,7 @@ func injectInitrd(initrd string, file, dst string) error {
func unlockAll() error {
bus.Manager.Initialize()
partitionInfo, err := pi.NewPartitionInfoFromFile(pi.DefaultPartitionInfoFile)
partitionInfo, _, err := pi.NewPartitionInfoFromFile(pi.DefaultPartitionInfoFile)
if err != nil {
return err
}
@@ -305,10 +307,10 @@ func unlockAll() error {
func main() {
app := &cli.App{
Name: "keiros-kcrypt",
Version: "0.1",
Name: "kairos-kcrypt",
Version: Version,
Author: "Ettore Di Giacinto",
Usage: "keiros escrow key agent component",
Usage: "kairos escrow key agent component",
Description: ``,
UsageText: ``,
Copyright: "Ettore Di Giacinto",