format string uses

%q not useful for []string; %v used instead

%q in nop.go

replaced %v with %s for strings

-""-
This commit is contained in:
miampf 2024-03-20 16:36:36 +01:00
parent 0ab2947c29
commit da8d18121d
No known key found for this signature in database
GPG Key ID: EF039364B5B6886C
5 changed files with 5 additions and 5 deletions

View File

@ -74,7 +74,7 @@ func (a *Archivist) Archive(ctx context.Context, version versionsapi.Version, cs
if err != nil {
return "", err
}
a.log.Debug(fmt.Sprintf("Archiving OS image %q to s3://%v/%v", fmt.Sprintf("%s %s %v", csp, attestationVariant, version.ShortPath()), a.bucket, key))
a.log.Debug(fmt.Sprintf("Archiving OS image %q to s3://%s/%s", fmt.Sprintf("%s %s %v", csp, attestationVariant, version.ShortPath()), a.bucket, key))
_, err = a.uploadClient.Upload(ctx, &s3.PutObjectInput{
Bucket: &a.bucket,
Key: &key,

View File

@ -78,7 +78,7 @@ func (a *Uploader) Upload(ctx context.Context, imageInfo versionsapi.ImageInfo)
if err != nil {
return "", err
}
a.log.Debug(fmt.Sprintf("Archiving image info to s3://%v/%v", a.bucket, key))
a.log.Debug(fmt.Sprintf("Archiving image info to s3://%s/%s", a.bucket, key))
buf := &bytes.Buffer{}
if err := json.NewEncoder(buf).Encode(imageInfo); err != nil {
return "", err

View File

@ -92,7 +92,7 @@ func (a *Uploader) Upload(ctx context.Context, rawMeasurement, signature io.Read
if err != nil {
return "", "", err
}
a.log.Debug(fmt.Sprintf("Archiving image measurements to s3://%v/%v and s3://%v/%v", a.bucket, key, a.bucket, sigKey))
a.log.Debug(fmt.Sprintf("Archiving image measurements to s3://%s/%s and s3://%s/%s", a.bucket, key, a.bucket, sigKey))
if _, err = a.uploadClient.Upload(ctx, &s3.PutObjectInput{
Bucket: &a.bucket,
Key: &key,

View File

@ -28,6 +28,6 @@ func New(log *slog.Logger) *Uploader {
// Upload pretends to upload images to a csp.
func (u *Uploader) Upload(_ context.Context, req *osimage.UploadRequest) ([]versionsapi.ImageInfoEntry, error) {
u.log.Debug(fmt.Sprintf("Skipping image upload of %s since this CSP does not require images to be uploaded in advance.", req.Version.ShortPath()))
u.log.Debug(fmt.Sprintf("Skipping image upload of %q since this CSP does not require images to be uploaded in advance.", req.Version.ShortPath()))
return nil, nil
}

View File

@ -219,7 +219,7 @@ func (c *Client) waitForInvalidations(ctx context.Context) error {
}
waiter := cloudfront.NewInvalidationCompletedWaiter(c.cdnClient)
c.logger.Debug(fmt.Sprintf("Waiting for invalidations %q in distribution %q", c.invalidationIDs, c.distributionID))
c.logger.Debug(fmt.Sprintf("Waiting for invalidations %v in distribution %q", c.invalidationIDs, c.distributionID))
for _, invalidationID := range c.invalidationIDs {
waitIn := &cloudfront.GetInvalidationInput{
DistributionId: &c.distributionID,