profiler: set parent field in create profile request
Change-Id: I1ce33acbb7c34c4f071c02f032b1d9ab8a524b74
Reviewed-on: https://code-review.googlesource.com/c/36610
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jianqiao Li <jianqiaoli@google.com>
Reviewed-by: Alexey Alexandrov <aalexand@google.com>
diff --git a/profiler/profiler.go b/profiler/profiler.go
index 4011606..01cd1ab 100644
--- a/profiler/profiler.go
+++ b/profiler/profiler.go
@@ -264,6 +264,7 @@
// increasing value, bounded by maxBackoff.
func (a *agent) createProfile(ctx context.Context) *pb.Profile {
req := pb.CreateProfileRequest{
+ Parent: "projects/" + a.deployment.ProjectId,
Deployment: a.deployment,
ProfileType: a.profileTypes,
}
diff --git a/profiler/profiler_test.go b/profiler/profiler_test.go
index 6fdad03..6b10008 100644
--- a/profiler/profiler_test.go
+++ b/profiler/profiler_test.go
@@ -95,6 +95,7 @@
a := createTestAgent(mpc)
p := &pb.Profile{Name: "test_profile"}
wantRequest := pb.CreateProfileRequest{
+ Parent: "projects/" + a.deployment.ProjectId,
Deployment: a.deployment,
ProfileType: a.profileTypes,
}