Skip to content

Commit bdfcbae

Browse files
Upgraded the dependent go modules (#232)
1 parent 1d0fe30 commit bdfcbae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1809
-1652
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
build:
88
working_directory: /go/pkg/mod/github.com/admiral
99
docker:
10-
- image: circleci/golang:1.16
10+
- image: circleci/golang:1.17
1111
steps:
1212
- checkout
1313
- run:
@@ -107,7 +107,7 @@ jobs:
107107
./run.sh "1.20.14" "1.12.2" "../out"
108108
publish-github-release:
109109
docker:
110-
- image: circleci/golang:1.16
110+
- image: circleci/golang:1.17
111111
working_directory: /go/pkg/mod/github.com/admiral
112112
steps:
113113
- attach_workspace:

admiral/pkg/apis/admiral/routes/handler_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@ package routes
22

33
import (
44
"bytes"
5+
"context"
56
"encoding/json"
7+
"io/ioutil"
8+
"net/http/httptest"
9+
"strings"
10+
"testing"
11+
612
"github.com/gorilla/mux"
713
"github.com/istio-ecosystem/admiral/admiral/pkg/clusters"
814
"github.com/istio-ecosystem/admiral/admiral/pkg/controller/common"
915
"github.com/istio-ecosystem/admiral/admiral/pkg/controller/istio"
1016
"github.com/istio-ecosystem/admiral/admiral/pkg/controller/secret"
1117
"github.com/stretchr/testify/assert"
12-
"io/ioutil"
1318
"istio.io/client-go/pkg/apis/networking/v1alpha3"
1419
istiofake "istio.io/client-go/pkg/clientset/versioned/fake"
15-
"net/http/httptest"
16-
"strings"
17-
"testing"
20+
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1821
)
1922

2023
func TestReturnSuccessGET(t *testing.T) {
@@ -93,6 +96,7 @@ func TestGetClusters(t *testing.T) {
9396
}
9497

9598
func TestGetServiceEntriesByCluster(t *testing.T) {
99+
ctx := context.Background()
96100
url := "https://admiral.com/cluster/cluster1/serviceentries"
97101
opts := RouteOpts{
98102
RemoteRegistry: clusters.NewRemoteRegistry(nil, common.AdmiralParams{}),
@@ -158,7 +162,7 @@ func TestGetServiceEntriesByCluster(t *testing.T) {
158162
}
159163
opts.RemoteRegistry = rr
160164
if c.name == "success with service entry for cluster" {
161-
fakeIstioClient.NetworkingV1alpha3().ServiceEntries("admiral-sync").Create(&v1alpha3.ServiceEntry{})
165+
fakeIstioClient.NetworkingV1alpha3().ServiceEntries("admiral-sync").Create(ctx, &v1alpha3.ServiceEntry{}, v1.CreateOptions{})
162166
}
163167
opts.GetServiceEntriesByCluster(w, r)
164168
resp := w.Result()

admiral/pkg/apis/admiral/routes/handlers.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,13 @@ func (opts *RouteOpts) GetServiceEntriesByCluster(w http.ResponseWriter, r *http
103103
params := mux.Vars(r)
104104
clusterName := strings.Trim(params["clustername"], " ")
105105

106-
var response []v1alpha3.ServiceEntry
106+
var response []*v1alpha3.ServiceEntry
107+
108+
ctx := r.Context()
107109

108110
if clusterName != "" {
109111

110-
serviceEntriesByCluster, err := clusters.GetServiceEntriesByCluster(clusterName, opts.RemoteRegistry)
112+
serviceEntriesByCluster, err := clusters.GetServiceEntriesByCluster(ctx, clusterName, opts.RemoteRegistry)
111113

112114
if err != nil {
113115
log.Printf("API call get service entry by cluster failed for clustername %v with Error: %v", clusterName, err.Error())

admiral/pkg/apis/admiral/v1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admiral/pkg/client/clientset/versioned/clientset.go

Lines changed: 33 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admiral/pkg/client/clientset/versioned/fake/clientset_generated.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admiral/pkg/client/clientset/versioned/fake/register.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admiral/pkg/client/clientset/versioned/typed/admiral/v1/admiral_client.go

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)