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

Fix namespace reconciliation error #105

Merged
merged 4 commits into from
Jun 9, 2022
Merged

Conversation

pglass
Copy link

@pglass pglass commented Jun 8, 2022

Changes proposed in this PR:

This fixes an error message in the acl-controller where it was attempting to use the empty string for the namespace when creating a namespace. When this error occurred while reconciling namespaces, the controller would abort reconciliation, which means it would not proceed to cleanup ACL tokens.

To address that, this also changes the controller to attempt to reconcile resources even if a namespace reconciliation error occurred.

How I've tested this PR:

Unit tests

How I expect reviewers to test this PR:

👀

Checklist:

  • Tests added
  • CHANGELOG entry added

@pglass pglass requested review from a team and cthain and removed request for a team June 8, 2022 22:15
@pglass pglass temporarily deployed to dockerhub/hashicorpdev June 8, 2022 22:16 Inactive
@pglass pglass temporarily deployed to dockerhub/hashicorpdev June 8, 2022 22:36 Inactive
@pglass pglass temporarily deployed to dockerhub/hashicorpdev June 8, 2022 22:42 Inactive
@pglass pglass force-pushed the pglass/fix-empty-ns-error branch from 50af51f to e577e10 Compare June 8, 2022 22:50
@pglass pglass temporarily deployed to dockerhub/hashicorpdev June 8, 2022 22:52 Inactive
if err = c.Resources.ReconcileNamespaces(resources); err != nil {
return fmt.Errorf("reconciling namespaces: %w", err)
c.Log.Error("error reconciling namespaces", "err", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if the log messages here are necessary since there is also a log message in ctrl.reconcile() 🤔 ?.. Any errors here will get logged twice.

Copy link
Author

Choose a reason for hiding this comment

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

I guess I was thinking I should log the error immediately, but now that I'm seeing this again, you're right. I'll remove these log lines!

@pglass pglass temporarily deployed to dockerhub/hashicorpdev June 9, 2022 16:12 Inactive
@pglass pglass merged commit 73108b7 into main Jun 9, 2022
@pglass pglass deleted the pglass/fix-empty-ns-error branch June 9, 2022 16:55
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.

2 participants