Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
bumping knative.dev/hack 044c02b...9cc05a3:
  > 9cc05a3 Deprecate calling kubetest2 via kntest (# 230)
bumping knative.dev/serving 5e20e1e...e9425f8:
  > e9425f8 chore: remove v1alpha1 domainmapping (# 14275)
  > b3b793f Update net-gateway-api nightly (# 14280)
  > 89b4341 upgrade to latest dependencies (# 14277)
  > b5585ac Update net-certmanager nightly (# 14279)
  > 1d6701e upgrade to latest dependencies (# 14266)
  > 8e2aa70 Update net-gateway-api nightly (# 14272)
  > ec057c1 Update net-contour nightly (# 14271)
  > 38f9b47 Update net-istio nightly (# 14270)
  > b7e573d Update net-kourier nightly (# 14269)
  > 8d29085 Update net-certmanager nightly (# 14268)
  > becea87 Update net-kourier nightly (# 14261)
  > 2cb31ee Update community files (# 14259)
  > 59cb3d3 Update net-contour nightly (# 14264)
  > 4931532 Update net-certmanager nightly (# 14262)
bumping gomodules.xyz/jsonpatch/v2 93a4daf...13a9e4a:
  > 13a9e4a Merge pull request # 36 from howardjohn/v2/improvements
  > 62e0c90 Update repository config (# 33)
  > 6d5c3df Fully remove dead code
  > 0c26413 Update repository config (# 32)
  > 45186ed (hackily) remove inefficient optimization
  > e0f6c24 Fix known broken case
  > c616a48 Fix marshaling invalid chars
  > 2c05a51 Fix inputs with empty keys
  > 1f7eb13 Improve fuzz tests
  > 471fa30 Fix CI
  > 4844bbf Add fuzzing test
  > 87f8876 add benchmarks
  > a81e531 Go.mod for go 1.20
  > fc9e957 Update to Go 1.20
bumping knative.dev/eventing 29ac3ee...0e88db1:
  > 0e88db1 Switch to trigger.WithNewFilters() to set trigger filter (# 7188)
  > 9d2bcef Add kind e2e tests for Kubernetes v1.27.3 (# 7139)
  > 2b02cb4 Add OIDC Authentication feature flag (# 7183)
bumping knative.dev/client-pkg 38d2dc0...5abd129:
  > 5abd129 Update community files (# 116)
bumping knative.dev/networking ed0534b...4bfcc9f:
  > 4bfcc9f Network Config Changes (# 842)
  > 4901742 upgrade to latest dependencies (# 844)
bumping knative.dev/pkg 6519aff...4f651e0:
  > 4f651e0 Bump gomodules.xyz/jsonpatch/v2 from 2.2.0 to 2.3.0 (# 2789)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation committed Aug 21, 2023
1 parent 9676e46 commit 1c4ef3e
Show file tree
Hide file tree
Showing 25 changed files with 133 additions and 1,135 deletions.
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ require (
k8s.io/cli-runtime v0.25.2
k8s.io/client-go v0.26.5
k8s.io/code-generator v0.26.5
knative.dev/client-pkg v0.0.0-20230809014238-38d2dc0dd50a
knative.dev/eventing v0.38.1-0.20230815095940-29ac3eee64a4
knative.dev/hack v0.0.0-20230815012940-044c02b7a447
knative.dev/networking v0.0.0-20230815014240-ed0534b4ef83
knative.dev/pkg v0.0.0-20230815012542-6519affc772b
knative.dev/serving v0.38.1-0.20230815122740-5e20e1e82550
knative.dev/client-pkg v0.0.0-20230815131440-5abd12981b4b
knative.dev/eventing v0.38.1-0.20230817140443-0e88db169caa
knative.dev/hack v0.0.0-20230818155117-9cc05a31e8c0
knative.dev/networking v0.0.0-20230817140742-4bfcc9fb6012
knative.dev/pkg v0.0.0-20230815132840-4f651e092853
knative.dev/serving v0.38.1-0.20230818202718-e9425f8d5260
sigs.k8s.io/yaml v1.3.0
)

Expand Down Expand Up @@ -111,7 +111,7 @@ require (
golang.org/x/text v0.12.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.12.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/api v0.136.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
Expand Down
29 changes: 14 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
Expand Down Expand Up @@ -666,8 +665,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY=
gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY=
gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc=
gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
Expand Down Expand Up @@ -836,18 +835,18 @@ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+O
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/client-pkg v0.0.0-20230809014238-38d2dc0dd50a h1:h+8sIUP03mCGO8vYI4qwT1GD88824n73EpZS8IsihXw=
knative.dev/client-pkg v0.0.0-20230809014238-38d2dc0dd50a/go.mod h1:GRVZm1rKOy0lpPBGRM1ugK5joDbhXFEvULINHqPoA9U=
knative.dev/eventing v0.38.1-0.20230815095940-29ac3eee64a4 h1:619xUZrwrv3xuterMgF8qKXLTJm1MosKwuTLcG5HTOk=
knative.dev/eventing v0.38.1-0.20230815095940-29ac3eee64a4/go.mod h1:InEIckt+XICxXXYy2P4kqEJ4nMDXqI1iCUZ84vGDRbM=
knative.dev/hack v0.0.0-20230815012940-044c02b7a447 h1:Lr4O/WEyZHuUBFbqATYdQlfLXvhPUCluF4zlgRi59T4=
knative.dev/hack v0.0.0-20230815012940-044c02b7a447/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20230815014240-ed0534b4ef83 h1:F1tP5OIXfk2YX/0KE+8DyuFw8bNrWzQSWXRba6k/aVQ=
knative.dev/networking v0.0.0-20230815014240-ed0534b4ef83/go.mod h1:Ao0oO/s5ARZP2jllEoGWbLgpCb2nI4OCUutylpSyxpw=
knative.dev/pkg v0.0.0-20230815012542-6519affc772b h1:Gr7PGAgYAMvihhoF7fskqRLmqX/Mt+/su2t81KFpgRc=
knative.dev/pkg v0.0.0-20230815012542-6519affc772b/go.mod h1:D9D8LkOtlJBC09i+6nbTdZ5LAKsAbTJkkGGXEh2BPYI=
knative.dev/serving v0.38.1-0.20230815122740-5e20e1e82550 h1:0+LkICVjcTWTUWvhPddxhmvxttwpBdGx92msRoTQ1pM=
knative.dev/serving v0.38.1-0.20230815122740-5e20e1e82550/go.mod h1:XNvj91QrfYWMMLSVo42q6P4X6XtNeOUKIEM5dwMjgGA=
knative.dev/client-pkg v0.0.0-20230815131440-5abd12981b4b h1:Ln3mDUER89kC4sYHkCpoZVcwthGlMwjekQi2IdMH4vU=
knative.dev/client-pkg v0.0.0-20230815131440-5abd12981b4b/go.mod h1:GRVZm1rKOy0lpPBGRM1ugK5joDbhXFEvULINHqPoA9U=
knative.dev/eventing v0.38.1-0.20230817140443-0e88db169caa h1:3MfWkllIkRujrAty7BwhYIsyhIGcpStQwYX6ND5vmfM=
knative.dev/eventing v0.38.1-0.20230817140443-0e88db169caa/go.mod h1:InEIckt+XICxXXYy2P4kqEJ4nMDXqI1iCUZ84vGDRbM=
knative.dev/hack v0.0.0-20230818155117-9cc05a31e8c0 h1:n9YEGYuoj31pAkhGlNL+xTQAeXKYTLeMmIZLWA9fAeo=
knative.dev/hack v0.0.0-20230818155117-9cc05a31e8c0/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20230817140742-4bfcc9fb6012 h1:eaeZPgJzsJMnJaekbG8TYAfF/PUX8Xmdb8Oqnb+QO1k=
knative.dev/networking v0.0.0-20230817140742-4bfcc9fb6012/go.mod h1:iGxfnvUJ3gGqtKnoOXhLzNCZeGxVnH4xdClYuh5vB4o=
knative.dev/pkg v0.0.0-20230815132840-4f651e092853 h1:OyAYpXLa/jQWClFxRegCccGySyX2/1BVRtKaAWRE/xM=
knative.dev/pkg v0.0.0-20230815132840-4f651e092853/go.mod h1:Y5Tis5nMoapB9iTZywW20Qnv/7LBahrtHz9Sm6+l3LE=
knative.dev/serving v0.38.1-0.20230818202718-e9425f8d5260 h1:3lhCzzCQp+KHS5Ms+9YUw64iiZy0VSxWTmXNXdY4cZE=
knative.dev/serving v0.38.1-0.20230818202718-e9425f8d5260/go.mod h1:NV6PfPFIjLoDdm9sgo1ccvWG6owBZeQld/bNxWt/8D0=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
160 changes: 34 additions & 126 deletions vendor/gomodules.xyz/jsonpatch/v2/jsonpatch.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package jsonpatch

import (
"bytes"
"encoding/json"
"fmt"
"reflect"
Expand All @@ -24,21 +23,28 @@ func (j *Operation) Json() string {
}

func (j *Operation) MarshalJSON() ([]byte, error) {
var b bytes.Buffer
b.WriteString("{")
b.WriteString(fmt.Sprintf(`"op":"%s"`, j.Operation))
b.WriteString(fmt.Sprintf(`,"path":"%s"`, j.Path))
// Consider omitting Value for non-nullable operations.
if j.Value != nil || j.Operation == "replace" || j.Operation == "add" {
v, err := json.Marshal(j.Value)
if err != nil {
return nil, err
}
b.WriteString(`,"value":`)
b.Write(v)
}
b.WriteString("}")
return b.Bytes(), nil
// Ensure for add and replace we emit `value: null`
if j.Value == nil && (j.Operation == "replace" || j.Operation == "add") {
return json.Marshal(struct {
Operation string `json:"op"`
Path string `json:"path"`
Value interface{} `json:"value"`
}{
Operation: j.Operation,
Path: j.Path,
})
}
// otherwise just marshal normally. We cannot literally do json.Marshal(j) as it would be recursively
// calling this function.
return json.Marshal(struct {
Operation string `json:"op"`
Path string `json:"path"`
Value interface{} `json:"value,omitempty"`
}{
Operation: j.Operation,
Path: j.Path,
Value: j.Value,
})
}

type ByPath []Operation
Expand Down Expand Up @@ -149,9 +155,6 @@ func makePath(path string, newPart interface{}) string {
if path == "" {
return "/" + key
}
if strings.HasSuffix(path, "/") {
return path + key
}
return path + "/" + key
}

Expand Down Expand Up @@ -211,22 +214,18 @@ func handleValues(av, bv interface{}, p string, patch []Operation) ([]Operation,
}
case []interface{}:
bt := bv.([]interface{})
if isSimpleArray(at) && isSimpleArray(bt) {
patch = append(patch, compareEditDistance(at, bt, p)...)
} else {
n := min(len(at), len(bt))
for i := len(at) - 1; i >= n; i-- {
patch = append(patch, NewOperation("remove", makePath(p, i), nil))
}
for i := n; i < len(bt); i++ {
patch = append(patch, NewOperation("add", makePath(p, i), bt[i]))
}
for i := 0; i < n; i++ {
var err error
patch, err = handleValues(at[i], bt[i], makePath(p, i), patch)
if err != nil {
return nil, err
}
n := min(len(at), len(bt))
for i := len(at) - 1; i >= n; i-- {
patch = append(patch, NewOperation("remove", makePath(p, i), nil))
}
for i := n; i < len(bt); i++ {
patch = append(patch, NewOperation("add", makePath(p, i), bt[i]))
}
for i := 0; i < n; i++ {
var err error
patch, err = handleValues(at[i], bt[i], makePath(p, i), patch)
if err != nil {
return nil, err
}
}
default:
Expand All @@ -235,100 +234,9 @@ func handleValues(av, bv interface{}, p string, patch []Operation) ([]Operation,
return patch, nil
}

func isBasicType(a interface{}) bool {
switch a.(type) {
case string, float64, bool:
default:
return false
}
return true
}

func isSimpleArray(a []interface{}) bool {
for i := range a {
switch a[i].(type) {
case string, float64, bool:
default:
val := reflect.ValueOf(a[i])
if val.Kind() == reflect.Map {
for _, k := range val.MapKeys() {
av := val.MapIndex(k)
if av.Kind() == reflect.Ptr || av.Kind() == reflect.Interface {
if av.IsNil() {
continue
}
av = av.Elem()
}
if av.Kind() != reflect.String && av.Kind() != reflect.Float64 && av.Kind() != reflect.Bool {
return false
}
}
return true
}
return false
}
}
return true
}

// https://en.wikipedia.org/wiki/Wagner%E2%80%93Fischer_algorithm
// Adapted from https://github.com/texttheater/golang-levenshtein
func compareEditDistance(s, t []interface{}, p string) []Operation {
m := len(s)
n := len(t)

d := make([][]int, m+1)
for i := 0; i <= m; i++ {
d[i] = make([]int, n+1)
d[i][0] = i
}
for j := 0; j <= n; j++ {
d[0][j] = j
}

for j := 1; j <= n; j++ {
for i := 1; i <= m; i++ {
if reflect.DeepEqual(s[i-1], t[j-1]) {
d[i][j] = d[i-1][j-1] // no op required
} else {
del := d[i-1][j] + 1
add := d[i][j-1] + 1
rep := d[i-1][j-1] + 1
d[i][j] = min(rep, min(add, del))
}
}
}

return backtrace(s, t, p, m, n, d)
}

func min(x int, y int) int {
if y < x {
return y
}
return x
}

func backtrace(s, t []interface{}, p string, i int, j int, matrix [][]int) []Operation {
if i > 0 && matrix[i-1][j]+1 == matrix[i][j] {
op := NewOperation("remove", makePath(p, i-1), nil)
return append([]Operation{op}, backtrace(s, t, p, i-1, j, matrix)...)
}
if j > 0 && matrix[i][j-1]+1 == matrix[i][j] {
op := NewOperation("add", makePath(p, i), t[j-1])
return append([]Operation{op}, backtrace(s, t, p, i, j-1, matrix)...)
}
if i > 0 && j > 0 && matrix[i-1][j-1]+1 == matrix[i][j] {
if isBasicType(s[0]) {
op := NewOperation("replace", makePath(p, i-1), t[j-1])
return append([]Operation{op}, backtrace(s, t, p, i-1, j-1, matrix)...)
}

p2, _ := handleValues(s[i-1], t[j-1], makePath(p, i-1), []Operation{})
return append(p2, backtrace(s, t, p, i-1, j-1, matrix)...)
}
if i > 0 && j > 0 && matrix[i-1][j-1] == matrix[i][j] {
return backtrace(s, t, p, i-1, j-1, matrix)
}
return []Operation{}
}
4 changes: 4 additions & 0 deletions vendor/knative.dev/eventing/pkg/apis/feature/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func (e Flags) IsDisabledTransportEncryption() bool {
return e != nil && e[TransportEncryption] == Disabled
}

func (e Flags) IsOIDCAuthentication() bool {
return e != nil && e[OIDCAuthentication] == Enabled
}

func (e Flags) String() string {
return fmt.Sprintf("%+v", map[string]Flag(e))
}
Expand Down
1 change: 1 addition & 0 deletions vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ const (
NewTriggerFilters = "new-trigger-filters"
TransportEncryption = "transport-encryption"
EvenTypeAutoCreate = "eventtype-auto-create"
OIDCAuthentication = "authentication.oidc"
)
9 changes: 2 additions & 7 deletions vendor/knative.dev/hack/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

source "$(dirname "${BASH_SOURCE[0]:-$0}")/infra-library.sh"

readonly TEST_RESULT_FILE=/tmp/${REPO_NAME}-e2e-result

# Tear down the test resources.
function teardown_test_resources() {
header "Tearing down test environment"
Expand Down Expand Up @@ -133,6 +131,7 @@ E2E_SCRIPT=""
function initialize() {
local run_tests=0
local custom_flags=()
local extra_gcloud_flags=()
local parse_script_flags=0
E2E_SCRIPT="$(get_canonical_path "$0")"
local e2e_script_command=( "${E2E_SCRIPT}" "--run-tests" )
Expand Down Expand Up @@ -177,16 +176,12 @@ function initialize() {
shift
done

if [[ "${CLOUD_PROVIDER}" == "gke" ]]; then
custom_flags+=("--addons=NodeLocalDNS")
fi

readonly SKIP_DUMP_ON_FAILURE
readonly TEARDOWN
readonly CLOUD_PROVIDER

if (( ! run_tests )); then
create_test_cluster "${CLOUD_PROVIDER}" custom_flags e2e_script_command
create_test_cluster "${CLOUD_PROVIDER}" custom_flags extra_gcloud_flags e2e_script_command
else
setup_test_cluster
fi
Expand Down
41 changes: 31 additions & 10 deletions vendor/knative.dev/hack/infra-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function create_test_cluster() {
fi

case "$1" in
gke) create_gke_test_cluster "$2" "$3" "${4:-}" ;;
gke) create_gke_test_cluster "$2" "$3" "$4" "${5:-}" ;;
kind) create_kind_test_cluster "$2" "$3" "${4:-}" ;;
*) echo "unsupported provider: $1"; exit 1 ;;
esac
Expand All @@ -117,29 +117,50 @@ function create_kind_test_cluster() {
}

# Create a GKE test cluster with kubetest2 and run the test command.
# Parameters: $1 - custom flags defined in kntest
# $2 - test command to run after the cluster is created (optional)
# Parameters: $1 - custom flags defined in kubetest2
# $2 - custom flags to pass directly to gcloud
# $3 - test command to run after the cluster is created (optional)
function create_gke_test_cluster() {
local -n _custom_flags=$1
local -n _test_command=$2
local -n _extra_gcloud_flags=$2
local -n _test_command=$3

# We are disabling logs and metrics on Boskos Clusters by default as they are not used. Manually set ENABLE_GKE_TELEMETRY to true to enable telemetry
# and ENABLE_PREEMPTIBLE_NODES to true to create preemptible/spot VMs. VM Preemption is a rare event and shouldn't be distruptive given the fault tolerant nature of our tests.
local extra_gcloud_flags=""
if [[ "${ENABLE_GKE_TELEMETRY:-}" != "true" ]]; then
extra_gcloud_flags="${extra_gcloud_flags} --logging=NONE --monitoring=NONE"
_extra_gcloud_flags+=("--logging=NONE --monitoring=NONE")
fi

if [[ "${CLOUD_PROVIDER}" == "gke" ]]; then
extra_gcloud_flags+=("--addons=NodeLocalDNS")
fi

if [[ "${ENABLE_PREEMPTIBLE_NODES:-}" == "true" ]]; then
extra_gcloud_flags="${extra_gcloud_flags} --preemptible"
_extra_gcloud_flags+=("--preemptible")
fi

_extra_gcloud_flags+=("--quiet")
if ! command -v kubetest2 >/dev/null; then
tmpbin="$(mktemp -d)"
echo "kubetest2 not found, installing in temp path: ${tmpbin}"
GOBIN="$tmpbin" go install sigs.k8s.io/kubetest2/...@latest
export PATH="${tmpbin}:${PATH}"
fi
run_kntest kubetest2 gke "${_custom_flags[@]}" \
--test-command="${_test_command[*]}" \
--extra-gcloud-flags="${extra_gcloud_flags}"
if [[ ! " ${_custom_flags[*]} " =~ "--machine-type=" ]]; then
_custom_flags+=("--machine-type=e2-standard-4")
fi
kubetest2 gke "${_custom_flags[@]}" \
--rundir-in-artifacts \
--up \
--down \
--boskos-heartbeat-interval-seconds=20 \
--v=1 \
--network=e2e-network \
--boskos-acquire-timeout-seconds=1200 \
--region="${E2E_CLUSTER_REGION},us-east1,us-west1" \
--gcloud-extra-flags="${_extra_gcloud_flags[*]}" \
--retryable-error-patterns='.*does not have enough resources available to fulfill.*,.*only \\d+ nodes out of \\d+ have registered; this is likely due to Nodes failing to start correctly.*,.*All cluster resources were brought up.+ but: component .+ from endpoint .+ is unhealthy.*' \
--test=exec \
-- \
"${_test_command[@]}"
}
Loading

0 comments on commit 1c4ef3e

Please sign in to comment.