Skip to content

Commit

Permalink
chore: update common/flagdproxy/flagdproxy.go
Browse files Browse the repository at this point in the history
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
Signed-off-by: Matthias Riegler <github@m4tbit.de>
  • Loading branch information
xvzf and thisthat authored Oct 15, 2024
1 parent 060bd8a commit b1eb7e0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions common/flagdproxy/flagdproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,14 @@ func (f *FlagdProxyHandler) ensureFlagdProxyResource(ctx context.Context, obj cl
return err
}

// If the object exists but is not managed by OFO, return an error
if !notFound && !common.IsManagedByOFO(old) {
return fmt.Errorf("%s not managed by OFO", obj.GetName())
}

// If the object is not found, we will create it
if notFound {
return f.Client.Create(ctx, obj)
}

// If the object exists but is not managed by OFO, return an error
if !common.IsManagedByOFO(old) {
return fmt.Errorf("%s not managed by OFO", obj.GetName())
}
// If the object is found, update if necessary
needsUpdate, err := specDiffers(obj, old)
if err != nil {
Expand Down

0 comments on commit b1eb7e0

Please sign in to comment.