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(kuma-cp) add versions endpoint #1602

Merged
merged 4 commits into from
Feb 24, 2021

Conversation

bartsmykla
Copy link
Contributor

@bartsmykla bartsmykla commented Feb 23, 2021

Summary

Added /versions endpoint

The versions which are present in a json file, were taken from envoys included in every release starting from 1.0.0 by looking into Dockerfile of our image containing kuma-dp (i.e. https://github.com/kumahq/kuma/blob/1.0.0/tools/releases/dockerfiles/Dockerfile.kuma-dp#L2)

ref.

Documentation

Added `/versions/` API endpoint which will return the object with
supported versions of dependencies (currently supported versions
of envoy for kumaDPs)

Signed-off-by: Bart Smykla <[email protected]>
Signed-off-by: Bart Smykla <[email protected]>
@bartsmykla bartsmykla requested a review from a team as a code owner February 23, 2021 12:18
Copy link
Contributor

@nickolaev nickolaev left a comment

Choose a reason for hiding this comment

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

Hmm question would be, how to maintain this json "automagically" at every release?

Expect(data).ToNot(BeNil())
Expect(data.KumaDp).ToNot(BeNil())
Expect(data.KumaDp["1.0.8"]).ToNot(BeNil())
Expect(data.KumaDp["1.0.8"].Envoy).To(Equal("1.16.2"))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there is a need to check each and every entry ;) Maybe just first,middle,last?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm checking it as an additional layer for us to be sure we are presenting expected versions

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.

I'm pretty sure this won't work on prod. You need to embed this JSON into binary.

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.

it's probably better to just embed this into go as a string

As suggested by Jakub in the past form it wouldn't work as it has
to be compiled into kuma-cp binary

Signed-off-by: Bart Smykla <[email protected]>
@bartsmykla
Copy link
Contributor Author

@jakubdyszkiewicz as you suggested, embeded it

pkg/api-server/versions_ws.go Outdated Show resolved Hide resolved
Removed unnecessary error from function returning versions
endpoint handler

Signed-off-by: Bart Smykla <[email protected]>
@bartsmykla bartsmykla merged commit d419012 into kumahq:master Feb 24, 2021
@bartsmykla bartsmykla deleted the feat/versions-endpoint branch February 24, 2021 04:54
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.

3 participants