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

Websocket logs endpoint for polling envoy fleet container logs #80

Merged
merged 19 commits into from
Nov 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
check for errors when adding to k8s runtime scheme
  • Loading branch information
Kyle Hodgetts committed Nov 3, 2022
commit 81b653874988a52c3cbac7ef9f454ed2a57b0443
12 changes: 9 additions & 3 deletions server/cmd/api-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,20 @@ func getConfig() (*rest.Config, error) {

return config, err
}

func getClient() (client.Client, error) {
scheme := runtime.NewScheme()
kuskv1.AddToScheme(scheme)
corev1.AddToScheme(scheme)
if err := kuskv1.AddToScheme(scheme); err != nil {
return nil, fmt.Errorf("unable to add kusk scheme: %w", err)
}

if err := corev1.AddToScheme(scheme); err != nil {
return nil, fmt.Errorf("unable to add core scheme: %w", err)
}

config, err := getConfig()
if err != nil {
return nil, err
return nil, fmt.Errorf("unable to get kubernetes config: %w", err)
}

return client.New(config, client.Options{Scheme: scheme})
Expand Down