mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-07 14:32:17 -04:00
[node operator] Add GCP client
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
0618a000a7
commit
717570d00a
23 changed files with 2102 additions and 21 deletions
|
@ -0,0 +1,21 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
|
||||
)
|
||||
|
||||
// getMetadataByKey returns the value of the metadata key in the given metadata.
|
||||
func getMetadataByKey(metadata *computepb.Metadata, key string) string {
|
||||
if metadata == nil {
|
||||
return ""
|
||||
}
|
||||
for _, item := range metadata.Items {
|
||||
if item.Key == nil || item.Value == nil {
|
||||
continue
|
||||
}
|
||||
if *item.Key == key {
|
||||
return *item.Value
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue