Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release-1.28
Browse files Browse the repository at this point in the history
  • Loading branch information
k8s-release-robot committed Aug 8, 2023
2 parents 6d5bbea + f0dcf06 commit b47f20c
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.6
1.20.7
2 changes: 1 addition & 1 deletion build/build-image/cross/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.27.0-go1.20.6-bullseye.0
v1.27.0-go1.20.7-bullseye.0
4 changes: 2 additions & 2 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ readonly KUBE_RSYNC_PORT="${KUBE_RSYNC_PORT:-}"
readonly KUBE_CONTAINER_RSYNC_PORT=8730

# These are the default versions (image tags) for their respective base images.
readonly __default_distroless_iptables_version=v0.2.6
readonly __default_go_runner_version=v2.3.1-go1.20.6-bullseye.0
readonly __default_distroless_iptables_version=v0.2.7
readonly __default_go_runner_version=v2.3.1-go1.20.7-bullseye.0
readonly __default_setcap_version=bookworm-v1.0.0

# These are the base images for the Docker-wrapped binaries.
Expand Down
10 changes: 5 additions & 5 deletions build/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies:

# protoc
- name: "protoc"
version: 3.19.4
version: 23.4
refPaths:
- path: hack/lib/protoc.sh
match: PROTOC_VERSION=
Expand Down Expand Up @@ -114,7 +114,7 @@ dependencies:

# Golang
- name: "golang: upstream version"
version: 1.20.6
version: 1.20.7
refPaths:
- path: .go-version
- path: build/build-image/cross/VERSION
Expand All @@ -136,7 +136,7 @@ dependencies:
match: minimum_go_version=go([0-9]+\.[0-9]+)

- name: "registry.k8s.io/kube-cross: dependents"
version: v1.27.0-go1.20.6-bullseye.0
version: v1.27.0-go1.20.7-bullseye.0
refPaths:
- path: build/build-image/cross/VERSION

Expand All @@ -158,15 +158,15 @@ dependencies:
match: BASE_IMAGE_VERSION\?=

- name: "registry.k8s.io/distroless-iptables: dependents"
version: v0.2.6
version: v0.2.7
refPaths:
- path: build/common.sh
match: __default_distroless_iptables_version=
- path: test/utils/image/manifest.go
match: configs\[DistrolessIptables\] = Config{list\.BuildImageRegistry, "distroless-iptables", "v([0-9]+)\.([0-9]+)\.([0-9]+)"}

- name: "registry.k8s.io/go-runner: dependents"
version: v2.3.1-go1.20.6-bullseye.0
version: v2.3.1-go1.20.7-bullseye.0
refPaths:
- path: build/common.sh
match: __default_go_runner_version=
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set -o pipefail
KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
source "${KUBE_ROOT}/hack/lib/init.sh"

PROTOC_VERSION=3.19.4
PROTOC_VERSION=23.4

# Generates $1/api.pb.go from the protobuf file $1/api.proto
# and formats it correctly
Expand Down
2 changes: 1 addition & 1 deletion staging/publishing/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2570,4 +2570,4 @@ rules:
dir: staging/src/k8s.io/endpointslice
recursive-delete-patterns:
- '*/.gitattributes'
default-go-version: 1.20.6
default-go-version: 1.20.7
45 changes: 38 additions & 7 deletions test/e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/onsi/gomega"

v1 "k8s.io/api/core/v1"
discoveryv1 "k8s.io/api/discovery/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
Expand Down Expand Up @@ -420,20 +421,37 @@ func CheckTestingNSDeletedExcept(ctx context.Context, c clientset.Interface, ski
}

