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

11 separate reconciler to consume zalando status and update into our postgres type #18

Conversation

eberlep
Copy link
Collaborator

@eberlep eberlep commented Dec 4, 2020

Implements #11

Copy link
Contributor

@LimKianAn LimKianAn left a comment

Choose a reason for hiding this comment

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

Matter of taste

log.Info("fetching postgresql")
instance := &zalando.Postgresql{}
if err := r.Client.Get(ctx, req.NamespacedName, instance); err != nil {
if !errors.IsNotFound(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just doube checked, and I will keep it the way it is so we can log a message that the object was deleted. If we just return, we can't do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought the returned err would contain the info of the object we wanted to fetch. If that's not the case, agreed.

controllers/status_controller.go Outdated Show resolved Hide resolved
break
}

if !ownerFound {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider var owner *pg.Postgres. Then we can evaluate if owner == nil and don't need an extra variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider
owner := &ps.Postgres{}
*owner = o

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now that we have a separate owner and o variable, we could indeed remove that bool. It doesn't hurt however, so I will keep it for now.

@LimKianAn LimKianAn merged commit 32b2ff9 into main Dec 7, 2020
@eberlep eberlep deleted the 11_separate_reconciler_to_consume_zalando_status_and_update_into_our_postgres_type branch December 7, 2020 14:37
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.

separate reconciler to consume zalando status and update into our postgres type
3 participants