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

feat(diag) expose fallback objects #6159

Merged
merged 4 commits into from
Jun 11, 2024
Merged

feat(diag) expose fallback objects #6159

merged 4 commits into from
Jun 11, 2024

Conversation

rainest
Copy link
Contributor

@rainest rainest commented Jun 7, 2024

What this PR does / why we need it:

The bit requested in #6101 (comment)

Which issue this PR fixes:

Fix #5932

Special notes for your reviewer:

Nothing re #4473 as requested, and no tests at present, nor a fix for the bit that's broken per #5932 (comment), but putting something up given requested timeline.

Unfortunately didn't see the design edit on #5932, but this at least provides the piping needed to ship stuff to the diag server to try and reshape it into that.

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@rainest rainest force-pushed the feat/diag-fallback-more branch from e4bf51b to c4794fd Compare June 7, 2024 02:58
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 55.69620% with 70 lines in your changes missing coverage. Please review.

Project coverage is 69.7%. Comparing base (363a891) to head (981e3a1).
Report is 4 commits behind head on main.

Current head 981e3a1 differs from pull request most recent head f1e2352

Please upload reports for the commit f1e2352 to get more accurate results.

Files Patch % Lines
internal/diagnostics/mapping.go 0.0% 30 Missing ⚠️
internal/dataplane/kong_client.go 53.0% 20 Missing and 3 partials ⚠️
internal/dataplane/fallback/fallback.go 47.6% 11 Missing ⚠️
internal/diagnostics/server.go 82.3% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #6159     +/-   ##
=======================================
- Coverage   73.8%   69.7%   -4.2%     
=======================================
  Files        198     200      +2     
  Lines      19798   19885     +87     
=======================================
- Hits       14619   13865    -754     
- Misses      4197    5031    +834     
- Partials     982     989      +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@czeslavo
Copy link
Contributor

czeslavo commented Jun 7, 2024

We should make sure that no fallback objects are reported after we successfully push non-fallback configuration.

@czeslavo czeslavo force-pushed the feat/diag-fallback-more branch from c4794fd to fc34d70 Compare June 10, 2024 09:41
@rainest rainest force-pushed the feat/diag-fallback-more branch 4 times, most recently from acb9d78 to 3133007 Compare June 11, 2024 06:16
@rainest rainest marked this pull request as ready for review June 11, 2024 06:18
@rainest rainest requested a review from a team as a code owner June 11, 2024 06:18
@rainest
Copy link
Contributor Author

rainest commented Jun 11, 2024

Alright, so discarding all the hash stuff and separate problem endpoint,

$ curl -sv localhost:10256/debug/config/fallback | jq
{
  "objects": [
    {
      "resource": "configuration.konghq.com/KongPlugin",
      "namespace": "default",
      "name": "key-auth",
      "id": "52fd9412-56c9-4d09-94cf-55860e34e080",
      "status": "excluded",
      "cause": "configuration.konghq.com/KongPlugin:default/key-auth"
    },
    {
      "resource": "gateway.networking.k8s.io/HTTPRoute",
      "namespace": "default",
      "name": "httproute-testing2",
      "id": "dd336bc8-1978-4185-a819-293ac666f87b",
      "status": "excluded",
      "cause": "configuration.konghq.com/KongPlugin:default/key-auth"
    }
  ]
}

I'm not sure if there are currently or would ever be cases where we'd have a mix of excluded and backfilled objects--the code suggests we can only have one or the other for the current fallback state.

@rainest rainest requested review from czeslavo and pmalek June 11, 2024 06:20
feat(diag) rework fallback endpoint

wip: enable config dumps for isolated

wip: diag url for isolated

wip: poke the diag URL

wip: clear hash and test output

wip: remove fallback if clear

wip: remove separate problems endpoint
internal/dataplane/fallback/fallback.go Outdated Show resolved Hide resolved
internal/dataplane/fallback/fallback.go Outdated Show resolved Hide resolved
internal/dataplane/fallback/fallback.go Outdated Show resolved Hide resolved
internal/dataplane/kong_client.go Outdated Show resolved Hide resolved
internal/dataplane/kong_client.go Outdated Show resolved Hide resolved
@czeslavo czeslavo force-pushed the feat/diag-fallback-more branch from 3133007 to a353501 Compare June 11, 2024 13:38
@czeslavo
Copy link
Contributor

As a result of the review, I prepared a suggested changes set, but we agreed with @pmalek to merge it to feat/diag-fallback-more already to save time and review it as a whole in this PR.

internal/dataplane/fallback/fallback_meta.go Show resolved Hide resolved
internal/diagnostics/server.go Show resolved Hide resolved
@pmalek pmalek added this to the KIC v3.2.x milestone Jun 11, 2024
Copy link
Member

@programmer04 programmer04 left a comment

Choose a reason for hiding this comment

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

overall LGMT

@czeslavo czeslavo enabled auto-merge (squash) June 11, 2024 14:51
@czeslavo czeslavo merged commit e86807b into main Jun 11, 2024
38 checks passed
@czeslavo czeslavo deleted the feat/diag-fallback-more branch June 11, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose debug endpoints allowing inspection of the fallback configuration
4 participants