mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-09-16 19:14:42 -04:00
deps: convert zap to slog (#2825)
This commit is contained in:
parent
3765cb0762
commit
54cce77bab
182 changed files with 1474 additions and 1509 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
|
@ -20,7 +21,6 @@ import (
|
|||
s3types "github.com/aws/aws-sdk-go-v2/service/s3/types"
|
||||
"github.com/edgelesssys/constellation/v2/internal/api/versionsapi"
|
||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
||||
"github.com/edgelesssys/constellation/v2/internal/logger"
|
||||
"github.com/edgelesssys/constellation/v2/internal/staticupload"
|
||||
)
|
||||
|
||||
|
@ -31,11 +31,11 @@ type Uploader struct {
|
|||
// bucket is the name of the S3 bucket to use.
|
||||
bucket string
|
||||
|
||||
log *logger.Logger
|
||||
log *slog.Logger
|
||||
}
|
||||
|
||||
// New creates a new Uploader.
|
||||
func New(ctx context.Context, region, bucket, distributionID string, log *logger.Logger) (*Uploader, CloseFunc, error) {
|
||||
func New(ctx context.Context, region, bucket, distributionID string, log *slog.Logger) (*Uploader, CloseFunc, error) {
|
||||
staticUploadClient, staticUploadClientClose, err := staticupload.New(ctx, staticupload.Config{
|
||||
Region: region,
|
||||
Bucket: bucket,
|
||||
|
@ -78,7 +78,7 @@ func (a *Uploader) Upload(ctx context.Context, imageInfo versionsapi.ImageInfo)
|
|||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
a.log.Debugf("Archiving image info to s3://%v/%v", a.bucket, key)
|
||||
a.log.Debug(fmt.Sprintf("Archiving image info to s3://%v/%v", a.bucket, key))
|
||||
buf := &bytes.Buffer{}
|
||||
if err := json.NewEncoder(buf).Encode(imageInfo); err != nil {
|
||||
return "", err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue