Skip to content

Commit

Permalink
Merge pull request #27736 from stbenjam/revert-27694-bump-1.26
Browse files Browse the repository at this point in the history
Revert "bump(k8s): 1.26"
  • Loading branch information
openshift-merge-robot committed Feb 20, 2023
2 parents 2b61865 + 00be076 commit 1135825
Show file tree
Hide file tree
Showing 2,960 changed files with 186,454 additions and 308,426 deletions.
2 changes: 0 additions & 2 deletions cmd/openshift-tests/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"github.com/openshift/origin/pkg/test/ginkgo"
exutil "github.com/openshift/origin/test/extended/util"
"k8s.io/kubectl/pkg/util/templates"
_ "k8s.io/kubernetes/test/e2e/framework/debug/init"
_ "k8s.io/kubernetes/test/e2e/framework/metrics/init"

_ "github.com/openshift/origin/test/extended"
_ "github.com/openshift/origin/test/extended/util/annotate/generated"
Expand Down
3 changes: 0 additions & 3 deletions examples/hello-openshift/go.mod

This file was deleted.

228 changes: 114 additions & 114 deletions go.mod

Large diffs are not rendered by default.

429 changes: 198 additions & 231 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hack/update-generated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
ENABLE_STORAGE_GCE_PD_DRIVER=yes go generate -mod vendor ./test/extended

# Update mirror mapping from upstream to quay
echo "# This file is generated by hack/update-generated.sh" > test/extended/util/image/zz_generated.txt
echo "# This file is generated by hack/update-generated-bindata.sh" > test/extended/util/image/zz_generated.txt
go run -mod vendor ./cmd/openshift-tests images --upstream --to-repository quay.io/openshift/community-e2e-images >> test/extended/util/image/zz_generated.txt

os::build::setup_env
Expand Down
4 changes: 2 additions & 2 deletions images/hello-openshift/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.13 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.15-openshift-4.8 AS builder
WORKDIR /go/src/github.com/openshift/hello-openshift
COPY examples/hello-openshift .
RUN go build -o /hello-openshift

