Skip to content

Commit

Permalink
use known namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Manabu Mccloskey <[email protected]>
  • Loading branch information
nabuskey committed Nov 20, 2023
1 parent 11a9914 commit aff592b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/localbuild/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (e *EmbeddedInstallation) Install(ctx context.Context, req ctrl.Request, re
_ = appsv1.AddToScheme(sch)
if gvkObj, err := sch.New(gvk); err == nil {
if gotObj, ok := gvkObj.(client.Object); ok {
if err := cli.Get(ctx, types.NamespacedName{Namespace: obj.GetNamespace(), Name: obj.GetName()}, gotObj); err != nil {
if err := cli.Get(ctx, types.NamespacedName{Namespace: e.namespace, Name: obj.GetName()}, gotObj); err != nil {
if err = controllerutil.SetControllerReference(resource, obj, sc); err != nil {
log.Error(err, "Setting controller reference for deployment", obj.GetName(), obj)
return ctrl.Result{}, err
Expand Down Expand Up @@ -132,7 +132,7 @@ func (e *EmbeddedInstallation) Install(ctx context.Context, req ctrl.Request, re

for {
if gotObj, ok := gvkObj.(client.Object); ok {
if err := cli.Get(ctx, types.NamespacedName{Namespace: obj.GetNamespace(), Name: obj.GetName()}, gotObj); err != nil {
if err := cli.Get(ctx, types.NamespacedName{Namespace: e.namespace, Name: obj.GetName()}, gotObj); err != nil {
errCh <- err
return
}
Expand Down

0 comments on commit aff592b

Please sign in to comment.