Skip to content

Commit

Permalink
Upgraded the dependent go modules (#232) (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
shriramsharma authored and GitHub Enterprise committed Sep 28, 2022
1 parent 7f24b97 commit c06b5ee
Show file tree
Hide file tree
Showing 64 changed files with 2,215 additions and 2,003 deletions.
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
2 changes: 1 addition & 1 deletion Jenkinsfile.iks2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pipeline {

environment {
GO_INSTALL = "/go_install"
GO_VERSION = "1.13.5.linux-amd64"
GO_VERSION = "1.18.linux-amd64"
GOROOT = "${env.GO_INSTALL + '/go'}"
GOPRIVATE="github.intuit.com"
PATH = "${env.PATH + ':' + env.GOROOT + '/bin'}"
Expand Down
10 changes: 6 additions & 4 deletions admiral/pkg/apis/admiral/routes/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package routes

import (
"bytes"
"context"
"encoding/json"
"io/ioutil"
"net/http/httptest"
Expand All @@ -17,7 +18,7 @@ import (
"github.com/stretchr/testify/assert"
"istio.io/client-go/pkg/apis/networking/v1alpha3"
istiofake "istio.io/client-go/pkg/clientset/versioned/fake"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestReturnSuccessGET(t *testing.T) {
Expand Down Expand Up @@ -96,6 +97,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 @@ -161,7 +163,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{}, metaV1.CreateOptions{})
}
opts.GetServiceEntriesByCluster(w, r)
resp := w.Result()
Expand Down Expand Up @@ -233,14 +235,14 @@ func TestGetGlobalTrafficPolicyByIdentityAndEnv(t *testing.T) {
globalTrafficCache := &mockGlobalTrafficCache{
identityCache: map[string]*v1.GlobalTrafficPolicy{
"stage.testID": {
ObjectMeta: meta_v1.ObjectMeta{
ObjectMeta: metaV1.ObjectMeta{
Namespace: "stage-testns",
Name: "stage-testapp",
Labels: map[string]string{"identity": "testID", "admiral.io/env": "stage"},
},
},
"default.testID": {
ObjectMeta: meta_v1.ObjectMeta{
ObjectMeta: metaV1.ObjectMeta{
Namespace: "default-testns",
Name: "default-testapp",
Labels: map[string]string{"identity": "testID", "admiral.io/env": "stage"},
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.

41 changes: 33 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

0 comments on commit c06b5ee

Please sign in to comment.