Skip to content

Commit 2f6f42c

Browse files
committed
chore: CR
Signed-off-by: Matthias Riegler <[email protected]>
1 parent b2d5090 commit 2f6f42c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

common/flagdproxy/flagdproxy.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,14 @@ func (f *FlagdProxyHandler) ensureFlagdProxyResource(ctx context.Context, obj cl
111111
return err
112112
}
113113

114-
// If the object exists but is not managed by OFO, return an error
115-
if !notFound && !common.IsManagedByOFO(old) {
116-
return fmt.Errorf("%s not managed by OFO", obj.GetName())
117-
}
118-
119114
// If the object is not found, we will create it
120115
if notFound {
121116
return f.Client.Create(ctx, obj)
122117
}
118+
// If the object exists but is not managed by OFO, return an error
119+
if !common.IsManagedByOFO(old) {
120+
return fmt.Errorf("%s not managed by OFO", obj.GetName())
121+
}
123122

124123
// If the object is found, update if necessary
125124
needsUpdate, err := specDiffers(obj, old)

0 commit comments

Comments
 (0)