mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
cli: correct measurements in config generate stackit
This commit is contained in:
parent
f94c6ca0d4
commit
8b41bcaecc
@ -128,7 +128,7 @@ func (cg *configGenerateCmd) configGenerate(cmd *cobra.Command, fileHandler file
|
|||||||
|
|
||||||
// createConfigWithAttestationVariant creates a config file for the given provider.
|
// createConfigWithAttestationVariant creates a config file for the given provider.
|
||||||
func createConfigWithAttestationVariant(provider cloudprovider.Provider, rawProvider string, attestationVariant variant.Variant) (*config.Config, error) {
|
func createConfigWithAttestationVariant(provider cloudprovider.Provider, rawProvider string, attestationVariant variant.Variant) (*config.Config, error) {
|
||||||
conf := config.Default().WithOpenStackProviderDefaults(rawProvider)
|
conf := config.Default().WithOpenStackProviderDefaults(provider, rawProvider)
|
||||||
conf.RemoveProviderExcept(provider)
|
conf.RemoveProviderExcept(provider)
|
||||||
|
|
||||||
// set a lower default for QEMU's state disk
|
// set a lower default for QEMU's state disk
|
||||||
|
@ -140,7 +140,7 @@ func TestConfigGenerateDefaultProviderSpecific(t *testing.T) {
|
|||||||
fileHandler := file.NewHandler(afero.NewMemMapFs())
|
fileHandler := file.NewHandler(afero.NewMemMapFs())
|
||||||
cmd := newConfigGenerateCmd()
|
cmd := newConfigGenerateCmd()
|
||||||
|
|
||||||
wantConf := config.Default().WithOpenStackProviderDefaults(tc.rawProvider)
|
wantConf := config.Default().WithOpenStackProviderDefaults(cloudprovider.OpenStack, tc.rawProvider)
|
||||||
wantConf.RemoveProviderAndAttestationExcept(tc.provider)
|
wantConf.RemoveProviderAndAttestationExcept(tc.provider)
|
||||||
|
|
||||||
cg := &configGenerateCmd{
|
cg := &configGenerateCmd{
|
||||||
|
@ -900,7 +900,11 @@ func (c *Config) Validate(force bool) error {
|
|||||||
|
|
||||||
// WithOpenStackProviderDefaults fills the default values for the specific OpenStack provider.
|
// WithOpenStackProviderDefaults fills the default values for the specific OpenStack provider.
|
||||||
// If the provider is not supported or not an OpenStack provider, the config is returned unchanged.
|
// If the provider is not supported or not an OpenStack provider, the config is returned unchanged.
|
||||||
func (c *Config) WithOpenStackProviderDefaults(openStackProvider string) *Config {
|
func (c *Config) WithOpenStackProviderDefaults(csp cloudprovider.Provider, openStackProvider string) *Config {
|
||||||
|
if csp != cloudprovider.OpenStack {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
c.Attestation.QEMUVTPM = &QEMUVTPM{Measurements: measurements.DefaultsFor(cloudprovider.OpenStack, variant.QEMUVTPM{})}
|
||||||
switch openStackProvider {
|
switch openStackProvider {
|
||||||
case "stackit":
|
case "stackit":
|
||||||
c.Provider.OpenStack.Cloud = "stackit"
|
c.Provider.OpenStack.Cloud = "stackit"
|
||||||
|
Loading…
Reference in New Issue
Block a user