mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-06 14:04:17 -04:00
image: implement idempotent upload of os images
This commit is contained in:
parent
17c45bc881
commit
ee91d8b1cc
42 changed files with 4272 additions and 95 deletions
31
internal/osimage/nop/nop.go
Normal file
31
internal/osimage/nop/nop.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
// package nop implements a no-op for CSPs that don't require custom image upload functionality.
|
||||
package nop
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/internal/logger"
|
||||
"github.com/edgelesssys/constellation/v2/internal/osimage"
|
||||
)
|
||||
|
||||
// Uploader is a no-op uploader.
|
||||
type Uploader struct {
|
||||
log *logger.Logger
|
||||
}
|
||||
|
||||
// New creates a new Uploader.
|
||||
func New(log *logger.Logger) *Uploader {
|
||||
return &Uploader{log: log}
|
||||
}
|
||||
|
||||
// Upload pretends to upload images to a csp.
|
||||
func (u *Uploader) Upload(_ context.Context, req *osimage.UploadRequest) (map[string]string, error) {
|
||||
u.log.Debugf("Skipping image upload of %s since this CSP does not require images to be uploaded in advance.", req.Version.ShortPath())
|
||||
return nil, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue