-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Refactoring SetupManager #948
Conversation
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.
lgtm otherwise, only the msg wording
controllers/gslb_controller_setup.go
Outdated
|
||
log.Info(). | ||
Str("gslb", gslb.Name). | ||
Msg("Creating new Gslb out of Ingress annotation") |
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: I know there was no change in this msg, but can we put here:
"Creating a new Gslb out of Ingress with 'k8gb.io/strategy' annotation" (we don't care about ingresses that don't have this annotation)
(k8gb.io/strategy
== strategyAnnotation
)
controllers/gslb_controller_setup.go
Outdated
|
||
if strategy == depresolver.FailoverStrategy { | ||
if len(result.PrimaryGeoTag) == 0 { | ||
return result, fmt.Errorf("%s strategy requires annotation", depresolver.FailoverStrategy) |
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.
This will print:
"failover strategy requires annotation" which is not very helpful imho
can we put here
"failover strategy requires annotation k8gb.io/primary-geotag to be also present on the Ingress resource"
(primaryGeoTagAnnotation
== k8gb.io/primary-geotag
)
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.
amended, thx
related to #932 The setup manager is quite complex. We are currently solving a bug related to the fact that changes in ingress also change the GSLB and can cause cycles #932. I am doing the necessary refactoring (code is better structured, but the functionality remains the same), to make it easier to make the necessary changes.. - split SetupWithManager and Reconciliation into two files - encapsulate createGslbFromIngress - simplify ingressHandler - extracting parse strategy func Signed-off-by: kuritka <kuritka@gmail.com>
560efef
to
ab09b46
Compare
Co-authored-by: Jirka Kremser <535866+jkremser@users.noreply.github.com> Signed-off-by: MichalK <kuritka@gmail.com>
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.
👍 thanks
related to #932
The setup manager is quite complex. We are currently solving a bug related to the fact that changes in ingress also change the GSLB and can cause cycles #932. I am doing the necessary refactoring (code is better structured, but the functionality remains the same), to make it easier to fix #932.
Signed-off-by: kuritka kuritka@gmail.com