// WaitForServiceEndpointsNum waits until the amount of endpoints that implement service to expectNum.
// Some components use EndpointSlices other Endpoints, we must verify that both objects meet the requirements.
func WaitForServiceEndpointsNum(ctx context.Context, c clientset.Interface, namespace, serviceName string, expectNum int, interval, timeout time.Duration) error {
return wait.PollWithContext(ctx, interval, timeout, func(ctx context.Context) (bool, error) {
Logf("Waiting for amount of service:%s endpoints to be %d", serviceName, expectNum)
list, err := c.CoreV1().Endpoints(namespace).List(ctx, metav1.ListOptions{})
endpoint, err := c.CoreV1().Endpoints(namespace).Get(ctx, serviceName, metav1.GetOptions{})
if err != nil {
return false, err
Logf("Unexpected error trying to get Endpoints for %s : %v", serviceName, err)
return false, nil
}

for _, e := range list.Items {
if e.Name == serviceName && countEndpointsNum(&e) == expectNum {
return true, nil
}
if countEndpointsNum(endpoint) != expectNum {
Logf("Unexpected number of Endpoints, got %d, expected %d", countEndpointsNum(endpoint), expectNum)
return false, nil
}
return false, nil

esList, err := c.DiscoveryV1().EndpointSlices(namespace).List(ctx, metav1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s", discoveryv1.LabelServiceName, serviceName)})
if err != nil {
Logf("Unexpected error trying to get EndpointSlices for %s : %v", serviceName, err)
return false, nil
}

if len(esList.Items) == 0 {
Logf("Waiting for at least 1 EndpointSlice to exist")
return false, nil
}

if countEndpointsSlicesNum(esList) != expectNum {
Logf("Unexpected number of Endpoints on Slices, got %d, expected %d", countEndpointsSlicesNum(esList), expectNum)
return false, nil
}
return true, nil
})
}

Expand All @@ -445,6 +463,19 @@ func countEndpointsNum(e *v1.Endpoints) int {
return num
}

func countEndpointsSlicesNum(epList *discoveryv1.EndpointSliceList) int {
// EndpointSlices can contain the same address on multiple Slices
addresses := sets.Set[string]{}
for _, epSlice := range epList.Items {
for _, ep := range epSlice.Endpoints {
if len(ep.Addresses) > 0 {
addresses.Insert(ep.Addresses[0])
}
}
}
return addresses.Len()
}

// restclientConfig returns a config holds the information needed to build connection to kubernetes clusters.
func restclientConfig(kubeContext string) (*clientcmdapi.Config, error) {
Logf(">>> kubeConfig: %s", TestContext.KubeConfig)
Expand Down
2 changes: 1 addition & 1 deletion test/images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ REGISTRY ?= registry.k8s.io/e2e-test-images
GOARM ?= 7
DOCKER_CERT_BASE_PATH ?=
QEMUVERSION=v5.1.0-2
GOLANG_VERSION=1.20.6
GOLANG_VERSION=1.20.7
export

ifndef WHAT
Expand Down
2 changes: 1 addition & 1 deletion test/utils/image/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func initImageConfigs(list RegistryList) (map[ImageID]Config, map[ImageID]Config
configs[BusyBox] = Config{list.PromoterE2eRegistry, "busybox", "1.29-4"}
configs[CudaVectorAdd] = Config{list.PromoterE2eRegistry, "cuda-vector-add", "1.0"}
configs[CudaVectorAdd2] = Config{list.PromoterE2eRegistry, "cuda-vector-add", "2.3"}
configs[DistrolessIptables] = Config{list.BuildImageRegistry, "distroless-iptables", "v0.2.6"}
configs[DistrolessIptables] = Config{list.BuildImageRegistry, "distroless-iptables", "v0.2.7"}
configs[Etcd] = Config{list.GcEtcdRegistry, "etcd", "3.5.9-0"}
configs[Httpd] = Config{list.PromoterE2eRegistry, "httpd", "2.4.38-4"}
configs[HttpdNew] = Config{list.PromoterE2eRegistry, "httpd", "2.4.39-4"}
Expand Down

0 comments on commit b47f20c

Please sign in to comment.