Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.5] Bug 1879650: For clusters upgraded from 4.1, skip the anonymous browser access test #25510

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/extended/apiserver/root_403.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package apiserver

import (
"context"
"crypto/tls"
"crypto/x509"
"encoding/json"
"errors"
"io/ioutil"
"net/http"
"strings"

g "github.com/onsi/ginkgo"
o "github.com/onsi/gomega"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/net"
"k8s.io/client-go/rest"

Expand All @@ -26,6 +29,15 @@ var _ = g.Describe("[sig-api-machinery][Feature:APIServer]", func() {
transport, err := anonymousHttpTransport(oc.AdminConfig())
o.Expect(err).NotTo(o.HaveOccurred())

cv, err := oc.AdminConfigClient().ConfigV1().ClusterVersions().Get(context.TODO(), "version", metav1.GetOptions{})
o.Expect(err).NotTo(o.HaveOccurred())
// For more info, refer to release notes of https://bugzilla.redhat.com/show_bug.cgi?id=1821771
for _, history := range cv.Status.History {
if strings.HasPrefix(history.Version, "4.1.") {
g.Skip("the test is not expected to work with clusters upgraded from 4.1.x")
}
}

req, err := http.NewRequest("GET", oc.AdminConfig().Host, nil)
req.Header.Set("Accept", "*/*")
resp, err := transport.RoundTrip(req)
Expand Down