mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 06:16:08 -04:00
cli: add basic support for constellation create
on OpenStack (#1283)
* image: support OpenStack image build / upload * cli: add OpenStack terraform template * config: add OpenStack as CSP * versionsapi: add OpenStack as CSP * cli: add OpenStack as provider for `config generate` and `create` * disk-mapper: add basic support for boot on OpenStack * debugd: add placeholder for OpenStack * image: fix config file sourcing for image upload
This commit is contained in:
parent
b013a7ab32
commit
b79f7d0c8c
37 changed files with 954 additions and 79 deletions
|
@ -30,6 +30,8 @@ type ImageInfo struct {
|
|||
Azure map[string]string `json:"azure,omitempty"`
|
||||
// GCP is a map of image types to GCP image IDs.
|
||||
GCP map[string]string `json:"gcp,omitempty"`
|
||||
// OpenStack is a map of image types to OpenStack image IDs.
|
||||
OpenStack map[string]string `json:"openstack,omitempty"`
|
||||
// QEMU is a map of image types to QEMU image URLs.
|
||||
QEMU map[string]string `json:"qemu,omitempty"`
|
||||
}
|
||||
|
@ -78,6 +80,9 @@ func (i ImageInfo) ValidateRequest() error {
|
|||
if len(i.GCP) != 0 {
|
||||
retErr = errors.Join(retErr, errors.New("GCP map must be empty for request"))
|
||||
}
|
||||
if len(i.OpenStack) != 0 {
|
||||
retErr = errors.Join(retErr, errors.New("OpenStack map must be empty for request"))
|
||||
}
|
||||
if len(i.QEMU) != 0 {
|
||||
retErr = errors.Join(retErr, errors.New("QEMU map must be empty for request"))
|
||||
}
|
||||
|
@ -97,17 +102,14 @@ func (i ImageInfo) Validate() error {
|
|||
if !semver.IsValid(i.Version) {
|
||||
retErr = errors.Join(retErr, fmt.Errorf("version %q is not a valid semver", i.Version))
|
||||
}
|
||||
if len(i.AWS) == 0 {
|
||||
retErr = errors.Join(retErr, errors.New("AWS map must not be empty"))
|
||||
}
|
||||
if len(i.Azure) == 0 {
|
||||
retErr = errors.Join(retErr, errors.New("Azure map must not be empty"))
|
||||
}
|
||||
if len(i.GCP) == 0 {
|
||||
retErr = errors.Join(retErr, errors.New("GCP map must not be empty"))
|
||||
}
|
||||
if len(i.QEMU) == 0 {
|
||||
retErr = errors.Join(retErr, errors.New("QEMU map must not be empty"))
|
||||
var providers int
|
||||
providers += len(i.AWS)
|
||||
providers += len(i.Azure)
|
||||
providers += len(i.GCP)
|
||||
providers += len(i.OpenStack)
|
||||
providers += len(i.QEMU)
|
||||
if providers == 0 {
|
||||
retErr = errors.Join(retErr, errors.New("one or more providers must be specified"))
|
||||
}
|
||||
|
||||
return retErr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue