mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-30 19:44:18 -04:00
rewrote packages
keyservice joinservice upgrade-agent measurement-reader debugd disk-mapper rewrote joinservice main rewrote some unit tests rewrote upgrade-agent + some grpc functions rewrote measurement-reader rewrote debugd removed unused import removed forgotten zap reference in measurements reader rewrote disk-mapper + tests rewrote packages verify disk-mapper malicious join bootstrapper attestationconfigapi versionapi internal/cloud/azure disk-mapper tests image/upload/internal/cmd rewrote verify (WIP with loglevel increase) rewrote forgotten zap references in disk-mapper rewrote malicious join rewrote bootstrapper rewrote parts of internal/ rewrote attestationconfigapi (WIP) rewrote versionapi cli rewrote internal/cloud/azure rewrote disk-mapper tests (untested by me rn) rewrote image/upload/internal/cmd removed forgotten zap references in verify/cmd rewrote packages hack/oci-pin hack/qemu-metadata-api debugd/internal/debugd/deploy hack/bazel-deps-mirror cli/internal/cmd cli-k8s-compatibility rewrote hack/qemu-metadata-api/server rewrote debugd/internal/debugd/deploy rewrote hack/bazel-deps-mirror rewrote rest of hack/qemu-metadata-api rewrote forgotten zap references in joinservice server rewrote cli/internal/cmd rewrote cli-k8s-compatibility rewrote packages internal/staticupload e2d/internal/upgrade internal/constellation/helm internal/attestation/aws/snp internal/attestation/azure/trustedlaunch joinservice/internal/certcache/amkds some missed unit tests rewrote e2e/internal/upgrade rewrote internal/constellation/helm internal/attestation/aws/snp internal/attestation/azure/trustedlaunch joinservice/internal/certcache/amkds search and replace test logging over all left *_test.go
This commit is contained in:
parent
48d5a157dd
commit
f16ccf5679
158 changed files with 3400 additions and 1278 deletions
|
@ -15,6 +15,7 @@ package staticupload
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -25,7 +26,6 @@ import (
|
|||
cftypes "github.com/aws/aws-sdk-go-v2/service/cloudfront/types"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
||||
"github.com/edgelesssys/constellation/v2/internal/logger"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
@ -45,7 +45,7 @@ type Client struct {
|
|||
dirtyKeys []string
|
||||
// invalidationIDs is a list of invalidation IDs that are currently in progress.
|
||||
invalidationIDs []string
|
||||
logger *logger.Logger
|
||||
logger *slog.Logger
|
||||
}
|
||||
|
||||
// Config is the configuration for the Client.
|
||||
|
@ -101,7 +101,7 @@ func (e *InvalidationError) Unwrap() error {
|
|||
}
|
||||
|
||||
// New creates a new Client. Call CloseFunc when done with operations.
|
||||
func New(ctx context.Context, config Config, log *logger.Logger) (*Client, CloseFunc, error) {
|
||||
func New(ctx context.Context, config Config, log *slog.Logger) (*Client, CloseFunc, error) {
|
||||
config.SetsDefault()
|
||||
cfg, err := awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(config.Region))
|
||||
if err != nil {
|
||||
|
@ -134,7 +134,7 @@ func (c *Client) Flush(ctx context.Context) error {
|
|||
c.mux.Lock()
|
||||
defer c.mux.Unlock()
|
||||
|
||||
c.logger.Debugf("Invalidating keys: %s", c.dirtyKeys)
|
||||
c.logger.Debug(fmt.Sprintf("Invalidating keys: %s", c.dirtyKeys))
|
||||
if len(c.dirtyKeys) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
@ -214,12 +214,12 @@ func (c *Client) invalidateCacheForKeys(ctx context.Context, keys []string) (str
|
|||
// waitForInvalidations waits for all invalidations to finish.
|
||||
func (c *Client) waitForInvalidations(ctx context.Context) error {
|
||||
if c.cacheInvalidationWaitTimeout == 0 {
|
||||
c.logger.Warnf("cacheInvalidationWaitTimeout set to 0, not waiting for invalidations to finish")
|
||||
c.logger.Warn("cacheInvalidationWaitTimeout set to 0, not waiting for invalidations to finish")
|
||||
return nil
|
||||
}
|
||||
|
||||
waiter := cloudfront.NewInvalidationCompletedWaiter(c.cdnClient)
|
||||
c.logger.Debugf("Waiting for invalidations %s in distribution %s", c.invalidationIDs, c.distributionID)
|
||||
c.logger.Debug(fmt.Sprintf("Waiting for invalidations %s in distribution %s", c.invalidationIDs, c.distributionID))
|
||||
for _, invalidationID := range c.invalidationIDs {
|
||||
waitIn := &cloudfront.GetInvalidationInput{
|
||||
DistributionId: &c.distributionID,
|
||||
|
@ -230,7 +230,7 @@ func (c *Client) waitForInvalidations(ctx context.Context) error {
|
|||
}
|
||||
|
||||
}
|
||||
c.logger.Debugf("Invalidations finished")
|
||||
c.logger.Debug("Invalidations finished")
|
||||
c.invalidationIDs = nil
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue