From a953df60b62996df10ed125d5671626a4ba8ca09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= Date: Fri, 6 May 2022 16:10:35 +0200 Subject: [PATCH] Rename in config: PCRs->Measurements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- cli/cloud/cloudcmd/validators.go | 4 ++-- cli/cloud/cloudcmd/validators_test.go | 4 ++-- internal/config/config.go | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cli/cloud/cloudcmd/validators.go b/cli/cloud/cloudcmd/validators.go index 259d5f6fe..ad70aadb6 100644 --- a/cli/cloud/cloudcmd/validators.go +++ b/cli/cloud/cloudcmd/validators.go @@ -68,13 +68,13 @@ func (v *Validators) updatePCR(pcrIndex uint32, encoded string) error { func (v *Validators) setPCRs(config *config.Config) error { switch v.provider { case cloudprovider.GCP: - gcpPCRs := *config.Provider.GCP.PCRs + gcpPCRs := *config.Provider.GCP.Measurements if err := v.checkPCRs(gcpPCRs); err != nil { return err } v.pcrs = gcpPCRs case cloudprovider.Azure: - azurePCRs := *config.Provider.Azure.PCRs + azurePCRs := *config.Provider.Azure.Measurements if err := v.checkPCRs(azurePCRs); err != nil { return err } diff --git a/cli/cloud/cloudcmd/validators_test.go b/cli/cloud/cloudcmd/validators_test.go index 2ea20d3e9..bc0a01044 100644 --- a/cli/cloud/cloudcmd/validators_test.go +++ b/cli/cloud/cloudcmd/validators_test.go @@ -68,10 +68,10 @@ func TestNewValidators(t *testing.T) { conf := &config.Config{Provider: &config.ProviderConfig{}} if tc.provider == cloudprovider.GCP { - conf.Provider.GCP = &config.GCPConfig{PCRs: &tc.pcrs} + conf.Provider.GCP = &config.GCPConfig{Measurements: &tc.pcrs} } if tc.provider == cloudprovider.Azure { - conf.Provider.Azure = &config.AzureConfig{PCRs: &tc.pcrs} + conf.Provider.Azure = &config.AzureConfig{Measurements: &tc.pcrs} } if tc.provider == cloudprovider.QEMU { conf.Provider.QEMU = &config.QEMUConfig{PCRs: &tc.pcrs} diff --git a/internal/config/config.go b/internal/config/config.go index 8d99aa0a3..9b03a9f62 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -148,7 +148,7 @@ func Default() *Config { }, }, }, - PCRs: pcrPtr(azurePCRs), + Measurements: pcrPtr(azurePCRs), UserAssignedIdentity: proto.String("/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/constellation-images/providers/Microsoft.ManagedIdentity/userAssignedIdentities/constellation-dev-identity"), }, GCP: &GCPConfig{ @@ -196,7 +196,7 @@ func Default() *Config { "roles/storage.admin", "roles/iam.serviceAccountUser", }, - PCRs: pcrPtr(gcpPCRs), + Measurements: pcrPtr(gcpPCRs), }, QEMU: &QEMUConfig{ PCRs: pcrPtr(qemuPCRs), @@ -241,7 +241,7 @@ type AzureConfig struct { Location *string `json:"location,omitempty"` // TODO: This will be user input Image *string `json:"image,omitempty"` NetworkSecurityGroupInput *azureClient.NetworkSecurityGroupInput `json:"networksecuritygroupinput,omitempty"` - PCRs *map[uint32][]byte `json:"pcrs,omitempty"` + Measurements *map[uint32][]byte `json:"measurements,omitempty"` UserAssignedIdentity *string `json:"userassignedidentity,omitempty"` } @@ -254,7 +254,7 @@ type GCPConfig struct { FirewallInput *gcpClient.FirewallInput `json:"firewallinput,omitempty"` VPCsInput *gcpClient.VPCsInput `json:"vpcsinput,omitempty"` ServiceAccountRoles *[]string `json:"serviceaccountroles,omitempty"` - PCRs *map[uint32][]byte `json:"pcrs,omitempty"` + Measurements *map[uint32][]byte `json:"measurements,omitempty"` } type QEMUConfig struct {