Skip to content

Commit 55dfdd2

Browse files
Merge pull request GoogleCloudPlatform#2941 from acpana/acpana/export-temp-changes
dev:tools: add export changes
2 parents 7575dea + d73097b commit 55dfdd2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dev/tools/controllerbuilder/template/controller/controller.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,21 @@ func (a *{{.Kind}}Adapter) Export(ctx context.Context) (*unstructured.Unstructur
250250
if mapCtx.Err() != nil {
251251
return nil, mapCtx.Err()
252252
}
253-
// TODO(user): Update other resource reference
253+
// TODO(user): Update other resource references
254254
parent, err := a.id.Parent()
255255
if err != nil {
256256
return nil, err
257257
}
258-
obj.Spec.ProjectRef = &refs.ProjectRef{Name: parent.ProjectID}
258+
obj.Spec.ProjectRef = &refs.ProjectRef{External: parent.String()}
259259
obj.Spec.Location = parent.Location
260260
uObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj)
261261
if err != nil {
262262
return nil, err
263263
}
264+
265+
u.SetName(a.actual.Id)
266+
u.SetGroupVersionKind(krm.{{.Kind}}GVK)
267+
264268
u.Object = uObj
265269
return u, nil
266270
}

0 commit comments

Comments
 (0)