Skip to content

Commit

Permalink
fixed issues from last rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Feb 8, 2024
1 parent cc980b5 commit 2cd44b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
11 changes: 7 additions & 4 deletions bootstrapper/cmd/bootstrapper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ func main() {
case cloudprovider.Azure:
metadata, err := azurecloud.New(ctx)
if err != nil {
log.With(zap.Error(err)).Fatalf("Failed to create Azure metadata client")
log.With(slog.Any("error", err)).Error("Failed to create Azure metadata client")
os.Exit(1)
}

if err := metadata.PrepareControlPlaneNode(ctx, log); err != nil {
log.With(zap.Error(err)).Fatalf("Failed to prepare Azure control plane node")
log.With(slog.Any("error", err)).Error("Failed to prepare Azure control plane node")
os.Exit(1)
}

metadataAPI = metadata
Expand Down Expand Up @@ -142,13 +144,14 @@ func main() {
return tdx.Open()
}
default:
log.Fatalf("Unsupported attestation variant: %s", attestVariant)
log.Error(fmt.Sprintf("Unsupported attestation variant: %s", attestVariant))
}
fs = afero.NewOsFs()
case cloudprovider.OpenStack:
metadata, err := openstackcloud.New(ctx)
if err != nil {
log.With(zap.Error(err)).Fatalf("Failed to create OpenStack metadata client")
log.With(slog.Any("error", err)).Error("Failed to create OpenStack metadata client")
os.Exit(1);
}
clusterInitJoiner = kubernetes.New(
"openstack", k8sapi.NewKubernetesUtil(), &k8sapi.KubdeadmConfiguration{}, kubectl.NewUninitialized(),
Expand Down
12 changes: 5 additions & 7 deletions bootstrapper/cmd/bootstrapper/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@ import (
"github.com/edgelesssys/constellation/v2/internal/constants"
"github.com/edgelesssys/constellation/v2/internal/file"
"github.com/edgelesssys/constellation/v2/internal/grpc/dialer"
"github.com/edgelesssys/constellation/v2/internal/logger"
"go.uber.org/zap"
)

func run(issuer atls.Issuer, openDevice vtpm.TPMOpenFunc, fileHandler file.Handler,
kube clusterInitJoiner, metadata metadataAPI,
bindIP, bindPort string, log *logger.Logger,
bindIP, bindPort string, log *slog.Logger,
) {
log.With(zap.String("version", constants.BinaryVersion().String())).Infof("Starting bootstrapper")
log.With(slog.String("version", constants.BinaryVersion().String())).Info("Starting bootstrapper")

uuid, err := getDiskUUID()
if err != nil {
log.With(zap.Error(err)).Errorf("Failed to get disk UUID")
log.With(slog.Any("error", err)).Error("Failed to get disk UUID")
} else {
log.Infof("Disk UUID: %s", uuid)
log.Info(fmt.Sprintf("Disk UUID: %s", uuid))
}

nodeBootstrapped, err := initialize.IsNodeBootstrapped(openDevice)
Expand Down Expand Up @@ -76,7 +74,7 @@ func run(issuer atls.Issuer, openDevice vtpm.TPMOpenFunc, fileHandler file.Handl
os.Exit(1)
}

log.Infof("bootstrapper done")
log.Info("bootstrapper done")
}

func getDiskUUID() (string, error) {
Expand Down
1 change: 0 additions & 1 deletion hack/qemu-metadata-api/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package server
import (
"encoding/json"
"fmt"
"io"
"log/slog"
"net"
"net/http"
Expand Down

0 comments on commit 2cd44b2

Please sign in to comment.