mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-02-23 08:20:15 -05:00
Log disk uuid to cloud logging
This commit is contained in:
parent
d6b5e954e7
commit
d43ee053ed
@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Kubernetes version is configured through an entry in `constellation-config.yaml`.
|
||||
- Kubernetes version 1.24 is now supported.
|
||||
- Kubernetes version 1.22 is now supported.
|
||||
- Log the disk UUID to cloud logging for recovery.
|
||||
|
||||
### Changed
|
||||
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"net"
|
||||
|
||||
"github.com/edgelesssys/constellation/bootstrapper/internal/clean"
|
||||
"github.com/edgelesssys/constellation/bootstrapper/internal/diskencryption"
|
||||
"github.com/edgelesssys/constellation/bootstrapper/internal/initserver"
|
||||
"github.com/edgelesssys/constellation/bootstrapper/internal/joinclient"
|
||||
"github.com/edgelesssys/constellation/bootstrapper/internal/logging"
|
||||
@ -28,6 +29,15 @@ func run(issuer quoteIssuer, tpm vtpm.TPMOpenFunc, fileHandler file.Handler,
|
||||
log.With(zap.String("version", version)).Infof("Starting bootstrapper")
|
||||
cloudLogger.Disclose("bootstrapper started running...")
|
||||
|
||||
uuid, err := getDiskUUID()
|
||||
if err != nil {
|
||||
log.With(zap.Error(err)).Errorf("Failed to get disk UUID")
|
||||
cloudLogger.Disclose("Failed to get disk UUID")
|
||||
} else {
|
||||
log.Infof("Disk UUID: %s", uuid)
|
||||
cloudLogger.Disclose("Disk UUID: " + uuid)
|
||||
}
|
||||
|
||||
nodeBootstrapped, err := vtpm.IsNodeBootstrapped(tpm)
|
||||
if err != nil {
|
||||
log.With(zap.Error(err)).Fatalf("Failed to check if node was previously bootstrapped")
|
||||
@ -60,6 +70,15 @@ func run(issuer quoteIssuer, tpm vtpm.TPMOpenFunc, fileHandler file.Handler,
|
||||
cloudLogger.Disclose("bootstrapper done")
|
||||
}
|
||||
|
||||
func getDiskUUID() (string, error) {
|
||||
disk := diskencryption.New()
|
||||
if err := disk.Open(); err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer disk.Close()
|
||||
return disk.UUID()
|
||||
}
|
||||
|
||||
type clusterInitJoiner interface {
|
||||
joinclient.ClusterJoiner
|
||||
initserver.ClusterInitializer
|
||||
|
Loading…
x
Reference in New Issue
Block a user