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

Update mesh insights with DP versions #1372

Conversation

jewertow
Copy link
Contributor

@jewertow jewertow commented Jan 1, 2021

Issues resolved

Fix #1327

Implementation

This feature is backward compatible and works with dataplanes that don't support versions and count them as unknown versions.

Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
@jewertow jewertow requested a review from a team as a code owner January 1, 2021 20:22
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
@jewertow
Copy link
Contributor Author

jewertow commented Jan 2, 2021

I tested this feature locally with 3 different versions of Kuma DP: 1.0.1 (does not support versions), 1.0.4 and a version built from this branch (both support versions) and the resource /mesh-insights returned the following JSON:

{
 "total": 1,
 "items": [
  {
   "type": "MeshInsight",
   "name": "default",
   "creationTime": "2021-01-02T13:15:22.838483+01:00",
   "modificationTime": "2021-01-02T13:19:48.839805+01:00",
   "lastSync": "2021-01-02T12:19:48.839804Z",
   "dataplanes": {
    "total": 3,
    "online": 3
   },
   "policies": {
    "Dataplane": {
     "total": 3
    },
    "Secret": {
     "total": 1
    },
    "ServiceInsight": {
     "total": 1
    },
    "TrafficPermission": {
     "total": 1
    },
    "TrafficRoute": {
     "total": 1
    }
   },
   "dpVersions": {
    "kumaDp": {
     "1.0.0-rc2-119-g50e35395": {
      "total": 1,
      "online": 1
     },
     "1.0.4": {
      "total": 1,
      "online": 1
     },
     "unknown": {
      "total": 1,
      "online": 1
     }
    },
    "envoy": {
     "1.15.0": {
      "total": 2,
      "online": 2
     },
     "unknown": {
      "total": 1,
      "online": 1
     }
    }
   }
  }
 ],
 "next": null
}

Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz left a comment

Choose a reason for hiding this comment

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

looks solid! Could you write test for it in resyncer_test.go?

@jewertow
Copy link
Contributor Author

jewertow commented Jan 4, 2021

Yes, I could try to implement test for this feature.

Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
@jewertow
Copy link
Contributor Author

jewertow commented Jan 6, 2021

I added a test.

@jakubdyszkiewicz
Copy link
Contributor

Awesome, thanks!

@jakubdyszkiewicz jakubdyszkiewicz merged commit 6d8a862 into kumahq:master Jan 8, 2021
mergify bot pushed a commit that referenced this pull request Jan 8, 2021
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
(cherry picked from commit 6d8a862)
jakubdyszkiewicz pushed a commit that referenced this pull request Jan 8, 2021
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
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.

Update MeshInsights with DP versions
4 participants