-
Notifications
You must be signed in to change notification settings - Fork 0
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
added serveral endpoints #28
Conversation
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
8abff01
to
14e745c
Compare
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
Looks good @jasmingacic, all the endpoints seems to be in place. The fleets CRD endpoint is missing from description, but I've tested it on the server and it looks like it's working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small changes. Could you also go fmt
all of the code, please? 😁
Makefile
Outdated
@@ -9,3 +9,5 @@ run: | |||
|
|||
run-minikube: | |||
docker-compose -f docker-compose.yaml -f docker-compose-minikube.yaml up --build -d | |||
test: | |||
cd ./server && FAKE=true go test -v ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline
server/.openapi-generator-ignore
Outdated
go/Dockerfile | ||
Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline
@@ -25,20 +25,10 @@ go run main.go | |||
|
|||
To run the server in a docker container | |||
``` | |||
make build | |||
docker build --network=host -t openapi . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you put make build back, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the other make commands too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I was not aware of this. change :D
I will have it reverted
server/go/api.go
Outdated
// FleetsApiRouter defines the required methods for binding the api requests to a responses for the FleetsApi | ||
// The FleetsApiRouter implementation should parse necessary information from the http request, | ||
// pass the data to a FleetsApiServicer to perform the required actions, then write the service results to the http response. | ||
type FleetsApiRouter interface { | ||
type FleetsApiRouter interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this file been go fmt
'ed?
GetEnvoyFleet(http.ResponseWriter, *http.Request) | ||
GetEnvoyFleetCRD(http.ResponseWriter, *http.Request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns the CRD definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the object as is
@@ -14,26 +14,43 @@ import ( | |||
"net/http" | |||
"strings" | |||
|
|||
kusk "github.com/GIT_USER_ID/GIT_REPO_ID/kusk" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need an alias if the package is already kusk
?
// GetService - Get details for a single service | ||
func (s *ServicesApiService) GetService(ctx context.Context, namespace string, name string) (ImplResponse, error) { | ||
svc, err := s.kuskClient.GetSvc(namespace, name) | ||
if err != nil { | ||
return Response(http.StatusInternalServerError, err), err | ||
} | ||
|
||
port := ServicePortItem{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go fmt
|
||
// GetStaticRouteCRD - Get static route CRD | ||
func (s *StaticRoutesApiService) GetStaticRouteCRD(ctx context.Context, namespace string, name string) (ImplResponse, error) { | ||
staticRoute, err := s.kuskClient.GetStaticRoute(namespace, name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
staticRoute, err := s.kuskClient.GetStaticRoute(namespace, name)
Should this be called GetStaticRouteCRD(...)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. The only difference is that here we don't do any operations on fleet object we just return it at the end of the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im not sure I understand, the Service method is called GetStaticRouteCRD
but inside we call the kuskClient GetStaticRoute
? that's the correct behaviour?
server/go/routers.go
Outdated
@@ -216,4 +216,4 @@ func parseInt32ArrayParameter(param, delim string, required bool) ([]int32, erro | |||
} | |||
|
|||
return ints, nil | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
Added routes as requested:
http://147.75.33.177:8080/apis/default/noupstream/definition
http://147.75.33.177:8080/apis/default/noupstream/crd
http://147.75.33.177:8080/staticroutes
http://147.75.33.177:8080/staticroutes/default/todo-frontend/crd
http://147.75.33.177:8080/staticroutes/default/todo-frontend
Fixes kubeshop/kusk-gateway#281
Fixes kubeshop/kusk-gateway#278
Signed-off-by: Jasmin Gacic jasmin.gacic@gmail.com
@topliceanurazvan I got a little lost with all endpoints that need to be added. Can you review and point to which ones are missing?