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

Fail sync if consul delete returns an error #365

Merged
merged 4 commits into from
Oct 23, 2020

Conversation

thisisnotashwin
Copy link
Contributor

@thisisnotashwin thisisnotashwin commented Oct 23, 2020

Changes proposed in this PR:

  • In case consul fails while attempting to delete a config entry, update the sync value to being failed. This can happen when there are other config entries that depend on the config entry being deleted. For example, a service-defaults entry being deleted before service-splitter/service-router/service-resolver entries that depend on the service-defaults.
  • Add Age column to CRD printer columns

How I've tested this PR: Deployed it in local cluster and viewed the changes. Wasn't sure what a failing test case would look like for this particular error so I would like some feedback on that. Maybe just a standalone test for service-defaults with service splitters? Most of the existing tests test every config entry but that assertion will probably not be the case here.

Checklist:

  • Tests added
  • CHANGELOG entry added (HashiCorp engineers only, community PRs should not add a changelog entry)

- In case consul fails while attempting to delete a config entry, for eg
  because it is in use, update the sync value to being failed.

- Add Age column to CRD printer columns
@thisisnotashwin thisisnotashwin requested review from lkysow, a team and ishustava and removed request for a team October 23, 2020 16:30
@@ -247,7 +248,7 @@ type ServiceResolverFailover struct {
ServiceSubset string `json:"serviceSubset,omitempty"`
// Namespace is the namespace to resolve the requested service from to form
// the failover group of instances. If empty the current namespace is used.
Namespace string `json:"namespaces,omitempty"`
Namespace string `json:"namespace,omitempty"`
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
Contributor

@kschoche kschoche left a comment

Choose a reason for hiding this comment

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

🔥

Copy link
Contributor

@ishustava ishustava 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!

controller/configentry_controller_test.go Outdated Show resolved Hide resolved
Co-authored-by: Iryna Shustava <ishustava@users.noreply.github.com>
@thisisnotashwin thisisnotashwin merged commit 1b515f4 into master Oct 23, 2020
@thisisnotashwin thisisnotashwin deleted the sync-fail-on-delete-failure branch October 23, 2020 21:48
ndhanushkodi pushed a commit to ndhanushkodi/consul-k8s that referenced this pull request Jul 9, 2021
Document envoy version requirements
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

4 participants