FROM registry.ci.openshift.org/ocp/4.13:base
FROM registry.ci.openshift.org/ocp/4.8:base
COPY --from=builder /hello-openshift /hello-openshift
EXPOSE 8080 8888
USER 1001
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/ginkgo/options_monitor_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (o *MonitorEventsOptions) End(ctx context.Context, restConfig *rest.Config,
if d.IsDir() {
return nil
}
if !strings.HasPrefix(d.Name(), "AdditionalEvents__") {
if !strings.HasPrefix(d.Name(), "AdditionalEvents_") {
return nil
}
saved, _ := monitorserialization.EventsFromFile(path)
Expand Down
3 changes: 1 addition & 2 deletions test/extended/builds/multistage.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2e "k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
admissionapi "k8s.io/pod-security-admission/api"

buildv1 "github.com/openshift/api/build/v1"
Expand Down Expand Up @@ -97,7 +96,7 @@ COPY --from=%[2]s /bin/ping /test/
o.Expect(s).To(o.ContainSubstring("\"OPENSHIFT_BUILD_NAMESPACE\"=\"%s\"", oc.Namespace()))
e2e.Logf("Build logs:\n%s", result)

c := e2epod.PodClientNS(oc.KubeFramework(), oc.Namespace())
c := oc.KubeFramework().PodClient()
pod = c.Create(&corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Expand Down
5 changes: 2 additions & 3 deletions test/extended/builds/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
o "github.com/onsi/gomega"

corev1 "k8s.io/api/core/v1"
e2eoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
admissionapi "k8s.io/pod-security-admission/api"

exutil "github.com/openshift/origin/test/extended/util"
Expand Down Expand Up @@ -75,7 +74,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Slow] can use build secrets", f

g.By("verifying the build sources were available during build and secrets were not present in the output image")
pod := exutil.GetPodForContainer(corev1.Container{Name: "test", Image: image})
e2eoutput.TestContainerOutput(oc.KubeFramework(), "test-build-secret-source", pod, 0, []string{
oc.KubeFramework().TestContainerOutput("test-build-secret-source", pod, 0, []string{
"testsecret/secret1=secret1",
"testsecret/secret2=secret2",
"testsecret/secret3=secret3",
Expand Down Expand Up @@ -106,7 +105,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Slow] can use build secrets", f

g.By("verifying the build sources are present in container output")
pod := exutil.GetPodForContainer(corev1.Container{Name: "test", Image: image})
e2eoutput.TestContainerOutput(oc.KubeFramework(), "test-build-secret-docker", pod, 0, []string{
oc.KubeFramework().TestContainerOutput("test-build-secret-docker", pod, 0, []string{
"secret1=secret1",
"relative-secret2=secret2",
"foo=bar",
Expand Down
3 changes: 1 addition & 2 deletions test/extended/cli/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
admissionapi "k8s.io/pod-security-admission/api"

exutil "github.com/openshift/origin/test/extended/util"
Expand All @@ -32,7 +31,7 @@ var _ = g.Describe("[sig-cli] oc", func() {

g.It("can run inside of a busybox container [apigroup:image.openshift.io]", func() {
ns := oc.Namespace()
cli := e2epod.PodClientNS(oc.KubeFramework(), ns)
cli := oc.KubeFramework().PodClient()

_, err := oc.KubeClient().RbacV1().RoleBindings(ns).Create(context.Background(), &rbacv1.RoleBinding{
ObjectMeta: metav1.ObjectMeta{Name: "edit-for-builder"},
Expand Down
5 changes: 2 additions & 3 deletions test/extended/cluster/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
imageutils "k8s.io/kubernetes/test/utils/image"
)

Expand All @@ -36,8 +35,8 @@ var _ = g.Describe("[sig-api-machinery][Feature:Audit] Basic audit", func() {
}},
},
}
e2epod.NewPodClient(f).CreateSync(pod)
e2epod.NewPodClient(f).DeleteSync(pod.Name, metav1.DeleteOptions{}, e2epod.DefaultPodDeletionTimeout)
f.PodClient().CreateSync(pod)
f.PodClient().DeleteSync(pod.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout)

// Create, Read, Delete secret
secret := &apiv1.Secret{
Expand Down
23 changes: 12 additions & 11 deletions test/extended/dr/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"k8s.io/client-go/dynamic"
"k8s.io/kubernetes/test/e2e/framework"
e2e "k8s.io/kubernetes/test/e2e/framework"
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"

"github.com/openshift/origin/test/e2e/upgrade"
Expand All @@ -41,14 +42,14 @@ func runCommandAndRetry(command string) string {
out []byte
err error
)
e2e.Logf("command '%s'", command)
e2elog.Logf("command '%s'", command)
for retryCount = 0; retryCount <= maxRetries; retryCount++ {
out, err = exec.Command("bash", "-c", command).CombinedOutput()
e2e.Logf("output:\n%s", out)
e2elog.Logf("output:\n%s", out)
if err == nil {
break
}
e2e.Logf("%v", err)
e2elog.Logf("%v", err)
time.Sleep(time.Second * pause)
}
o.Expect(retryCount).NotTo(o.Equal(maxRetries + 1))
Expand Down Expand Up @@ -83,7 +84,7 @@ func clusterNodes(oc *exutil.CLI) (masters, workers []*corev1.Node) {
}

func waitForMastersToUpdate(oc *exutil.CLI, mcps dynamic.NamespaceableResourceInterface) {
e2e.Logf("Waiting for MachineConfig master to finish rolling out")
e2elog.Logf("Waiting for MachineConfig master to finish rolling out")
err := wait.Poll(30*time.Second, 30*time.Minute, func() (done bool, err error) {
done, _ = upgrade.IsPoolUpdated(mcps, "master")
return done, nil
Expand Down Expand Up @@ -111,7 +112,7 @@ func waitForOperatorsToSettle() {
obj, err := coc.List(context.Background(), metav1.ListOptions{})
if err != nil {
lastErr = err
e2e.Logf("Unable to check for cluster operators: %v", err)
e2elog.Logf("Unable to check for cluster operators: %v", err)
return false, nil
}
cv := objx.Map(obj.UnstructuredContent())
Expand Down Expand Up @@ -149,7 +150,7 @@ func waitForOperatorsToSettle() {
}
}
if len(unavailable) > 0 {
e2e.Logf("Operators still doing work: %s", strings.Join(unavailableNames, ", "))
e2elog.Logf("Operators still doing work: %s", strings.Join(unavailableNames, ", "))
return false, nil
}
return true, nil
Expand Down Expand Up @@ -178,7 +179,7 @@ func waitForOperatorsToSettle() {
)
}
w.Flush()
e2e.Logf("ClusterOperators:\n%s", buf.String())
e2elog.Logf("ClusterOperators:\n%s", buf.String())
if len(unavailable) > 0 {
e2e.Failf("Some cluster operators never became available %s", strings.Join(unavailable, ", "))
}
Expand All @@ -189,13 +190,13 @@ func waitForOperatorsToSettle() {
}

func restartSDNPods(oc *exutil.CLI) {
e2e.Logf("Restarting SDN")
e2elog.Logf("Restarting SDN")

pods, err := oc.AdminKubeClient().CoreV1().Pods("openshift-sdn").List(context.Background(), metav1.ListOptions{})
o.Expect(err).NotTo(o.HaveOccurred())

for _, pod := range pods.Items {
e2e.Logf("Deleting pod %s", pod.Name)
e2elog.Logf("Deleting pod %s", pod.Name)
err := oc.AdminKubeClient().CoreV1().Pods("openshift-sdn").Delete(context.Background(), pod.Name, metav1.DeleteOptions{})
o.Expect(err).NotTo(o.HaveOccurred())
}
Expand Down Expand Up @@ -254,7 +255,7 @@ func countReady(items []corev1.Node) int {
}

func fetchFileContents(node *corev1.Node, path string) string {
e2e.Logf("Fetching %s file contents from %s", path, node.Name)
e2elog.Logf("Fetching %s file contents from %s", path, node.Name)
out := execOnNodeWithOutputOrFail(node, fmt.Sprintf("cat %q", path))
return out.Stdout
}
Expand All @@ -270,7 +271,7 @@ func execOnNodeWithOutputOrFail(node *corev1.Node, cmd string) *e2essh.Result {
out, err = e2essh.IssueSSHCommandWithResult(cmd, e2e.TestContext.Provider, node)
// IssueSSHCommandWithResult logs output
if err != nil {
e2e.Logf("Failed to exec cmd [%s] on node %s: %v", cmd, node.Name, err)
e2elog.Logf("Failed to exec cmd [%s] on node %s: %v", cmd, node.Name, err)
}
return err == nil, nil
})
Expand Down
47 changes: 30 additions & 17 deletions test/extended/etcd/etcd_storage_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,6 @@ func testEtcd3StoragePath(t g.GinkgoTInterface, oc *exutil.CLI, etcdClient3Fn fu
gvr("internal.apiserver.k8s.io", "v1alpha1", "storageversions"),
gvr("storage.k8s.io", "v1alpha1", "csistoragecapacities"),
gvr("networking.k8s.io", "v1alpha1", "clustercidrs"),
gvr("resource.k8s.io", "v1alpha1", "resourceclasses"),
gvr("admissionregistration.k8s.io", "v1alpha1", "validatingadmissionpolicybindings"),
gvr("admissionregistration.k8s.io", "v1alpha1", "validatingadmissionpolicies"),
gvr("resource.k8s.io", "v1alpha1", "resourceclaimtemplates"),
gvr("resource.k8s.io", "v1alpha1", "resourceclaims"),
gvr("resource.k8s.io", "v1alpha1", "podschedulings"),
// disabled deprecated versions
gvr("autoscaling", "v2beta1", "horizontalpodautoscalers"),
gvr("batch", "v1beta1", "cronjobs"),
Expand All @@ -299,19 +293,26 @@ func testEtcd3StoragePath(t g.GinkgoTInterface, oc *exutil.CLI, etcdClient3Fn fu
gvr("node.k8s.io", "v1beta1", "runtimeclasses"),
gvr("policy", "v1beta1", "poddisruptionbudgets"),
gvr("policy", "v1beta1", "podsecuritypolicies"),
gvr("autoscaling", "v2beta2", "horizontalpodautoscalers"),
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "flowschemas"),
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "prioritylevelconfigurations"),
)

// Apply output of git diff origin/release-1.XY origin/release-1.X(Y+1) test/integration/etcd/data.go. This is needed
// to apply the right data depending on the kube version of the running server. Replace this with the next current
// and rebase version next time. Don't pile them up.
if strings.HasPrefix(version.Minor, "27") {
if strings.HasPrefix(version.Minor, "26") {
for k, a := range map[schema.GroupVersionResource]etcddata.StorageData{
// Added etcd data.
// TODO: When rebase has started, add etcd storage data has been added to
// k8s.io/kubernetes/test/integration/etcd/data.go in the 1.27 release.

// compare https://github.com/kubernetes/kubernetes/pull/112306
gvr("flowcontrol.apiserver.k8s.io", "v1beta3", "flowschemas"): {
Stub: `{"metadata": {"name": "fs-2"}, "spec": {"priorityLevelConfiguration": {"name": "name1"}}}`,
ExpectedEtcdPath: "/registry/flowschemas/fs-2",
ExpectedGVK: gvkP("flowcontrol.apiserver.k8s.io", "v1beta2", "FlowSchema"),
},
gvr("flowcontrol.apiserver.k8s.io", "v1beta3", "prioritylevelconfigurations"): {
Stub: `{"metadata": {"name": "conf4"}, "spec": {"type": "Limited", "limited": {"nominalConcurrencyShares":3, "limitResponse": {"type": "Reject"}}}}`,
ExpectedEtcdPath: "/registry/prioritylevelconfigurations/conf4",
ExpectedGVK: gvkP("flowcontrol.apiserver.k8s.io", "v1beta2", "PriorityLevelConfiguration"),
},
} {
if _, preexisting := etcdStorageData[k]; preexisting {
t.Errorf("upstream etcd storage data already has data for %v. Update current and rebase version diff to next rebase version", k)
Expand All @@ -320,13 +321,25 @@ func testEtcd3StoragePath(t g.GinkgoTInterface, oc *exutil.CLI, etcdClient3Fn fu
}

// Modified etcd data.
// TODO: When rebase has started, fixup etcd storage data that has been modified
// in k8s.io/kubernetes/test/integration/etcd/data.go in the 1.27 release.

// compare https://github.com/kubernetes/kubernetes/pull/112306
etcdStorageData[gvr("flowcontrol.apiserver.k8s.io", "v1beta2", "flowschemas")] = etcddata.StorageData{
Stub: `{"metadata": {"name": "fs-1"}, "spec": {"priorityLevelConfiguration": {"name": "name1"}}}`,
ExpectedEtcdPath: "/registry/flowschemas/fs-1",
}
etcdStorageData[gvr("flowcontrol.apiserver.k8s.io", "v1beta2", "prioritylevelconfigurations")] = etcddata.StorageData{
Stub: `{"metadata": {"name": "conf3"}, "spec": {"type": "Limited", "limited": {"assuredConcurrencyShares":3, "limitResponse": {"type": "Reject"}}}}`,
ExpectedEtcdPath: "/registry/prioritylevelconfigurations/conf3",
}

// Removed etcd data.
// TODO: When rebase has started, remove etcd storage data that has been removed
// from k8s.io/kubernetes/test/integration/etcd/data.go in the 1.27 release.
removeStorageData(t, etcdStorageData)

// disabled deprecated versions in 1.26
removeStorageData(t, etcdStorageData,
gvr("autoscaling", "v2beta2", "horizontalpodautoscalers"),
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "flowschemas"),
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "prioritylevelconfigurations"),
)
}

// we use a different default path prefix for kube resources
Expand Down
12 changes: 8 additions & 4 deletions test/extended/idling/idling.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import (

kapiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
e2eoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
admissionapi "k8s.io/pod-security-admission/api"

e2e "k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"

unidlingapi "github.com/openshift/api/unidling/v1alpha1"

exutil "github.com/openshift/origin/test/extended/util"
Expand Down Expand Up @@ -49,7 +50,7 @@ func tryEchoUDP(svc *kapiv1.Service, execPod *kapiv1.Pod) error {
cmd := fmt.Sprintf("echo -n \"echo %s\" | nc -w 5 -u %s %d", expected, rawIP, udpPort)

o.Eventually(func() (string, error) {
return e2eoutput.RunHostCmd(execPod.Namespace, execPod.Name, cmd)
return e2e.RunHostCmd(execPod.Namespace, execPod.Name, cmd)
}, 2*time.Minute, readTimeout).Should(o.Equal(expected))

return nil
Expand Down Expand Up @@ -78,7 +79,7 @@ func tryEchoHTTP(svc *kapiv1.Service, execPod *kapiv1.Pod) error {
net.JoinHostPort(rawIP, tcpPort),
url.QueryEscape(expected),
)
out, err := e2eoutput.RunHostCmd(execPod.Namespace, execPod.Name, cmd)
out, err := e2e.RunHostCmd(execPod.Namespace, execPod.Name, cmd)
if err != nil {
return fmt.Errorf("exec failed: %v\noutput: %s", err, out)
}
Expand Down Expand Up @@ -218,6 +219,7 @@ var _ = g.Describe("[sig-network-edge][Feature:Idling]", func() {
g.Describe("Idling", func() {
g.Context("with a single service and DeploymentConfig [apigroup:route.openshift.io]", func() {
g.BeforeEach(func() {
framework.BeforeEach()
fixture = echoServerFixture
})

Expand All @@ -228,6 +230,7 @@ var _ = g.Describe("[sig-network-edge][Feature:Idling]", func() {

g.Context("with a single service and ReplicationController", func() {
g.BeforeEach(func() {
framework.BeforeEach()
fixture = echoServerRcFixture
})

Expand All @@ -239,6 +242,7 @@ var _ = g.Describe("[sig-network-edge][Feature:Idling]", func() {

g.Describe("Unidling [apigroup:apps.openshift.io][apigroup:route.openshift.io]", func() {
g.BeforeEach(func() {
framework.BeforeEach()
fixture = echoServerFixture
})

Expand Down
3 changes: 1 addition & 2 deletions test/extended/images/append.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

kapiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
admissionapi "k8s.io/pod-security-admission/api"

"github.com/openshift/api/image/docker10"
Expand Down Expand Up @@ -89,7 +88,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageAppend] Image append", func
registry := strings.Split(is.Status.DockerImageRepository, "/")[0]

ns = oc.Namespace()
cli := e2epod.PodClientNS(oc.KubeFramework(), oc.Namespace())
cli := oc.KubeFramework().PodClient()
pod := cli.Create(cliPodWithPullSecret(oc, heredoc.Docf(`
set -x
Expand Down
3 changes: 1 addition & 2 deletions test/extended/images/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

kapi "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
k8simage "k8s.io/kubernetes/test/utils/image"
admissionapi "k8s.io/pod-security-admission/api"

Expand Down Expand Up @@ -41,7 +40,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageExtract] Image extract", fu
registry := strings.Split(is.Status.DockerImageRepository, "/")[0]

ns = oc.Namespace()
cli := e2epod.PodClientNS(oc.KubeFramework(), ns)
cli := oc.KubeFramework().PodClient()
client := imageclientset.NewForConfigOrDie(oc.UserConfig()).ImageV1()

// import tools:latest into this namespace - working around a pull through bug with referenced docker images
Expand Down

0 comments on commit 1135825

Please sign in to comment.