Skip to content

Commit

Permalink
Merge branch 'master' into updating-images/tests/dockerfile.rhel-base…
Browse files Browse the repository at this point in the history
…images-to-mach-ocp-build-data-config
  • Loading branch information
jupierce authored Sep 3, 2020
2 parents 7850749 + f02ed80 commit 8b1950d
Show file tree
Hide file tree
Showing 61 changed files with 12,776 additions and 842 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,35 @@ will switch to vendoring origin-specific branches (e.g
carries that need to be considered in the context of
`openshift/kubernetes` rebases.

### Test annotation rules

Test annotation rules are used to label e2e tests so that they can be
filtered or skipped. For example, rules can be defined that match kube
e2e tests that are known to be incompatible with openshift and label
those tests to be skipped.

Maintenance of test annotation rules is split between the
`openshift/kubernetes` and `origin` repos to ensure that PRs proposed
to `openshift/kubernetes` can be validated against the set of kube e2e
tests known to be compatible with openshift.

Test annotation rules for kubernetes e2e tests are maintained in:

https://github.com/openshift/kubernetes/blob/master/openshift-hack/e2e/annotate/rules.go

Test annotation rules for openshift e2e tests are maintained in:

https://github.com/openshift/origin/blob/master/test/extended/util/annotate/rules.go

Origin vendors the kube rules and applies both the kube and openshift
rules to the set of tests included in the `openshift-tests` binary.

In order to update test annotation rules for kube e2e tests, it will
be necessary to:

- Update `rules.go` in `openshift/kubernetes`
- Bump the version of `openshift/kubernetes` vendored in origin

### Vendoring from `openshift/kubernetes`

These origin branches vendor `k8s.io/kubernetes` and some of its
Expand Down
5 changes: 4 additions & 1 deletion cmd/openshift-tests/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/openshift/origin/pkg/test/ginkgo"
"github.com/openshift/origin/test/e2e/upgrade"
"github.com/openshift/origin/test/extended/util/disruption/controlplane"
)

