-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sotw add limitador reconcile #887
Sotw add limitador reconcile #887
Conversation
5a0e969
to
bbe6229
Compare
Since #909 got merged to add placeholders, do we want to add this change to https://github.com/Kuadrant/kuadrant-operator/blob/main/controllers/limitador_reconciler.go instead? Although this would mean that the reconcile code will be added to the workflow and the scope of this PR will be expanded to remove the logic in the kuadrant controller 🤔 |
@KevFan Yes, I can do that bit of the rename. The point about the removing the logic from the kuadrant controller being part of this PR is not need. There is no updating of the resources only creating. If both methods are in place, one will get the update first while the other will get a version out of date error. Which they both can handle. The PR for removing the work is already opened, #888. Once this would be merged that can be merged, (would require a rebase to pass test) |
This sets up the subscription for events on kuadrant and limitador resources. The reconcile only is preformed if the limitador resource does not exist. Signed-off-by: Jim Fitzpatrick <[email protected]>
Signed-off-by: Jim Fitzpatrick <[email protected]>
bbe6229
to
366be33
Compare
controllers/limitador_reconciler.go
Outdated
aobjs := lo.FilterMap(topology.Objects().Objects().Items(), func(item machinery.Object, _ int) (machinery.Object, bool) { | ||
if item.GroupVersionKind().Kind == v1beta1.LimitadorGroupKind.Kind { | ||
return item, true | ||
} | ||
return nil, false | ||
}) | ||
|
||
if len(aobjs) > 0 { | ||
logger.Info("limitador resource already exists, no need to create", "status", "skipping") | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: aobjs
being authorino objects? So this should be lobjs
instead? 🤔
aobjs := lo.FilterMap(topology.Objects().Objects().Items(), func(item machinery.Object, _ int) (machinery.Object, bool) { | |
if item.GroupVersionKind().Kind == v1beta1.LimitadorGroupKind.Kind { | |
return item, true | |
} | |
return nil, false | |
}) | |
if len(aobjs) > 0 { | |
logger.Info("limitador resource already exists, no need to create", "status", "skipping") | |
return nil | |
} | |
lobjs := lo.FilterMap(topology.Objects().Objects().Items(), func(item machinery.Object, _ int) (machinery.Object, bool) { | |
if item.GroupVersionKind().Kind == v1beta1.LimitadorGroupKind.Kind { | |
return item, true | |
} | |
return nil, false | |
}) | |
if len(lobjs) > 0 { | |
logger.Info("limitador resource already exists, no need to create", "status", "skipping") | |
return nil | |
} |
Signed-off-by: Jim Fitzpatrick <[email protected]>
Introduces the reconcile function for the limitador resource.