Skip to content

Commit

Permalink
Use project name instead of project number in createIgmRef()
Browse files Browse the repository at this point in the history
  • Loading branch information
damikag committed Jul 4, 2024
1 parent 8971a29 commit 9bf2e24
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}

Expand Down

0 comments on commit 9bf2e24

Please sign in to comment.