mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-13 18:04:20 -05:00
d972f053f9
Trusted launch VM images in original SIG, additional SIG for community images for CVM Signed-off-by: Fabian Kammel <fk@edgeless.systems>
38 lines
755 B
Go
38 lines
755 B
Go
package azure
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
const (
|
|
DefaultResourceGroupName = "CONSTELLATION-IMAGES"
|
|
DefaultGalleryName = "Constellation_CVM"
|
|
DefaultImageDefinition = "constellation"
|
|
)
|
|
|
|
type Options struct {
|
|
SubscriptionID string
|
|
ResourceGroupName string
|
|
GalleryName string
|
|
ImageDefinition string
|
|
}
|
|
|
|
func DefaultOptions() Options {
|
|
return Options{
|
|
SubscriptionID: "",
|
|
ResourceGroupName: DefaultResourceGroupName,
|
|
GalleryName: DefaultGalleryName,
|
|
ImageDefinition: DefaultImageDefinition,
|
|
}
|
|
}
|
|
|
|
func (o *Options) SetSubscription(sub string) error {
|
|
if _, err := uuid.Parse(sub); err != nil {
|
|
return fmt.Errorf("unable to set subscription: %w", err)
|
|
}
|
|
o.SubscriptionID = sub
|
|
return nil
|
|
}
|