mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
22c912a56d
Signed-off-by: Fabian Kammel <fk@edgeless.systems>
20 lines
424 B
Go
20 lines
424 B
Go
package gcp
|
|
|
|
import (
|
|
"github.com/edgelesssys/constellation/internal/role"
|
|
)
|
|
|
|
const roleMetadataKey = "constellation-role"
|
|
|
|
// extractRole extracts role from cloud provider metadata.
|
|
func extractRole(metadata map[string]string) role.Role {
|
|
switch metadata[roleMetadataKey] {
|
|
case role.ControlPlane.String():
|
|
return role.ControlPlane
|
|
case role.Worker.String():
|
|
return role.Worker
|
|
default:
|
|
return role.Unknown
|
|
}
|
|
}
|