Skip to content
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

Refactoring SetupManager #948

Merged
merged 2 commits into from
Sep 6, 2022
Merged

Refactoring SetupManager #948

merged 2 commits into from
Sep 6, 2022

Conversation

kuritka
Copy link
Collaborator

@kuritka kuritka commented Sep 5, 2022

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.

  • split SetupWithManager and Reconciliation into two files
  • encapsulate createGslbFromIngress
  • simplify ingressHandler
  • extracting parse strategy func

Signed-off-by: kuritka kuritka@gmail.com

Copy link
Member

@jkremser jkremser left a 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


log.Info().
Str("gslb", gslb.Name).
Msg("Creating new Gslb out of Ingress annotation")
Copy link
Member

@jkremser jkremser Sep 5, 2022

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)


if strategy == depresolver.FailoverStrategy {
if len(result.PrimaryGeoTag) == 0 {
return result, fmt.Errorf("%s strategy requires annotation", depresolver.FailoverStrategy)
Copy link
Member

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)

Copy link
Collaborator Author

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>
Co-authored-by: Jirka Kremser <535866+jkremser@users.noreply.github.com>
Signed-off-by: MichalK <kuritka@gmail.com>
Copy link
Member

@jkremser jkremser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

@kuritka kuritka merged commit 68bb0c2 into master Sep 6, 2022
@kuritka kuritka deleted the refactor-setup branch September 6, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] GSLB is not updated when Ingress has change
2 participants