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 new events on published to Ingress in case of reconcile failures #130

Merged
merged 1 commit into from
Nov 9, 2023
Merged

add new events on published to Ingress in case of reconcile failures #130

merged 1 commit into from
Nov 9, 2023

Conversation

OliverMKing
Copy link
Collaborator

Description

Add some new events that are published to cx Ingresses utilizing App Routing when we fail to upsert resources needed for the Ingress to function. Provides significantly increased customer visibility.

We publish to the Ingress object instead of the NginxIngressController crd because

  • Ingress is the source of why these failures occur
  • NIC crd is out of scope for these errors. Something like the IngressBackend failing to upsert isn't necessarily the result of the NIC, it could be bad cx configuration on the Ingress. We don't want to spam NIC with events that aren't related to it. Makes sense to send events to the customer managed resource that is closest to the reason why something isn't working.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested locally

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 6804380187

  • 14 of 19 (73.68%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 76.97%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controller/keyvault/placeholder_pod.go 6 7 85.71%
pkg/controller/keyvault/ingress_secret_provider_class.go 1 3 33.33%
pkg/controller/osm/ingress_backend_reconciler.go 7 9 77.78%
Totals Coverage Status
Change from base Build 6803409995: -0.04%
Covered Lines: 2774
Relevant Lines: 3604

💛 - Coveralls

@@ -112,6 +112,9 @@ func (i *IngressSecretProviderClassReconciler) Reconcile(ctx context.Context, re
if ok {
logger.Info("reconciling secret provider class for ingress")
err = util.Upsert(ctx, i.client, spc)
if err != nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these are hard to unit test because it's hard to simulate what causes upsert errors (primarily admission webhooks / policy webhooks) with the fake client.

I think it's okay not to unit test for now because this is a pretty straightforward way of using native k8s code. we are just using the k8s packages to do their intended purposes

Copy link
Contributor

@davidgamero davidgamero left a comment

Choose a reason for hiding this comment

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

lgtm

@OliverMKing OliverMKing merged commit d972a1b into Azure:main Nov 9, 2023
6 of 7 checks passed
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.

5 participants