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

Upgraded the dependent go modules #232

Merged
merged 15 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
working_directory: /go/pkg/mod/github.com/admiral
docker:
- image: circleci/golang:1.16
- image: circleci/golang:1.17
steps:
- checkout
- run:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
./run.sh "1.20.14" "1.12.2" "../out"
publish-github-release:
docker:
- image: circleci/golang:1.16
- image: circleci/golang:1.17
working_directory: /go/pkg/mod/github.com/admiral
steps:
- attach_workspace:
Expand Down
14 changes: 9 additions & 5 deletions admiral/pkg/apis/admiral/routes/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ package routes

import (
"bytes"
"context"
"encoding/json"
"io/ioutil"
"net/http/httptest"
"strings"
"testing"

"github.com/gorilla/mux"
"github.com/istio-ecosystem/admiral/admiral/pkg/clusters"
"github.com/istio-ecosystem/admiral/admiral/pkg/controller/common"
"github.com/istio-ecosystem/admiral/admiral/pkg/controller/istio"
"github.com/istio-ecosystem/admiral/admiral/pkg/controller/secret"
"github.com/stretchr/testify/assert"
"io/ioutil"
"istio.io/client-go/pkg/apis/networking/v1alpha3"
istiofake "istio.io/client-go/pkg/clientset/versioned/fake"
"net/http/httptest"
"strings"
"testing"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestReturnSuccessGET(t *testing.T) {
Expand Down Expand Up @@ -93,6 +96,7 @@ func TestGetClusters(t *testing.T) {
}

func TestGetServiceEntriesByCluster(t *testing.T) {
ctx := context.Background()
url := "https://admiral.com/cluster/cluster1/serviceentries"
opts := RouteOpts{
RemoteRegistry: clusters.NewRemoteRegistry(nil, common.AdmiralParams{}),
Expand Down Expand Up @@ -158,7 +162,7 @@ func TestGetServiceEntriesByCluster(t *testing.T) {
}
opts.RemoteRegistry = rr
if c.name == "success with service entry for cluster" {
fakeIstioClient.NetworkingV1alpha3().ServiceEntries("admiral-sync").Create(&v1alpha3.ServiceEntry{})
fakeIstioClient.NetworkingV1alpha3().ServiceEntries("admiral-sync").Create(ctx, &v1alpha3.ServiceEntry{}, v1.CreateOptions{})
}
opts.GetServiceEntriesByCluster(w, r)
resp := w.Result()
Expand Down
6 changes: 4 additions & 2 deletions admiral/pkg/apis/admiral/routes/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ func (opts *RouteOpts) GetServiceEntriesByCluster(w http.ResponseWriter, r *http
params := mux.Vars(r)
clusterName := strings.Trim(params["clustername"], " ")

var response []v1alpha3.ServiceEntry
var response []*v1alpha3.ServiceEntry

ctx := r.Context()

if clusterName != "" {

serviceEntriesByCluster, err := clusters.GetServiceEntriesByCluster(clusterName, opts.RemoteRegistry)
serviceEntriesByCluster, err := clusters.GetServiceEntriesByCluster(ctx, clusterName, opts.RemoteRegistry)

if err != nil {
log.Printf("API call get service entry by cluster failed for clustername %v with Error: %v", clusterName, err.Error())
Expand Down
1 change: 1 addition & 0 deletions admiral/pkg/apis/admiral/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 32 additions & 8 deletions admiral/pkg/client/clientset/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion admiral/pkg/client/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading