mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 06:16:08 -04:00
[node operator] GCP: use canonical references
This commit is contained in:
parent
51cf638361
commit
80ebfab164
9 changed files with 151 additions and 3 deletions
|
@ -14,6 +14,10 @@ func (c *Client) GetNodeImage(ctx context.Context, providerID string) (string, e
|
|||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
project, err = c.canonicalProjectID(ctx, project)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
instance, err := c.instanceAPI.Get(ctx, &computepb.GetInstanceRequest{
|
||||
Instance: instanceName,
|
||||
Project: project,
|
||||
|
@ -61,6 +65,10 @@ func (c *Client) GetScalingGroupID(ctx context.Context, providerID string) (stri
|
|||
if scalingGroupID == "" {
|
||||
return "", fmt.Errorf("instance %q has no created-by metadata", instanceName)
|
||||
}
|
||||
scalingGroupID, err = c.canonicalInstanceGroupID(ctx, scalingGroupID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return scalingGroupID, nil
|
||||
}
|
||||
|
||||
|
@ -70,6 +78,10 @@ func (c *Client) CreateNode(ctx context.Context, scalingGroupID string) (nodeNam
|
|||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
project, err = c.canonicalProjectID(ctx, project)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
instanceGroupManager, err := c.instanceGroupManagersAPI.Get(ctx, &computepb.GetInstanceGroupManagerRequest{
|
||||
InstanceGroupManager: instanceGroupName,
|
||||
Project: project,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue