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

Add and set Status Conditions 'Ready' in all resources #56

Merged
merged 4 commits into from
Mar 12, 2021

Conversation

ChunyiLyu
Copy link
Contributor

@ChunyiLyu ChunyiLyu commented Mar 12, 2021

Note to reviewers: remember to look at the commits in this PR and consider if they can be squashed

Summary Of Changes

  • Per feedback from All resources have a minimum status #43, add a status condition to indicate that the CR was successfully created or updated by the controllers.
  • Status condition 'Ready' looks like:
  conditions:
  - lastTransitionTime: "2021-02-23T20:52:21Z"
    status: "True"
    type: Ready
    reason: SuccessfulCreateOrUpdate
    message: ""
  • 'Ready' status condition is set for all resources: queues, vhost, users, vhost, policies, exchanges, and bindings
  • Extracted common error messages from controllers and created "controllers/common.go"

Additional Context

@ChunyiLyu ChunyiLyu requested a review from coro March 12, 2021 15:41
Copy link
Contributor

@coro coro left a comment

Choose a reason for hiding this comment

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

Looks great, and I really like the error & conditions extraction.

This has made me think even more about the fact that a lot of our resources are rather similar. In broad strokes, create/update operations involve a declare through rabbithole, and delete operations require a delete. They all have a method to convert from k8s API JSON to rabbithole.XXXSettings{}. A lot of the controller reconcile code is copied between the objects.

I've been wondering whether this is a sign that we should have a common reconcile function, and use interfaces to provide the object-specific behaviours (which aren't very many). But possibly a refactor for another time.

@ChunyiLyu ChunyiLyu merged commit 92c8e73 into main Mar 12, 2021
@ChunyiLyu ChunyiLyu deleted the statusconditions branch March 12, 2021 16:46
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.

None yet

2 participants