Compare commits

..

2 Commits

Author SHA1 Message Date
Kevin Hannon
52eacaa577 e2e: support kind clusters (#1103) 2023-04-15 12:11:42 +00:00
pigletfly
4a14603c56 bump golang version to 1.19
Signed-off-by: pigletfly <wangbing.adam@gmail.com>
2023-04-14 12:47:29 +01:00
4 changed files with 15 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ on:
pull_request:
env:
GO_VERSION: "1.18"
GO_VERSION: "1.19"
jobs:
lint:

View File

@@ -1,7 +1,17 @@
# skaffold checks for kubectl context
# For minikube, docker-for-desktop and docker-desktop the context matches above names
# If one wants to use kind, kind gives context names based on the cluster-name
# But as of now they match the following syntax: kind-*
# The first check verifies that this is a kind kubernetes context
# Second check verifies the other ones
.PHONY: skaffold.validate
skaffold.validate: kubectl_context := $(shell kubectl config current-context)
skaffold.validate:
@if [[ ! "minikube,docker-for-desktop,docker-desktop" =~ .*"$(kubectl_context)".* ]]; then \
@if [[ "$(kubectl_context)" =~ .*"kind".* ]]; then \
true; \
elif [[ ! "minikube,docker-for-desktop,docker-desktop" =~ .*"$(kubectl_context)".* ]]; then \
echo current-context is [$(kubectl_context)]. Must be one of [minikube,docker-for-desktop,docker-desktop]; \
false; \
fi

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/virtual-kubelet/virtual-kubelet
go 1.17
go 1.19
require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1

View File

@@ -16,7 +16,7 @@ package api_test
import (
"context"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"testing"
@@ -125,7 +125,7 @@ func TestHandlePodMetricsResource(t *testing.T) {
assert.Equal(t, tc.expectedStatusCode, rr.Code)
if tc.expectedError != nil {
bodyBytes, err := ioutil.ReadAll(rr.Body)
bodyBytes, err := io.ReadAll(rr.Body)
require.NoError(t, err)
assert.Contains(t, string(bodyBytes), tc.expectedError.Error())
} else if tc.expectedStatusCode == http.StatusOK {