From 28167f45d3647f3de444a690aeae814655934b2b Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:31:33 +0200 Subject: [PATCH] config: mark attestationconfigapi as unimplemented --- .../actions/constellation_create/action.yml | 1 - internal/config/gcp.go | 56 ++++++++++--------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/.github/actions/constellation_create/action.yml b/.github/actions/constellation_create/action.yml index 7e149fc18..d84505916 100644 --- a/.github/actions/constellation_create/action.yml +++ b/.github/actions/constellation_create/action.yml @@ -164,7 +164,6 @@ runs: shell: bash run: | echo "Creating cluster using config:" - cat constellation-conf.yaml sudo sh -c 'echo "127.0.0.1 license.confidential.cloud" >> /etc/hosts' || true - name: Constellation create (CLI) diff --git a/internal/config/gcp.go b/internal/config/gcp.go index 299af595f..c90342c73 100644 --- a/internal/config/gcp.go +++ b/internal/config/gcp.go @@ -72,35 +72,39 @@ func (c *GCPSEVSNP) getToMarshallLatestWithResolvedVersions() AttestationCfg { } // FetchAndSetLatestVersionNumbers fetches the latest version numbers from the configapi and sets them. -func (c *GCPSEVSNP) FetchAndSetLatestVersionNumbers(ctx context.Context, fetcher attestationconfigapi.Fetcher) error { - // Only talk to the API if at least one version number is set to latest. - if !(c.BootloaderVersion.WantLatest || c.TEEVersion.WantLatest || c.SNPVersion.WantLatest || c.MicrocodeVersion.WantLatest) { - return nil - } +func (c *GCPSEVSNP) FetchAndSetLatestVersionNumbers(_ context.Context, _ attestationconfigapi.Fetcher) error { + panic("not implemented") - versions, err := fetcher.FetchSEVSNPVersionLatest(ctx, variant.GCPSEVSNP{}) - if err != nil { - return fmt.Errorf("fetching latest TCB versions from configapi: %w", err) - } - // set number and keep isLatest flag - c.mergeWithLatestVersion(versions.SEVSNPVersion) - return nil + // TODO(msanft): Implement with https://dev.azure.com/Edgeless/Edgeless/_workitems/edit/4024 + + // // Only talk to the API if at least one version number is set to latest. + // if !(c.BootloaderVersion.WantLatest || c.TEEVersion.WantLatest || c.SNPVersion.WantLatest || c.MicrocodeVersion.WantLatest) { + // return nil + // } + + // versions, err := fetcher.FetchSEVSNPVersionLatest(ctx, variant.GCPSEVSNP{}) + // if err != nil { + // return fmt.Errorf("fetching latest TCB versions from configapi: %w", err) + // } + // // set number and keep isLatest flag + // c.mergeWithLatestVersion(versions.SEVSNPVersion) + // return nil } -func (c *GCPSEVSNP) mergeWithLatestVersion(latest attestationconfigapi.SEVSNPVersion) { - if c.BootloaderVersion.WantLatest { - c.BootloaderVersion.Value = latest.Bootloader - } - if c.TEEVersion.WantLatest { - c.TEEVersion.Value = latest.TEE - } - if c.SNPVersion.WantLatest { - c.SNPVersion.Value = latest.SNP - } - if c.MicrocodeVersion.WantLatest { - c.MicrocodeVersion.Value = latest.Microcode - } -} +// func (c *GCPSEVSNP) mergeWithLatestVersion(latest attestationconfigapi.SEVSNPVersion) { +// if c.BootloaderVersion.WantLatest { +// c.BootloaderVersion.Value = latest.Bootloader +// } +// if c.TEEVersion.WantLatest { +// c.TEEVersion.Value = latest.TEE +// } +// if c.SNPVersion.WantLatest { +// c.SNPVersion.Value = latest.SNP +// } +// if c.MicrocodeVersion.WantLatest { +// c.MicrocodeVersion.Value = latest.Microcode +// } +// } // GetVariant returns gcp-sev-es as the variant. func (GCPSEVES) GetVariant() variant.Variant {