mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-06 08:15:48 -04:00
Use tags for UID and role parsing (#242)
* Apply tags to all applicable GCP resources * Move GCP UID and role from VM metadata to labels * Adjust Azure tags to be in line with GCP and AWS * Dont rely on resource name to find resources Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
c2814aeddb
commit
b35b74b772
34 changed files with 344 additions and 360 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/internal/cloud"
|
||||
"github.com/edgelesssys/constellation/v2/internal/role"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/grpc/test/bufconn"
|
||||
|
@ -22,8 +23,8 @@ import (
|
|||
|
||||
func TestIMDSClient(t *testing.T) {
|
||||
uidTags := []metadataTag{
|
||||
{Name: "constellation-uid", Value: "uid"},
|
||||
{Name: "role", Value: "worker"},
|
||||
{Name: cloud.TagUID, Value: "uid"},
|
||||
{Name: cloud.TagRole, Value: "worker"},
|
||||
}
|
||||
response := metadataResponse{
|
||||
Compute: metadataResponseCompute{
|
||||
|
@ -48,14 +49,14 @@ func TestIMDSClient(t *testing.T) {
|
|||
Compute: metadataResponseCompute{
|
||||
ResourceID: "resource-id",
|
||||
ResourceGroup: "resource-group",
|
||||
Tags: []metadataTag{{Name: "role", Value: "worker"}},
|
||||
Tags: []metadataTag{{Name: cloud.TagRole, Value: "worker"}},
|
||||
},
|
||||
}
|
||||
responseWithoutRole := metadataResponse{
|
||||
Compute: metadataResponseCompute{
|
||||
ResourceID: "resource-id",
|
||||
ResourceGroup: "resource-group",
|
||||
Tags: []metadataTag{{Name: "constellation-uid", Value: "uid"}},
|
||||
Tags: []metadataTag{{Name: cloud.TagUID, Value: "uid"}},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue