From af02541fefadbdb7fd6b02e82a85d86ffc0ee9c3 Mon Sep 17 00:00:00 2001 From: Damika Gamlath Date: Thu, 4 Jul 2024 15:09:02 +0000 Subject: [PATCH] Use project name instead of project number in createIgmRef() --- .../cloudprovider/gce/autoscaling_gce_client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go index dc5c43b402fa..dcad5a5b7445 100644 --- a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go +++ b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go @@ -405,11 +405,11 @@ func externalToInternalInstance(gceInstance *gce.Instance, loggingQuota *klogx.Q }, }, NumericId: gceInstance.Id, - Igm: createIgmRef(gceInstance, loggingQuota), + Igm: createIgmRef(gceInstance, ref.Project, loggingQuota), }, nil } -func createIgmRef(gceInstance *gce.Instance, loggingQuota *klogx.Quota) GceRef { +func createIgmRef(gceInstance *gce.Instance, project string, loggingQuota *klogx.Quota) GceRef { createdBy := "" for _, item := range gceInstance.Metadata.Items { if item.Key == "created-by" && item.Value != nil { @@ -425,6 +425,7 @@ func createIgmRef(gceInstance *gce.Instance, loggingQuota *klogx.Quota) GceRef { klogx.V(5).UpTo(loggingQuota).Infof("Unable to parse IGM for %v because of %v", gceInstance.SelfLink, err) return GceRef{} } + igmRef.Project = project return igmRef }