Skip to content

Commit

Permalink
fix: build of talosctl on non-Linux platforms
Browse files Browse the repository at this point in the history
The code from `talosctl` imports transitively tpm package, so make it
build on non-Linux.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Dec 26, 2024
1 parent 4761a9e commit 4189454
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/pkg/tpm/tpm.go → internal/pkg/tpm/tpm_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// 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 linux

// Package tpm provides TPM 2.0 support.
package tpm

Expand Down
19 changes: 19 additions & 0 deletions internal/pkg/tpm/tpm_other.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 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 !linux

// Package tpm provides TPM 2.0 support.
package tpm

import (
"errors"

"github.com/google/go-tpm/tpm2/transport"
)

// Open a TPM device.
func Open() (transport.TPMCloser, error) {
return nil, errors.New("TPM device is not available")
}

0 comments on commit 4189454

Please sign in to comment.