// upgradeSuites are all known upgade test suites this binary should run
Expand All @@ -39,7 +40,9 @@ var upgradeSuites = []*ginkgo.TestSuite{
return strings.Contains(name, "[Feature:ClusterUpgrade]") && strings.Contains(name, "[Suite:openshift]")
},
Init: func(opt map[string]string) error {
return upgradeInitArguments(opt, func(name string) bool { return name == "control-plane-available" })
return upgradeInitArguments(opt, func(name string) bool {
return name == controlplane.NewKubeAvailableTest().Name() || name == controlplane.NewKubeAvailableTest().Name()
})
},
TestTimeout: 240 * time.Minute,
},
Expand Down
19 changes: 10 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ require (
github.com/google/go-cmp v0.4.0
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-querystring v0.0.0-00010101000000-000000000000 // indirect
github.com/google/uuid v1.1.1
github.com/gorilla/context v0.0.0-00010101000000-000000000000 // indirect
github.com/heketi/tests v0.0.0-00010101000000-000000000000 // indirect
github.com/lestrrat-go/jspointer v0.0.0-20181205001929-82fadba7561c // indirect
Expand All @@ -30,11 +31,11 @@ require (
github.com/lestrrat/go-jsschema v0.0.0-20181205002244-5c81c58ffcc3
github.com/lpabon/godbc v0.0.0-00010101000000-000000000000 // indirect
github.com/mohae/deepcopy v0.0.0-00010101000000-000000000000 // indirect
github.com/onsi/ginkgo v1.11.0
github.com/onsi/ginkgo v4.5.0-origin.1+incompatible
github.com/onsi/gomega v1.7.0
github.com/opencontainers/go-digest v1.0.0-rc1
github.com/openshift/api v0.0.0-20200722204502-c33fd0aa6ffa
github.com/openshift/apiserver-library-go v0.0.0-20200722231130-01c5eee5e10b
github.com/openshift/apiserver-library-go v0.0.0-20200723181026-dd21ec96ba0a
github.com/openshift/build-machinery-go v0.0.0-20200713135615-1f43d26dccc7
github.com/openshift/client-go v0.0.0-20200722173614-5a1b0aaeff15
github.com/openshift/library-go v0.0.0-20200722204747-e3f2c82ff290
Expand Down Expand Up @@ -386,7 +387,7 @@ replace (
golang.org/x/perf => golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852
golang.org/x/sync => golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13
golang.org/x/text => golang.org/x/text v0.3.2
golang.org/x/text => golang.org/x/text v0.3.3
golang.org/x/time => golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13
golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
Expand Down Expand Up @@ -419,10 +420,10 @@ replace (
k8s.io/api => k8s.io/api v0.19.0-rc.2
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.0-rc.2
k8s.io/apimachinery => k8s.io/apimachinery v0.19.0-rc.2
k8s.io/apiserver => github.com/openshift/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20200803060402-d32435439579
k8s.io/apiserver => github.com/openshift/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20200826132615-f71a7ab366cf
k8s.io/cli-runtime => k8s.io/cli-runtime v0.19.0-rc.2
k8s.io/client-go => github.com/openshift/kubernetes/staging/src/k8s.io/client-go v0.0.0-20200803060402-d32435439579
k8s.io/cloud-provider => github.com/openshift/kubernetes/staging/src/k8s.io/cloud-provider v0.0.0-20200803060402-d32435439579
k8s.io/client-go => github.com/openshift/kubernetes/staging/src/k8s.io/client-go v0.0.0-20200826132615-f71a7ab366cf
k8s.io/cloud-provider => github.com/openshift/kubernetes/staging/src/k8s.io/cloud-provider v0.0.0-20200826132615-f71a7ab366cf
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.19.0-rc.2
k8s.io/code-generator => k8s.io/code-generator v0.19.0-rc.2
k8s.io/component-base => k8s.io/component-base v0.19.0-rc.2
Expand All @@ -431,14 +432,14 @@ replace (
k8s.io/gengo => k8s.io/gengo v0.0.0-20200114144118-36b2048a9120
k8s.io/heapster => k8s.io/heapster v1.2.0-beta.1
k8s.io/klog => k8s.io/klog v1.0.0
k8s.io/kube-aggregator => github.com/openshift/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20200803060402-d32435439579
k8s.io/kube-aggregator => github.com/openshift/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20200826132615-f71a7ab366cf
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.19.0-rc.2
k8s.io/kube-proxy => k8s.io/kube-proxy v0.19.0-rc.2
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.19.0-rc.2
k8s.io/kubectl => k8s.io/kubectl v0.19.0-rc.2
k8s.io/kubelet => k8s.io/kubelet v0.19.0-rc.2
k8s.io/kubernetes => github.com/openshift/kubernetes v1.20.0-alpha.0.0.20200803060402-d32435439579
k8s.io/legacy-cloud-providers => github.com/openshift/kubernetes/staging/src/k8s.io/legacy-cloud-providers v0.0.0-20200803060402-d32435439579
k8s.io/kubernetes => github.com/openshift/kubernetes v1.20.0-alpha.0.0.20200826132615-f71a7ab366cf
k8s.io/legacy-cloud-providers => github.com/openshift/kubernetes/staging/src/k8s.io/legacy-cloud-providers v0.0.0-20200826132615-f71a7ab366cf
k8s.io/metrics => k8s.io/metrics v0.19.0-rc.2
k8s.io/repo-infra => k8s.io/repo-infra v0.0.1-alpha.1
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.0-rc.2
Expand Down
32 changes: 16 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -428,26 +428,26 @@ github.com/opencontainers/selinux v1.5.2/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwy
github.com/openshift/api v0.0.0-20200722170803-0ba2c3658da6/go.mod h1:IXsT3F4NjLtRzfnQvwU+g/oPWpoNsVV5vd5aaOMO8eU=
github.com/openshift/api v0.0.0-20200722204502-c33fd0aa6ffa h1:Ty11UANoi60q8bnaA/XHornmFFzRDkYHwWE2fQMNzqQ=
github.com/openshift/api v0.0.0-20200722204502-c33fd0aa6ffa/go.mod h1:IXsT3F4NjLtRzfnQvwU+g/oPWpoNsVV5vd5aaOMO8eU=
github.com/openshift/apiserver-library-go v0.0.0-20200722231130-01c5eee5e10b h1:vNXXR0IaFvYhuEXROIZZLT1yKTpheMDn8YVmjXtKjOo=
github.com/openshift/apiserver-library-go v0.0.0-20200722231130-01c5eee5e10b/go.mod h1:Mfg9VY4GCU3I7Fu9BXonA9Bx0MnK8NdUSXJ9rECVMs0=
github.com/openshift/apiserver-library-go v0.0.0-20200723181026-dd21ec96ba0a h1:5jNauFKxYwStYVdLRY+Oy+hS/8h1wioW5RYaIWXFpC8=
github.com/openshift/apiserver-library-go v0.0.0-20200723181026-dd21ec96ba0a/go.mod h1://gQP1LMTExUTcFCgJdKHY23UVHhkaQILXsTdVz0Qok=
github.com/openshift/build-machinery-go v0.0.0-20200713135615-1f43d26dccc7 h1:iP7TOaN+tEVNUQ0ODEbN1ukjLz918lsIt7Czf8giWlM=
github.com/openshift/build-machinery-go v0.0.0-20200713135615-1f43d26dccc7/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
github.com/openshift/client-go v0.0.0-20200722173614-5a1b0aaeff15 h1:b2QkHrmaYtY6kzy2VrYLc+KBmCuTpJjgvBahPqpt6V0=
github.com/openshift/client-go v0.0.0-20200722173614-5a1b0aaeff15/go.mod h1:yd4Zpcdk+8JyMWi6v+h78jPqK0FvXbJY41Wq3SZxl+c=
github.com/openshift/golang-glog v0.0.0-20190322123450-3c92600d7533 h1:A5VovyRu3JFIPmC20HHrsOOny0PIdHuzDdNMULru48k=
github.com/openshift/golang-glog v0.0.0-20190322123450-3c92600d7533/go.mod h1:3sa6LKKRDnR1xy4Kn8htvPwqIOVwXh8fIU3LRY22q3U=
github.com/openshift/kubernetes v1.20.0-alpha.0.0.20200803060402-d32435439579 h1:ZR3W1ucbbvnKLXJa2XJcIWD46BgVFCBgQp1ylRfSh2o=
github.com/openshift/kubernetes v1.20.0-alpha.0.0.20200803060402-d32435439579/go.mod h1:CocnRx4YBHt4EM7L4iUYMeVYdZgyOcsLiR9j12Bh2VA=
github.com/openshift/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20200803060402-d32435439579 h1:w3NiU6RpydQzBmGj/RQXBMdAcTr9CZrY4eeWpsc4WFo=
github.com/openshift/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20200803060402-d32435439579/go.mod h1:+byIt/wuDt8WgIusF3aWdyun5O4cIvIHPiQWUZTjUiE=
github.com/openshift/kubernetes/staging/src/k8s.io/client-go v0.0.0-20200803060402-d32435439579 h1:MeMXPKhxhCtnQVz88TyU6xOmnpV5Vy1lSuExjIYTq+8=
github.com/openshift/kubernetes/staging/src/k8s.io/client-go v0.0.0-20200803060402-d32435439579/go.mod h1:l5+662plwhIL4vDAeaySrk6peI36J0lKKSOtc1cHTO4=
github.com/openshift/kubernetes/staging/src/k8s.io/cloud-provider v0.0.0-20200803060402-d32435439579 h1:bOUbz+UcfsIvRJA8aOYefB4kjUvEqN7frmhNDXjIduQ=
github.com/openshift/kubernetes/staging/src/k8s.io/cloud-provider v0.0.0-20200803060402-d32435439579/go.mod h1:+7rIJYlH+r3D4eWt4HVRk52OcWNLyFDIi0uT5DdivUQ=
github.com/openshift/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20200803060402-d32435439579 h1:dAQitjT7Z0epj09lRnuPgJmcnveN4xZX44S8lD4J7nQ=
github.com/openshift/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20200803060402-d32435439579/go.mod h1:Fgq/XF/OXIjTpvL79ZjF1h/cXPVUFAxocIQDGRfoQYw=
github.com/openshift/kubernetes/staging/src/k8s.io/legacy-cloud-providers v0.0.0-20200803060402-d32435439579 h1:8Nq+512XQ4TMOFZP2PVfj0OsWVPNq1F9lRPebSNWGeU=
github.com/openshift/kubernetes/staging/src/k8s.io/legacy-cloud-providers v0.0.0-20200803060402-d32435439579/go.mod h1:V29rgRnfGKqV/Igb/rcTI+h7Xt22XoO914odfbs03ik=
github.com/openshift/kubernetes v1.20.0-alpha.0.0.20200826132615-f71a7ab366cf h1:ZN/QjGb0pIrsNQYpBTEveZzFoPqv7P26JB/nsKzZ6n4=
github.com/openshift/kubernetes v1.20.0-alpha.0.0.20200826132615-f71a7ab366cf/go.mod h1:aJkJxeDTYuttw+MRc5T2zhDsP24ZhZmpGmc+jmdz7w0=
github.com/openshift/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20200826132615-f71a7ab366cf h1:N8rG0zKTjJRuTO0UfQDXaxaBEtLTULxncmcgBScaWgI=
github.com/openshift/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20200826132615-f71a7ab366cf/go.mod h1:q9rHEv1UltcR8OSRYNAJOOiS8HrCX9U7I2RacSAr4XM=
github.com/openshift/kubernetes/staging/src/k8s.io/client-go v0.0.0-20200826132615-f71a7ab366cf h1:5JYxm4t7jUPEoLiFViiqcPujntSOztnOSuGybRItBOU=
github.com/openshift/kubernetes/staging/src/k8s.io/client-go v0.0.0-20200826132615-f71a7ab366cf/go.mod h1:+D+tDV3iwgbrqITjgufYYBkYVIfzD564qL10LbnKzgM=
github.com/openshift/kubernetes/staging/src/k8s.io/cloud-provider v0.0.0-20200826132615-f71a7ab366cf h1:dKA2Rmv4nZJphas3gtH8W98+ZRMrFrZjKkMj+Ucj/gk=
github.com/openshift/kubernetes/staging/src/k8s.io/cloud-provider v0.0.0-20200826132615-f71a7ab366cf/go.mod h1:vx/reZx/iefWuS3A7hRi4cwoptpCkVhqqITKpUsIkWs=
github.com/openshift/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20200826132615-f71a7ab366cf h1:A30pBAUeL4ogH6sAamr346lPGvNybGo/2YO/POhHPc4=
github.com/openshift/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20200826132615-f71a7ab366cf/go.mod h1:MUq2YTU8mwp7qYhM8Gu95ZSBOIp2+OyDSY7dOeHgCTA=
github.com/openshift/kubernetes/staging/src/k8s.io/legacy-cloud-providers v0.0.0-20200826132615-f71a7ab366cf h1:6WYK5JAFYXehPZbVkkkSqeibs7clN3mRHZmiXG+K79w=
github.com/openshift/kubernetes/staging/src/k8s.io/legacy-cloud-providers v0.0.0-20200826132615-f71a7ab366cf/go.mod h1:kUaainILK6Zy9oE3FRx+pp7y5+eTb73H3Z4oEmzaxQ8=
github.com/openshift/library-go v0.0.0-20200722204747-e3f2c82ff290 h1:x2MMkmR0gr+3UazejQcIafWCXh8d0W+6EWTtWLyGBnQ=
github.com/openshift/library-go v0.0.0-20200722204747-e3f2c82ff290/go.mod h1:/gVyoY2dl35bcCCgs+36UmGt6n/kn3f64hfDduujQ1c=
github.com/openshift/onsi-ginkgo v4.5.0-origin.1+incompatible h1:GtzyDU5vBFU40hz4GWd1qU5FJByNljWdgkM2LtdelGk=
Expand Down Expand Up @@ -600,8 +600,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A=
Expand Down
10 changes: 2 additions & 8 deletions hack/update-kube-vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ echo "Updating vendoring for ${UPSTREAM_REPO}"
go mod edit -replace "${UPSTREAM_REPO}=${REPO_REPLACEMENT}@${SHA}"
go mod tidy

VERSION="$(grep 'k8s.io/kubernetes =>' go.mod | awk '{print $4}')"
echo "Using version ${VERSION}"

echo "Updating vendoring for the staging repos of ${UPSTREAM_REPO}"
TARGET_DEPS="$( grep 'staging/src/k8s.io' go.mod | awk '{print $1}' )"
for TARGET_DEP in ${TARGET_DEPS}; do
# The version discovered for k8s.io/kubernetes will be the same for
# all the staging repos. Using sed to apply that version to the
# staging repos is much faster than running `go mod edit -replace &&
# go mod tidy` for each repo.
sed -i -e 's+\(\s'"${TARGET_DEP}"' => \).*+\1'"${REPO_REPLACEMENT}/staging/src/${TARGET_DEP} ${VERSION}"'+' go.mod
go mod edit -replace "${TARGET_DEP}=${REPO_REPLACEMENT}/staging/src/${TARGET_DEP}@${SHA}"
go mod tidy
done

go mod tidy
Expand Down
1 change: 1 addition & 0 deletions test/e2e/upgrade/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (t *UpgradeTest) Setup(f *framework.Framework) {
ginkgo.By("creating a TCP service " + serviceName + " with type=LoadBalancer in namespace " + ns.Name)
tcpService, err := jig.CreateTCPService(func(s *v1.Service) {
s.Spec.Type = v1.ServiceTypeLoadBalancer
s.Spec.ExternalTrafficPolicy = v1.ServiceExternalTrafficPolicyTypeLocal
if s.Annotations == nil {
s.Annotations = make(map[string]string)
}
Expand Down
6 changes: 2 additions & 4 deletions test/e2e/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
configv1client "github.com/openshift/client-go/config/clientset/versioned"
"github.com/openshift/origin/test/e2e/upgrade/alert"

// "github.com/openshift/origin/test/e2e/upgrade/service"
"github.com/openshift/origin/test/e2e/upgrade/service"
"github.com/openshift/origin/test/extended/util/disruption"
"github.com/openshift/origin/test/extended/util/disruption/controlplane"
"github.com/openshift/origin/test/extended/util/disruption/frontends"
Expand All @@ -41,8 +40,7 @@ func AllTests() []upgrades.Test {
controlplane.NewOAuthAvailableTest(),
&alert.UpgradeTest{},
&frontends.AvailableTest{},
// Broken by 1.19 rebase, fix tracked by https://bugzilla.redhat.com/show_bug.cgi?id=1861944
// &service.UpgradeTest{},
&service.UpgradeTest{},
&upgrades.SecretUpgradeTest{},
&apps.ReplicaSetUpgradeTest{},
&apps.StatefulSetUpgradeTest{},
Expand Down
63 changes: 63 additions & 0 deletions test/extended/apiserver/graceful_termination.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package apiserver

import (
"context"
"fmt"

g "github.com/onsi/ginkgo"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"

exutil "github.com/openshift/origin/test/extended/util"
)

var _ = g.Describe("[sig-api-machinery][Feature:APIServer][Late]", func() {
defer g.GinkgoRecover()

oc := exutil.NewCLI("terminating-kube-apiserver")

g.It("kubelet terminates kube-apiserver gracefully", func() {
t := g.GinkgoT()

client, err := kubernetes.NewForConfig(oc.AdminConfig())
if err != nil {
g.Fail(fmt.Sprintf("Unexpected error: %v", err))
}

evs, err := client.CoreV1().Events("openshift-kube-apiserver").List(context.TODO(), metav1.ListOptions{})
if err != nil {
g.Fail(fmt.Sprintf("Unexpected error: %v", err))
}

for _, ev := range evs.Items {
if ev.Reason != "NonGracefulTermination" {
continue
}

t.Errorf("kube-apiserver reports a non-graceful termination: %#v. Probably kubelet or CRI-O is not giving the time to cleanly shut down. This can lead to connection refused and network I/O timeout errors in other components.", ev)
}
})

g.It("API LBs follow /readyz of kube-apiserver and stop sending requests", func() {
t := g.GinkgoT()

client, err := kubernetes.NewForConfig(oc.AdminConfig())
if err != nil {
g.Fail(fmt.Sprintf("Unexpected error: %v", err))
}

evs, err := client.CoreV1().Events("openshift-kube-apiserver").List(context.TODO(), metav1.ListOptions{})
if err != nil {
g.Fail(fmt.Sprintf("Unexpected error: %v", err))
}

for _, ev := range evs.Items {
if ev.Reason != "LateConnections" {
continue
}

t.Errorf("API LBs send requests to kube-apiserver far too late in termination process, probably due to broken LB configuration: %#v. This can lead to connection refused and network I/O timeout errors in other components.", ev)
}
})
})
Loading

0 comments on commit 8b1950d

Please sign in to comment.