Skip to content

Commit d73097b

Browse files
committed
dev:tools: add export changes
Signed-off-by: Alex Pana <[email protected]>
1 parent f0277a0 commit d73097b

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
@@ -254,17 +254,21 @@ func (a *Adapter) Export(ctx context.Context) (*unstructured.Unstructured, error
254254
if mapCtx.Err() != nil {
255255
return nil, mapCtx.Err()
256256
}
257-
// TODO(user): Update other resource reference
257+
// TODO(user): Update other resource references
258258
parent, err := a.id.Parent()
259259
if err != nil {
260260
return nil, err
261261
}
262-
obj.Spec.ProjectRef = &refs.ProjectRef{Name: parent.ProjectID}
262+
obj.Spec.ProjectRef = &refs.ProjectRef{External: parent.String()}
263263
obj.Spec.Location = parent.Location
264264
uObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj)
265265
if err != nil {
266266
return nil, err
267267
}
268+
269+
u.SetName(a.actual.Id)
270+
u.SetGroupVersionKind(krm.{{.Kind}}GVK)
271+
268272
u.Object = uObj
269273
return u, nil
270274
}

0 commit comments

Comments
 (0)