Skip to content

Commit b1eb7e0

Browse files
xvzfthisthat
andauthored
chore: update common/flagdproxy/flagdproxy.go
Co-authored-by: Giovanni Liva <[email protected]> Signed-off-by: Matthias Riegler <[email protected]>
1 parent 060bd8a commit b1eb7e0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

common/flagdproxy/flagdproxy.go

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

113-
// If the object exists but is not managed by OFO, return an error
114-
if !notFound && !common.IsManagedByOFO(old) {
115-
return fmt.Errorf("%s not managed by OFO", obj.GetName())
116-
}
117-
118113
// If the object is not found, we will create it
119114
if notFound {
120115
return f.Client.Create(ctx, obj)
121116
}
122-
117+
// If the object exists but is not managed by OFO, return an error
118+
if !common.IsManagedByOFO(old) {
119+
return fmt.Errorf("%s not managed by OFO", obj.GetName())
120+
}
123121
// If the object is found, update if necessary
124122
needsUpdate, err := specDiffers(obj, old)
125123
if err != nil {

0 commit comments

Comments
 (0)