mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 10:53:34 +00:00
rebase: update kubernetes to 1.30
updating kubernetes to 1.30 release Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
62ddcf715b
commit
e727bd351e
11
vendor/k8s.io/kubernetes/test/e2e/framework/expect.go
generated
vendored
11
vendor/k8s.io/kubernetes/test/e2e/framework/expect.go
generated
vendored
@ -293,13 +293,6 @@ func (f *FailureError) backtrace() {
|
||||
// }
|
||||
var ErrFailure error = FailureError{}
|
||||
|
||||
// ExpectNotEqual expects the specified two are not the same, otherwise an exception raises
|
||||
//
|
||||
// Deprecated: use gomega.Expect().ToNot(gomega.Equal())
|
||||
func ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{}) {
|
||||
gomega.ExpectWithOffset(1, actual).NotTo(gomega.Equal(extra), explain...)
|
||||
}
|
||||
|
||||
// ExpectError expects an error happens, otherwise an exception raises
|
||||
//
|
||||
// Deprecated: use gomega.Expect().To(gomega.HaveOccurred()) or (better!) check
|
||||
@ -350,9 +343,9 @@ func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{}) {
|
||||
// because it is not included in the failure message.
|
||||
var failure FailureError
|
||||
if errors.As(err, &failure) && failure.Backtrace() != "" {
|
||||
Logf("Failed inside E2E framework:\n %s", strings.ReplaceAll(failure.Backtrace(), "\n", "\n "))
|
||||
log(offset+1, fmt.Sprintf("Failed inside E2E framework:\n %s", strings.ReplaceAll(failure.Backtrace(), "\n", "\n ")))
|
||||
} else if !errors.Is(err, ErrFailure) {
|
||||
Logf("Unexpected error: %s\n%s", prefix, format.Object(err, 1))
|
||||
log(offset+1, fmt.Sprintf("Unexpected error: %s\n%s", prefix, format.Object(err, 1)))
|
||||
}
|
||||
Fail(prefix+err.Error(), 1+offset)
|
||||
}
|
||||
|
2
vendor/k8s.io/kubernetes/test/e2e/framework/framework.go
generated
vendored
2
vendor/k8s.io/kubernetes/test/e2e/framework/framework.go
generated
vendored
@ -66,7 +66,7 @@ var (
|
||||
//
|
||||
// This can be used by extensions of the core framework to modify
|
||||
// settings in the framework instance or to add additional callbacks
|
||||
// with gingko.BeforeEach/AfterEach/DeferCleanup.
|
||||
// with ginkgo.BeforeEach/AfterEach/DeferCleanup.
|
||||
//
|
||||
// When a test runs, functions will be invoked in this order:
|
||||
// - BeforeEaches defined by tests before f.NewDefaultFramework
|
||||
|
100
vendor/k8s.io/kubernetes/test/e2e/framework/ginkgologger.go
generated
vendored
Normal file
100
vendor/k8s.io/kubernetes/test/e2e/framework/ginkgologger.go
generated
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package framework contains provider-independent helper code for
|
||||
// building and running E2E tests with Ginkgo. The actual Ginkgo test
|
||||
// suites gets assembled by combining this framework, the optional
|
||||
// provider support code and specific tests via a separate .go file
|
||||
// like Kubernetes' test/e2e.go.
|
||||
package framework
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/onsi/ginkgo/v2"
|
||||
ginkgotypes "github.com/onsi/ginkgo/v2/types"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog/v2/textlogger"
|
||||
|
||||
_ "k8s.io/component-base/logs/testinit" // Ensure command line flags are registered.
|
||||
)
|
||||
|
||||
var (
|
||||
logConfig = textlogger.NewConfig(
|
||||
textlogger.Output(ginkgo.GinkgoWriter),
|
||||
textlogger.Backtrace(unwind),
|
||||
)
|
||||
ginkgoLogger = textlogger.NewLogger(logConfig)
|
||||
TimeNow = time.Now // Can be stubbed out for testing.
|
||||
Pid = os.Getpid() // Can be stubbed out for testing.
|
||||
)
|
||||
|
||||
func init() {
|
||||
// ktesting and testinit already registered the -v and -vmodule
|
||||
// command line flags. To configure the textlogger instead, we
|
||||
// need to swap out the flag.Value for those.
|
||||
var fs flag.FlagSet
|
||||
logConfig.AddFlags(&fs)
|
||||
fs.VisitAll(func(loggerFlag *flag.Flag) {
|
||||
klogFlag := flag.CommandLine.Lookup(loggerFlag.Name)
|
||||
if klogFlag != nil {
|
||||
klogFlag.Value = loggerFlag.Value
|
||||
}
|
||||
})
|
||||
|
||||
// Now install the textlogger as the klog default logger.
|
||||
// Calls like klog.Info then will write to ginkgo.GingoWriter
|
||||
// through the textlogger.
|
||||
//
|
||||
// However, stack unwinding is then still being done by klog and thus
|
||||
// ignores ginkgo.GingkoHelper. Tests should use framework.Logf or
|
||||
// structured, contextual logging.
|
||||
writer, _ := ginkgoLogger.GetSink().(textlogger.KlogBufferWriter)
|
||||
opts := []klog.LoggerOption{
|
||||
klog.ContextualLogger(true),
|
||||
klog.WriteKlogBuffer(writer.WriteKlogBuffer),
|
||||
}
|
||||
klog.SetLoggerWithOptions(ginkgoLogger, opts...)
|
||||
}
|
||||
|
||||
func unwind(skip int) (string, int) {
|
||||
location := ginkgotypes.NewCodeLocation(skip + 1)
|
||||
return location.FileName, location.LineNumber
|
||||
}
|
||||
|
||||
// log re-implements klog.Info: same header, but stack unwinding
|
||||
// with support for ginkgo.GinkgoWriter and skipping stack levels.
|
||||
func log(offset int, msg string) {
|
||||
now := TimeNow()
|
||||
file, line := unwind(offset + 1)
|
||||
if file == "" {
|
||||
file = "???"
|
||||
line = 1
|
||||
} else if slash := strings.LastIndex(file, "/"); slash >= 0 {
|
||||
file = file[slash+1:]
|
||||
}
|
||||
_, month, day := now.Date()
|
||||
hour, minute, second := now.Clock()
|
||||
header := fmt.Sprintf("I%02d%02d %02d:%02d:%02d.%06d %d %s:%d]",
|
||||
month, day, hour, minute, second, now.Nanosecond()/1000, Pid, file, line)
|
||||
|
||||
fmt.Fprintln(ginkgo.GinkgoWriter, header, msg)
|
||||
}
|
32
vendor/k8s.io/kubernetes/test/e2e/framework/ginkgowrapper.go
generated
vendored
32
vendor/k8s.io/kubernetes/test/e2e/framework/ginkgowrapper.go
generated
vendored
@ -148,7 +148,7 @@ func ConformanceIt(args ...interface{}) bool {
|
||||
|
||||
// It is a wrapper around [ginkgo.It] which supports framework With* labels as
|
||||
// optional arguments in addition to those already supported by ginkgo itself,
|
||||
// like [ginkgo.Label] and [gingko.Offset].
|
||||
// like [ginkgo.Label] and [ginkgo.Offset].
|
||||
//
|
||||
// Text and arguments may be mixed. The final text is a concatenation
|
||||
// of the text arguments and special tags from the With functions.
|
||||
@ -163,7 +163,7 @@ func (f *Framework) It(args ...interface{}) bool {
|
||||
|
||||
// Describe is a wrapper around [ginkgo.Describe] which supports framework
|
||||
// With* labels as optional arguments in addition to those already supported by
|
||||
// ginkgo itself, like [ginkgo.Label] and [gingko.Offset].
|
||||
// ginkgo itself, like [ginkgo.Label] and [ginkgo.Offset].
|
||||
//
|
||||
// Text and arguments may be mixed. The final text is a concatenation
|
||||
// of the text arguments and special tags from the With functions.
|
||||
@ -178,7 +178,7 @@ func (f *Framework) Describe(args ...interface{}) bool {
|
||||
|
||||
// Context is a wrapper around [ginkgo.Context] which supports framework With*
|
||||
// labels as optional arguments in addition to those already supported by
|
||||
// ginkgo itself, like [ginkgo.Label] and [gingko.Offset].
|
||||
// ginkgo itself, like [ginkgo.Label] and [ginkgo.Offset].
|
||||
//
|
||||
// Text and arguments may be mixed. The final text is a concatenation
|
||||
// of the text arguments and special tags from the With functions.
|
||||
@ -248,7 +248,7 @@ func registerInSuite(ginkgoCall func(string, ...interface{}) bool, args []interf
|
||||
|
||||
var (
|
||||
tagRe = regexp.MustCompile(`\[.*?\]`)
|
||||
deprecatedTags = sets.New("Conformance", "NodeConformance", "Disruptive", "Serial", "Slow")
|
||||
deprecatedTags = sets.New("Conformance", "Flaky", "NodeConformance", "Disruptive", "Serial", "Slow")
|
||||
deprecatedTagPrefixes = sets.New("Environment", "Feature", "NodeFeature", "FeatureGate")
|
||||
deprecatedStability = sets.New("Alpha", "Beta")
|
||||
)
|
||||
@ -526,15 +526,37 @@ func withLabel(label string) interface{} {
|
||||
return newLabel(label)
|
||||
}
|
||||
|
||||
// WithFlaky specifies that a certain test or group of tests are failing randomly.
|
||||
// These tests are usually filtered out and ran separately from other tests.
|
||||
func WithFlaky() interface{} {
|
||||
return withFlaky()
|
||||
}
|
||||
|
||||
// WithFlaky is a shorthand for the corresponding package function.
|
||||
func (f *Framework) WithFlaky() interface{} {
|
||||
return withFlaky()
|
||||
}
|
||||
|
||||
func withFlaky() interface{} {
|
||||
return newLabel("Flaky")
|
||||
}
|
||||
|
||||
type label struct {
|
||||
// parts get concatenated with ":" to build the full label.
|
||||
parts []string
|
||||
// extra is an optional fully-formed extra label.
|
||||
extra string
|
||||
// explanation gets set for each label to help developers
|
||||
// who pass a label to a ginkgo function. They need to use
|
||||
// the corresponding framework function instead.
|
||||
explanation string
|
||||
}
|
||||
|
||||
func newLabel(parts ...string) label {
|
||||
return label{parts: parts}
|
||||
return label{
|
||||
parts: parts,
|
||||
explanation: "If you see this as part of an 'Unknown Decorator' error from Ginkgo, then you need to replace the ginkgo.It/Context/Describe call with the corresponding framework.It/Context/Describe or (if available) f.It/Context/Describe.",
|
||||
}
|
||||
}
|
||||
|
||||
// TagsEqual can be used to check whether two tags are the same.
|
||||
|
15
vendor/k8s.io/kubernetes/test/e2e/framework/log.go
generated
vendored
15
vendor/k8s.io/kubernetes/test/e2e/framework/log.go
generated
vendored
@ -18,22 +18,17 @@ package framework
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/onsi/ginkgo/v2"
|
||||
)
|
||||
|
||||
func nowStamp() string {
|
||||
return time.Now().Format(time.StampMilli)
|
||||
}
|
||||
|
||||
func log(level string, format string, args ...interface{}) {
|
||||
fmt.Fprintf(ginkgo.GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...)
|
||||
}
|
||||
|
||||
// Logf logs the info.
|
||||
//
|
||||
// Use this instead of `klog.Infof` because stack unwinding automatically
|
||||
// skips over helper functions which marked themselves as helper by
|
||||
// calling [ginkgo.GinkgoHelper].
|
||||
func Logf(format string, args ...interface{}) {
|
||||
log("INFO", format, args...)
|
||||
log(1, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
// Failf logs the fail info, including a stack trace starts with its direct caller
|
||||
|
38
vendor/k8s.io/kubernetes/test/e2e/framework/pod/wait.go
generated
vendored
38
vendor/k8s.io/kubernetes/test/e2e/framework/pod/wait.go
generated
vendored
@ -75,7 +75,7 @@ func BeRunningNoRetries() types.GomegaMatcher {
|
||||
gcustom.MakeMatcher(func(pod *v1.Pod) (bool, error) {
|
||||
switch pod.Status.Phase {
|
||||
case v1.PodFailed, v1.PodSucceeded:
|
||||
return false, gomega.StopTrying(fmt.Sprintf("Expected pod to reach phase %q, got final phase %q instead.", v1.PodRunning, pod.Status.Phase))
|
||||
return false, gomega.StopTrying(fmt.Sprintf("Expected pod to reach phase %q, got final phase %q instead:\n%s", v1.PodRunning, pod.Status.Phase, format.Object(pod, 1)))
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
@ -335,8 +335,8 @@ func RunningReady(p *v1.Pod) bool {
|
||||
}
|
||||
|
||||
// WaitForPodsRunning waits for a given `timeout` to evaluate if a certain amount of pods in given `ns` are running.
|
||||
func WaitForPodsRunning(c clientset.Interface, ns string, num int, timeout time.Duration) error {
|
||||
_, err := WaitForPods(context.TODO(), c, ns, metav1.ListOptions{}, Range{MinMatching: num, MaxMatching: num}, timeout,
|
||||
func WaitForPodsRunning(ctx context.Context, c clientset.Interface, ns string, num int, timeout time.Duration) error {
|
||||
_, err := WaitForPods(ctx, c, ns, metav1.ListOptions{}, Range{MinMatching: num, MaxMatching: num}, timeout,
|
||||
"be running and ready", func(pod *v1.Pod) bool {
|
||||
ready, _ := testutils.PodRunningReady(pod)
|
||||
return ready
|
||||
@ -345,8 +345,8 @@ func WaitForPodsRunning(c clientset.Interface, ns string, num int, timeout time.
|
||||
}
|
||||
|
||||
// WaitForPodsSchedulingGated waits for a given `timeout` to evaluate if a certain amount of pods in given `ns` stay in scheduling gated state.
|
||||
func WaitForPodsSchedulingGated(c clientset.Interface, ns string, num int, timeout time.Duration) error {
|
||||
_, err := WaitForPods(context.TODO(), c, ns, metav1.ListOptions{}, Range{MinMatching: num, MaxMatching: num}, timeout,
|
||||
func WaitForPodsSchedulingGated(ctx context.Context, c clientset.Interface, ns string, num int, timeout time.Duration) error {
|
||||
_, err := WaitForPods(ctx, c, ns, metav1.ListOptions{}, Range{MinMatching: num, MaxMatching: num}, timeout,
|
||||
"be in scheduling gated state", func(pod *v1.Pod) bool {
|
||||
for _, condition := range pod.Status.Conditions {
|
||||
if condition.Type == v1.PodScheduled && condition.Reason == v1.PodReasonSchedulingGated {
|
||||
@ -360,8 +360,8 @@ func WaitForPodsSchedulingGated(c clientset.Interface, ns string, num int, timeo
|
||||
|
||||
// WaitForPodsWithSchedulingGates waits for a given `timeout` to evaluate if a certain amount of pods in given `ns`
|
||||
// match the given `schedulingGates`stay in scheduling gated state.
|
||||
func WaitForPodsWithSchedulingGates(c clientset.Interface, ns string, num int, timeout time.Duration, schedulingGates []v1.PodSchedulingGate) error {
|
||||
_, err := WaitForPods(context.TODO(), c, ns, metav1.ListOptions{}, Range{MinMatching: num, MaxMatching: num}, timeout,
|
||||
func WaitForPodsWithSchedulingGates(ctx context.Context, c clientset.Interface, ns string, num int, timeout time.Duration, schedulingGates []v1.PodSchedulingGate) error {
|
||||
_, err := WaitForPods(ctx, c, ns, metav1.ListOptions{}, Range{MinMatching: num, MaxMatching: num}, timeout,
|
||||
"have certain scheduling gates", func(pod *v1.Pod) bool {
|
||||
return reflect.DeepEqual(pod.Spec.SchedulingGates, schedulingGates)
|
||||
})
|
||||
@ -401,14 +401,14 @@ func WaitForPodTerminatingInNamespaceTimeout(ctx context.Context, c clientset.In
|
||||
func WaitForPodSuccessInNamespaceTimeout(ctx context.Context, c clientset.Interface, podName, namespace string, timeout time.Duration) error {
|
||||
return WaitForPodCondition(ctx, c, namespace, podName, fmt.Sprintf("%s or %s", v1.PodSucceeded, v1.PodFailed), timeout, func(pod *v1.Pod) (bool, error) {
|
||||
if pod.DeletionTimestamp == nil && pod.Spec.RestartPolicy == v1.RestartPolicyAlways {
|
||||
return true, fmt.Errorf("pod %q will never terminate with a succeeded state since its restart policy is Always", podName)
|
||||
return true, gomega.StopTrying(fmt.Sprintf("pod %q will never terminate with a succeeded state since its restart policy is Always", podName))
|
||||
}
|
||||
switch pod.Status.Phase {
|
||||
case v1.PodSucceeded:
|
||||
ginkgo.By("Saw pod success")
|
||||
return true, nil
|
||||
case v1.PodFailed:
|
||||
return true, fmt.Errorf("pod %q failed with status: %+v", podName, pod.Status)
|
||||
return true, gomega.StopTrying(fmt.Sprintf("pod %q failed with status: %+v", podName, pod.Status))
|
||||
default:
|
||||
return false, nil
|
||||
}
|
||||
@ -518,11 +518,6 @@ func WaitForPodSuccessInNamespace(ctx context.Context, c clientset.Interface, po
|
||||
return WaitForPodSuccessInNamespaceTimeout(ctx, c, podName, namespace, podStartTimeout)
|
||||
}
|
||||
|
||||
// WaitForPodSuccessInNamespaceSlow returns nil if the pod reached state success, or an error if it reached failure or until slowPodStartupTimeout.
|
||||
func WaitForPodSuccessInNamespaceSlow(ctx context.Context, c clientset.Interface, podName string, namespace string) error {
|
||||
return WaitForPodSuccessInNamespaceTimeout(ctx, c, podName, namespace, slowPodStartTimeout)
|
||||
}
|
||||
|
||||
// WaitForPodNotFoundInNamespace returns an error if it takes too long for the pod to fully terminate.
|
||||
// Unlike `waitForPodTerminatedInNamespace`, the pod's Phase and Reason are ignored. If the pod Get
|
||||
// api returns IsNotFound then the wait stops and nil is returned. If the Get api returns an error other
|
||||
@ -779,3 +774,18 @@ func WaitForContainerRunning(ctx context.Context, c clientset.Interface, namespa
|
||||
return false, nil
|
||||
})
|
||||
}
|
||||
|
||||
// WaitForContainerTerminated waits for the given Pod container to have a state of terminated
|
||||
func WaitForContainerTerminated(ctx context.Context, c clientset.Interface, namespace, podName, containerName string, timeout time.Duration) error {
|
||||
conditionDesc := fmt.Sprintf("container %s terminated", containerName)
|
||||
return WaitForPodCondition(ctx, c, namespace, podName, conditionDesc, timeout, func(pod *v1.Pod) (bool, error) {
|
||||
for _, statuses := range [][]v1.ContainerStatus{pod.Status.ContainerStatuses, pod.Status.InitContainerStatuses, pod.Status.EphemeralContainerStatuses} {
|
||||
for _, cs := range statuses {
|
||||
if cs.Name == containerName {
|
||||
return cs.State.Terminated != nil, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
}
|
||||
|
27
vendor/k8s.io/kubernetes/test/e2e/framework/provider_less.go
generated
vendored
Normal file
27
vendor/k8s.io/kubernetes/test/e2e/framework/provider_less.go
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
//go:build providerless
|
||||
// +build providerless
|
||||
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package framework
|
||||
|
||||
func init() {
|
||||
// fake "gce"
|
||||
RegisterProvider("gce", func() (ProviderInterface, error) {
|
||||
return NullProvider{}, nil
|
||||
})
|
||||
}
|
41
vendor/k8s.io/kubernetes/test/e2e/framework/skipper/skipper.go
generated
vendored
41
vendor/k8s.io/kubernetes/test/e2e/framework/skipper/skipper.go
generated
vendored
@ -22,13 +22,10 @@ import (
|
||||
|
||||
"github.com/onsi/ginkgo/v2"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
utilversion "k8s.io/apimachinery/pkg/util/version"
|
||||
"k8s.io/client-go/discovery"
|
||||
"k8s.io/client-go/dynamic"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/component-base/featuregate"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
@ -85,34 +82,6 @@ func SkipUnlessFeatureGateEnabled(gate featuregate.Feature) {
|
||||
}
|
||||
}
|
||||
|
||||
// SkipIfFeatureGateEnabled skips if the feature is enabled.
|
||||
//
|
||||
// Beware that this only works in test suites that have a --feature-gate
|
||||
// parameter and call InitFeatureGates. In test/e2e, the `Feature: XYZ` tag
|
||||
// has to be used instead and invocations have to make sure that they
|
||||
// only run tests that work with the given test cluster.
|
||||
func SkipIfFeatureGateEnabled(gate featuregate.Feature) {
|
||||
if featureGate == nil {
|
||||
framework.Failf("Feature gate checking is not enabled, don't use SkipFeatureGateEnabled(%v). Instead use the Feature tag.", gate)
|
||||
}
|
||||
if featureGate.Enabled(gate) {
|
||||
skipInternalf(1, "Only supported when %v feature is disabled", gate)
|
||||
}
|
||||
}
|
||||
|
||||
// SkipIfMissingResource skips if the gvr resource is missing.
|
||||
func SkipIfMissingResource(ctx context.Context, dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, namespace string) {
|
||||
resourceClient := dynamicClient.Resource(gvr).Namespace(namespace)
|
||||
_, err := resourceClient.List(ctx, metav1.ListOptions{})
|
||||
if err != nil {
|
||||
// not all resources support list, so we ignore those
|
||||
if apierrors.IsMethodNotSupported(err) || apierrors.IsNotFound(err) || apierrors.IsForbidden(err) {
|
||||
skipInternalf(1, "Could not find %s resource, skipping test: %#v", gvr, err)
|
||||
}
|
||||
framework.Failf("Unexpected error getting %v: %v", gvr, err)
|
||||
}
|
||||
}
|
||||
|
||||
// SkipUnlessNodeCountIsAtLeast skips if the number of nodes is less than the minNodeCount.
|
||||
func SkipUnlessNodeCountIsAtLeast(minNodeCount int) {
|
||||
if framework.TestContext.CloudConfig.NumNodes < minNodeCount {
|
||||
@ -230,16 +199,6 @@ func SkipIfAppArmorNotSupported() {
|
||||
SkipUnlessNodeOSDistroIs(AppArmorDistros...)
|
||||
}
|
||||
|
||||
// RunIfSystemSpecNameIs runs if the system spec name is included in the names.
|
||||
func RunIfSystemSpecNameIs(names ...string) {
|
||||
for _, name := range names {
|
||||
if name == framework.TestContext.SystemSpecName {
|
||||
return
|
||||
}
|
||||
}
|
||||
skipInternalf(1, "Skipped because system spec name %q is not in %v", framework.TestContext.SystemSpecName, names)
|
||||
}
|
||||
|
||||
// SkipUnlessComponentRunsAsPodsAndClientCanDeleteThem run if the component run as pods and client can delete them
|
||||
func SkipUnlessComponentRunsAsPodsAndClientCanDeleteThem(ctx context.Context, componentName string, c clientset.Interface, ns string, labelSet labels.Set) {
|
||||
// verify if component run as pod
|
||||
|
19
vendor/k8s.io/kubernetes/test/e2e/framework/test_context.go
generated
vendored
19
vendor/k8s.io/kubernetes/test/e2e/framework/test_context.go
generated
vendored
@ -465,10 +465,10 @@ func RegisterClusterFlags(flags *flag.FlagSet) {
|
||||
flags.DurationVar(&nodeKiller.SimulatedDowntime, "node-killer-simulated-downtime", 10*time.Minute, "A delay between node death and recreation")
|
||||
}
|
||||
|
||||
// GenerateSecureToken returns a string of length tokenLen, consisting
|
||||
// generateSecureToken returns a string of length tokenLen, consisting
|
||||
// of random bytes encoded as base64 for use as a Bearer Token during
|
||||
// communication with an APIServer
|
||||
func GenerateSecureToken(tokenLen int) (string, error) {
|
||||
func generateSecureToken(tokenLen int) (string, error) {
|
||||
// Number of bytes to be tokenLen when base64 encoded.
|
||||
tokenSize := math.Ceil(float64(tokenLen) * 6 / 8)
|
||||
rawToken := make([]byte, int(tokenSize))
|
||||
@ -492,13 +492,6 @@ func AfterReadingAllFlags(t *TestContextType) {
|
||||
if t.KubeTestRepoList != "" {
|
||||
image.Init(t.KubeTestRepoList)
|
||||
}
|
||||
var fs flag.FlagSet
|
||||
klog.InitFlags(&fs)
|
||||
fs.Set("logtostderr", "false")
|
||||
fs.Set("alsologtostderr", "false")
|
||||
fs.Set("one_output", "true")
|
||||
fs.Set("stderrthreshold", "10" /* higher than any of the severities -> none pass the threshold */)
|
||||
klog.SetOutput(ginkgo.GinkgoWriter)
|
||||
|
||||
if t.ListImages {
|
||||
for _, v := range image.GetImageConfigs() {
|
||||
@ -548,10 +541,8 @@ func AfterReadingAllFlags(t *TestContextType) {
|
||||
}
|
||||
if len(t.BearerToken) == 0 {
|
||||
var err error
|
||||
t.BearerToken, err = GenerateSecureToken(16)
|
||||
if err != nil {
|
||||
klog.Fatalf("Failed to generate bearer token: %v", err)
|
||||
}
|
||||
t.BearerToken, err = generateSecureToken(16)
|
||||
ExpectNoError(err, "Failed to generate bearer token")
|
||||
}
|
||||
|
||||
// Allow 1% of nodes to be unready (statistically) - relevant for large clusters.
|
||||
@ -647,7 +638,7 @@ func listTestInformation(report ginkgo.Report) {
|
||||
labels.Insert(spec.Labels()...)
|
||||
}
|
||||
}
|
||||
fmt.Fprintf(Output, "The following labels can be used with 'gingko run --label-filter':\n%s%s\n\n", indent, strings.Join(sets.List(labels), "\n"+indent))
|
||||
fmt.Fprintf(Output, "The following labels can be used with 'ginkgo run --label-filter':\n%s%s\n\n", indent, strings.Join(sets.List(labels), "\n"+indent))
|
||||
}
|
||||
if TestContext.listTests {
|
||||
leafs := make([][]string, 0, len(report.SpecReports))
|
||||
|
4
vendor/k8s.io/kubernetes/test/e2e/storage/utils/create.go
generated
vendored
4
vendor/k8s.io/kubernetes/test/e2e/storage/utils/create.go
generated
vendored
@ -62,6 +62,10 @@ func LoadFromManifests(files ...string) ([]interface{}, error) {
|
||||
if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), data, &what); err != nil {
|
||||
return fmt.Errorf("decode TypeMeta: %w", err)
|
||||
}
|
||||
// Ignore empty documents.
|
||||
if what.Kind == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
factory := factories[what]
|
||||
if factory == nil {
|
||||
|
@ -32,7 +32,7 @@ spec:
|
||||
hostPath:
|
||||
path: /dev
|
||||
containers:
|
||||
- image: registry.k8s.io/e2e-test-images/sample-device-plugin:1.5
|
||||
- image: registry.k8s.io/e2e-test-images/sample-device-plugin:1.7
|
||||
name: sample-device-plugin
|
||||
env:
|
||||
- name: PLUGIN_SOCK_DIR
|
||||
|
@ -35,7 +35,7 @@ spec:
|
||||
hostPath:
|
||||
path: /var/run/cdi
|
||||
containers:
|
||||
- image: registry.k8s.io/e2e-test-images/sample-device-plugin:1.3
|
||||
- image: registry.k8s.io/e2e-test-images/sample-device-plugin:1.7
|
||||
name: sample-device-plugin
|
||||
env:
|
||||
- name: PLUGIN_SOCK_DIR
|
||||
|
@ -52,8 +52,8 @@ spec:
|
||||
# Refer to details about the installer in https://cos.googlesource.com/cos/tools/+/refs/heads/master/src/cmd/cos_gpu_installer/
|
||||
# and the COS release notes (https://cloud.google.com/container-optimized-os/docs/release-notes) to determine version COS GPU installer for a given version of COS.
|
||||
|
||||
# Maps to gcr.io/cos-cloud/cos-gpu-installer:v2.1.9 - suitable for COS M109 as per https://cloud.google.com/container-optimized-os/docs/release-notes
|
||||
- image: gcr.io/cos-cloud/cos-gpu-installer:v2.1.9
|
||||
# Maps to gcr.io/cos-cloud/cos-gpu-installer:v2.1.10 - suitable for COS M109 as per https://cloud.google.com/container-optimized-os/docs/release-notes
|
||||
- image: gcr.io/cos-cloud/cos-gpu-installer:v2.1.10
|
||||
name: nvidia-driver-installer
|
||||
resources:
|
||||
requests:
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-attacher/raw/v3.4.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path v1.8.0
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-attacher/raw/v4.5.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path release-1.13
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# This YAML file contains all RBAC objects that are necessary to run external
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-health-monitor/raw/v0.4.0/deploy/kubernetes/external-health-monitor-controller/rbac.yaml
|
||||
# for csi-driver-host-path v1.8.0
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-health-monitor/raw/v0.11.0/deploy/kubernetes/external-health-monitor-controller/rbac.yaml
|
||||
# for csi-driver-host-path release-1.13
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# This YAML file contains all RBAC objects that are necessary to run external
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-provisioner/raw/v3.1.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path v1.8.0
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-provisioner/raw/v4.0.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path release-1.13
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# This YAML file contains all RBAC objects that are necessary to run external
|
||||
@ -61,6 +61,13 @@ rules:
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["volumeattachments"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
# (Alpha) Access to referencegrants is only needed when the CSI driver
|
||||
# has the CrossNamespaceVolumeDataSource controller capability.
|
||||
# In that case, external-provisioner requires "get", "list", "watch"
|
||||
# permissions for "referencegrants" on "gateway.networking.k8s.io".
|
||||
#- apiGroups: ["gateway.networking.k8s.io"]
|
||||
# resources: ["referencegrants"]
|
||||
# verbs: ["get", "list", "watch"]
|
||||
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
@ -89,9 +96,6 @@ metadata:
|
||||
rules:
|
||||
# Only one of the following rules for endpoints or leases is required based on
|
||||
# what is set for `--leader-election-type`. Endpoints are deprecated in favor of Leases.
|
||||
- apiGroups: [""]
|
||||
resources: ["endpoints"]
|
||||
verbs: ["get", "watch", "list", "delete", "update", "create"]
|
||||
- apiGroups: ["coordination.k8s.io"]
|
||||
resources: ["leases"]
|
||||
verbs: ["get", "watch", "list", "delete", "update", "create"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-resizer/raw/v1.4.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path v1.8.0
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-resizer/raw/v1.10.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path release-1.13
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# This YAML file contains all RBAC objects that are necessary to run external
|
||||
@ -46,6 +46,10 @@ rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["events"]
|
||||
verbs: ["list", "watch", "create", "update", "patch"]
|
||||
# only required if enabling the alpha volume modify feature
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["volumeattributesclasses"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
@ -63,7 +67,7 @@ roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
---
|
||||
# Resizer must be able to work with end point in current namespace
|
||||
# Resizer must be able to work with `leases` in current namespace
|
||||
# if (and only if) leadership election is enabled
|
||||
kind: Role
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-snapshotter/raw/v5.0.1/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml
|
||||
# for csi-driver-host-path v1.8.0
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-snapshotter/raw/v7.0.1/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml
|
||||
# for csi-driver-host-path release-1.13
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# Together with the RBAC file for external-provisioner, this YAML file
|
||||
@ -12,6 +12,7 @@
|
||||
# - optionally rename the non-namespaced ClusterRole if there
|
||||
# are conflicts with other deployments
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
@ -37,13 +38,24 @@ rules:
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshotclasses"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshots"]
|
||||
verbs: ["get", "list", "watch", "update", "patch", "create"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshotcontents"]
|
||||
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
|
||||
verbs: ["get", "list", "watch", "update", "patch", "create"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshotcontents/status"]
|
||||
verbs: ["update", "patch"]
|
||||
|
||||
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
||||
resources: ["volumegroupsnapshotclasses"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
||||
resources: ["volumegroupsnapshotcontents"]
|
||||
verbs: ["get", "list", "watch", "update", "patch"]
|
||||
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
||||
resources: ["volumegroupsnapshotcontents/status"]
|
||||
verbs: ["update", "patch"]
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
|
2
vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/README.md
generated
vendored
2
vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/README.md
generated
vendored
@ -1,4 +1,4 @@
|
||||
The files in this directory are exact copies of "kubernetes-latest" in
|
||||
https://github.com/kubernetes-csi/csi-driver-host-path/tree/v1.8.0/deploy/
|
||||
https://github.com/kubernetes-csi/csi-driver-host-path/tree/release-1.13/deploy/
|
||||
|
||||
Do not edit manually. Run ./update-hostpath.sh to refresh the content.
|
||||
|
@ -15,3 +15,6 @@ spec:
|
||||
# To determine at runtime which mode a volume uses, pod info and its
|
||||
# "csi.storage.k8s.io/ephemeral" entry are needed.
|
||||
podInfoOnMount: true
|
||||
# Kubernetes may use fsGroup to change permissions and ownership
|
||||
# of the volume to match user requested fsGroup in the pod's SecurityPolicy
|
||||
fsGroupPolicy: File
|
||||
|
@ -1,4 +1,4 @@
|
||||
# All of the individual sidecar RBAC roles get bound
|
||||
# All of the individual sidecar RBAC roles get bound
|
||||
# to this account.
|
||||
kind: ServiceAccount
|
||||
apiVersion: v1
|
||||
@ -190,6 +190,7 @@ kind: StatefulSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: csi-hostpathplugin
|
||||
namespace: default
|
||||
labels:
|
||||
app.kubernetes.io/instance: hostpath.csi.k8s.io
|
||||
app.kubernetes.io/part-of: csi-driver-host-path
|
||||
@ -218,7 +219,7 @@ spec:
|
||||
serviceAccountName: csi-hostpathplugin-sa
|
||||
containers:
|
||||
- name: hostpath
|
||||
image: registry.k8s.io/sig-storage/hostpathplugin:v1.11.0
|
||||
image: registry.k8s.io/sig-storage/hostpathplugin:v1.13.0
|
||||
args:
|
||||
- "--drivername=hostpath.csi.k8s.io"
|
||||
- "--v=5"
|
||||
@ -261,7 +262,7 @@ spec:
|
||||
name: dev-dir
|
||||
|
||||
- name: csi-external-health-monitor-controller
|
||||
image: registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.7.0
|
||||
image: registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.11.0
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
@ -275,7 +276,7 @@ spec:
|
||||
mountPath: /csi
|
||||
|
||||
- name: node-driver-registrar
|
||||
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.5.1
|
||||
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
@ -303,13 +304,13 @@ spec:
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
image: registry.k8s.io/sig-storage/livenessprobe:v2.7.0
|
||||
image: registry.k8s.io/sig-storage/livenessprobe:v2.12.0
|
||||
args:
|
||||
- --csi-address=/csi/csi.sock
|
||||
- --health-port=9898
|
||||
|
||||
- name: csi-attacher
|
||||
image: registry.k8s.io/sig-storage/csi-attacher:v4.0.0
|
||||
image: registry.k8s.io/sig-storage/csi-attacher:v4.5.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
@ -323,11 +324,12 @@ spec:
|
||||
name: socket-dir
|
||||
|
||||
- name: csi-provisioner
|
||||
image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.0
|
||||
image: registry.k8s.io/sig-storage/csi-provisioner:v4.0.0
|
||||
args:
|
||||
- -v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
- --feature-gates=Topology=true
|
||||
# end csi-provisioner args
|
||||
securityContext:
|
||||
# This is necessary only for systems with SELinux, where
|
||||
# non-privileged sidecar containers cannot access unix domain socket
|
||||
@ -338,7 +340,7 @@ spec:
|
||||
name: socket-dir
|
||||
|
||||
- name: csi-resizer
|
||||
image: registry.k8s.io/sig-storage/csi-resizer:v1.6.0
|
||||
image: registry.k8s.io/sig-storage/csi-resizer:v1.10.0
|
||||
args:
|
||||
- -v=5
|
||||
- -csi-address=/csi/csi.sock
|
||||
@ -352,7 +354,7 @@ spec:
|
||||
name: socket-dir
|
||||
|
||||
- name: csi-snapshotter
|
||||
image: registry.k8s.io/sig-storage/csi-snapshotter:v6.1.0
|
||||
image: registry.k8s.io/sig-storage/csi-snapshotter:v7.0.1
|
||||
args:
|
||||
- -v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
|
@ -11,6 +11,7 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hostpath-service
|
||||
namespace: default
|
||||
labels:
|
||||
app.kubernetes.io/instance: hostpath.csi.k8s.io
|
||||
app.kubernetes.io/part-of: csi-driver-host-path
|
||||
@ -30,6 +31,7 @@ kind: StatefulSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: csi-hostpath-socat
|
||||
namespace: default
|
||||
labels:
|
||||
app.kubernetes.io/instance: hostpath.csi.k8s.io
|
||||
app.kubernetes.io/part-of: csi-driver-host-path
|
||||
@ -64,7 +66,9 @@ spec:
|
||||
topologyKey: kubernetes.io/hostname
|
||||
containers:
|
||||
- name: socat
|
||||
image: docker.io/alpine/socat:1.7.4.3-r0
|
||||
image: registry.k8s.io/sig-storage/hostpathplugin:v1.13.0
|
||||
command:
|
||||
- socat
|
||||
args:
|
||||
- tcp-listen:10000,fork,reuseaddr
|
||||
- unix-connect:/csi/csi.sock
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-attacher
|
||||
image: registry.k8s.io/sig-storage/csi-attacher:v4.0.0
|
||||
image: registry.k8s.io/sig-storage/csi-attacher:v4.5.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=$(ADDRESS)
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-resizer
|
||||
image: registry.k8s.io/sig-storage/csi-resizer:v1.6.0
|
||||
image: registry.k8s.io/sig-storage/csi-resizer:v1.10.0
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-snapshotter
|
||||
image: registry.k8s.io/sig-storage/csi-snapshotter:v6.1.0
|
||||
image: registry.k8s.io/sig-storage/csi-snapshotter:v7.0.1
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-provisioner
|
||||
image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.0
|
||||
image: registry.k8s.io/sig-storage/csi-provisioner:v4.0.0
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
# Topology support is needed for the pod rescheduling test
|
||||
@ -34,7 +34,7 @@ spec:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
- name: driver-registrar
|
||||
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.5.1
|
||||
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
@ -53,7 +53,7 @@ spec:
|
||||
- mountPath: /registration
|
||||
name: registration-dir
|
||||
- name: mock
|
||||
image: registry.k8s.io/sig-storage/hostpathplugin:v1.9.0
|
||||
image: registry.k8s.io/sig-storage/hostpathplugin:v1.13.0
|
||||
args:
|
||||
- "--drivername=mock.storage.k8s.io"
|
||||
- "--nodeid=$(KUBE_NODE_NAME)"
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-provisioner
|
||||
image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.0
|
||||
image: registry.k8s.io/sig-storage/csi-provisioner:v4.0.0
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
# Topology support is needed for the pod rescheduling test
|
||||
@ -35,7 +35,7 @@ spec:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
- name: driver-registrar
|
||||
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.5.1
|
||||
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
@ -53,7 +53,7 @@ spec:
|
||||
- mountPath: /registration
|
||||
name: registration-dir
|
||||
- name: mock
|
||||
image: registry.k8s.io/sig-storage/hostpathplugin:v1.9.0
|
||||
image: registry.k8s.io/sig-storage/hostpathplugin:v1.13.0
|
||||
args:
|
||||
- -v=5
|
||||
- -nodeid=$(KUBE_NODE_NAME)
|
||||
|
2
vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/update-hostpath.sh
generated
vendored
2
vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/update-hostpath.sh
generated
vendored
@ -137,5 +137,5 @@ done
|
||||
grep -r image: hostpath/hostpath/csi-hostpath-plugin.yaml | while read -r image; do
|
||||
version=$(echo "$image" | sed -e 's/.*:\(.*\)/\1/')
|
||||
image=$(echo "$image" | sed -e 's/.*image: \([^:]*\).*/\1/')
|
||||
sed -i -e "s;$image:.*;$image:$version;" mock/*.yaml
|
||||
sed -i '' -e "s;$image:.*;$image:$version;" mock/*.yaml
|
||||
done
|
||||
|
8
vendor/k8s.io/kubernetes/test/utils/deployment.go
generated
vendored
8
vendor/k8s.io/kubernetes/test/utils/deployment.go
generated
vendored
@ -105,7 +105,7 @@ func waitForDeploymentCompleteMaybeCheckRolling(c clientset.Interface, d *apps.D
|
||||
return false, nil
|
||||
})
|
||||
|
||||
if err == wait.ErrWaitTimeout {
|
||||
if wait.Interrupted(err) {
|
||||
err = fmt.Errorf("%s", reason)
|
||||
}
|
||||
if err != nil {
|
||||
@ -224,7 +224,7 @@ func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName
|
||||
}
|
||||
return true, nil
|
||||
})
|
||||
if err == wait.ErrWaitTimeout {
|
||||
if wait.Interrupted(err) {
|
||||
LogReplicaSetsOfDeployment(deployment, nil, newRS, logf)
|
||||
err = fmt.Errorf(reason)
|
||||
}
|
||||
@ -316,7 +316,7 @@ func UpdateDeploymentWithRetries(c clientset.Interface, namespace, name string,
|
||||
updateErr = err
|
||||
return false, nil
|
||||
})
|
||||
if pollErr == wait.ErrWaitTimeout {
|
||||
if wait.Interrupted(pollErr) {
|
||||
pollErr = fmt.Errorf("couldn't apply the provided updated to deployment %q: %v", name, updateErr)
|
||||
}
|
||||
return deployment, pollErr
|
||||
@ -375,7 +375,7 @@ func WaitForDeploymentWithCondition(c clientset.Interface, ns, deploymentName, r
|
||||
cond := deploymentutil.GetDeploymentCondition(deployment.Status, condType)
|
||||
return cond != nil && cond.Reason == reason, nil
|
||||
})
|
||||
if pollErr == wait.ErrWaitTimeout {
|
||||
if wait.Interrupted(pollErr) {
|
||||
pollErr = fmt.Errorf("deployment %q never updated with the desired condition and reason, latest deployment conditions: %+v", deployment.Name, deployment.Status.Conditions)
|
||||
_, allOldRSs, newRS, err := GetAllReplicaSets(deployment, c)
|
||||
if err == nil {
|
||||
|
15
vendor/k8s.io/kubernetes/test/utils/image/manifest.go
generated
vendored
15
vendor/k8s.io/kubernetes/test/utils/image/manifest.go
generated
vendored
@ -41,7 +41,6 @@ type RegistryList struct {
|
||||
GcRegistry string `yaml:"gcRegistry"`
|
||||
SigStorageRegistry string `yaml:"sigStorageRegistry"`
|
||||
PrivateRegistry string `yaml:"privateRegistry"`
|
||||
MicrosoftRegistry string `yaml:"microsoftRegistry"`
|
||||
DockerLibraryRegistry string `yaml:"dockerLibraryRegistry"`
|
||||
CloudProviderGcpRegistry string `yaml:"cloudProviderGcpRegistry"`
|
||||
}
|
||||
@ -138,7 +137,6 @@ var (
|
||||
GcRegistry: "registry.k8s.io",
|
||||
SigStorageRegistry: "registry.k8s.io/sig-storage",
|
||||
PrivateRegistry: "gcr.io/k8s-authenticated-test",
|
||||
MicrosoftRegistry: "mcr.microsoft.com",
|
||||
DockerLibraryRegistry: "docker.io/library",
|
||||
CloudProviderGcpRegistry: "registry.k8s.io/cloud-provider-gcp",
|
||||
}
|
||||
@ -226,8 +224,6 @@ const (
|
||||
VolumeISCSIServer
|
||||
// VolumeRBDServer image
|
||||
VolumeRBDServer
|
||||
// WindowsServer image
|
||||
WindowsServer
|
||||
)
|
||||
|
||||
func initImageConfigs(list RegistryList) (map[ImageID]Config, map[ImageID]Config) {
|
||||
@ -236,12 +232,12 @@ func initImageConfigs(list RegistryList) (map[ImageID]Config, map[ImageID]Config
|
||||
configs[AgnhostPrivate] = Config{list.PrivateRegistry, "agnhost", "2.6"}
|
||||
configs[AuthenticatedAlpine] = Config{list.GcAuthenticatedRegistry, "alpine", "3.7"}
|
||||
configs[AuthenticatedWindowsNanoServer] = Config{list.GcAuthenticatedRegistry, "windows-nanoserver", "v1"}
|
||||
configs[APIServer] = Config{list.PromoterE2eRegistry, "sample-apiserver", "1.17.7"}
|
||||
configs[APIServer] = Config{list.PromoterE2eRegistry, "sample-apiserver", "1.29.2"}
|
||||
configs[AppArmorLoader] = Config{list.PromoterE2eRegistry, "apparmor-loader", "1.4"}
|
||||
configs[BusyBox] = Config{list.PromoterE2eRegistry, "busybox", "1.36.1-1"}
|
||||
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.4.6"}
|
||||
configs[DistrolessIptables] = Config{list.BuildImageRegistry, "distroless-iptables", "v0.5.3"}
|
||||
configs[Etcd] = Config{list.GcEtcdRegistry, "etcd", "3.5.12-0"}
|
||||
configs[Httpd] = Config{list.PromoterE2eRegistry, "httpd", "2.4.38-4"}
|
||||
configs[HttpdNew] = Config{list.PromoterE2eRegistry, "httpd", "2.4.39-4"}
|
||||
@ -250,7 +246,7 @@ func initImageConfigs(list RegistryList) (map[ImageID]Config, map[ImageID]Config
|
||||
configs[JessieDnsutils] = Config{list.PromoterE2eRegistry, "jessie-dnsutils", "1.7"}
|
||||
configs[Kitten] = Config{list.PromoterE2eRegistry, "kitten", "1.7"}
|
||||
configs[Nautilus] = Config{list.PromoterE2eRegistry, "nautilus", "1.7"}
|
||||
configs[NFSProvisioner] = Config{list.SigStorageRegistry, "nfs-provisioner", "v3.0.1"}
|
||||
configs[NFSProvisioner] = Config{list.SigStorageRegistry, "nfs-provisioner", "v4.0.8"}
|
||||
configs[Nginx] = Config{list.PromoterE2eRegistry, "nginx", "1.14-4"}
|
||||
configs[NginxNew] = Config{list.PromoterE2eRegistry, "nginx", "1.15-4"}
|
||||
configs[NodePerfNpbEp] = Config{list.PromoterE2eRegistry, "node-perf/npb-ep", "1.2"}
|
||||
@ -267,10 +263,9 @@ func initImageConfigs(list RegistryList) (map[ImageID]Config, map[ImageID]Config
|
||||
configs[RegressionIssue74839] = Config{list.PromoterE2eRegistry, "regression-issue-74839", "1.2"}
|
||||
configs[ResourceConsumer] = Config{list.PromoterE2eRegistry, "resource-consumer", "1.13"}
|
||||
configs[SdDummyExporter] = Config{list.GcRegistry, "sd-dummy-exporter", "v0.2.0"}
|
||||
configs[VolumeNFSServer] = Config{list.PromoterE2eRegistry, "volume/nfs", "1.3"}
|
||||
configs[VolumeNFSServer] = Config{list.PromoterE2eRegistry, "volume/nfs", "1.4"}
|
||||
configs[VolumeISCSIServer] = Config{list.PromoterE2eRegistry, "volume/iscsi", "2.6"}
|
||||
configs[VolumeRBDServer] = Config{list.PromoterE2eRegistry, "volume/rbd", "1.0.6"}
|
||||
configs[WindowsServer] = Config{list.MicrosoftRegistry, "windows", "1809"}
|
||||
|
||||
// This adds more config entries. Those have no pre-defined ImageID number,
|
||||
// but will be used via ReplaceRegistryInImageURL when deploying
|
||||
@ -420,8 +415,6 @@ func replaceRegistryInImageURLWithList(imageURL string, reg RegistryList) (strin
|
||||
registryAndUser = reg.PrivateRegistry
|
||||
case initRegistry.InvalidRegistry:
|
||||
registryAndUser = reg.InvalidRegistry
|
||||
case initRegistry.MicrosoftRegistry:
|
||||
registryAndUser = reg.MicrosoftRegistry
|
||||
case initRegistry.PromoterE2eRegistry:
|
||||
registryAndUser = reg.PromoterE2eRegistry
|
||||
case initRegistry.BuildImageRegistry:
|
||||
|
4
vendor/k8s.io/kubernetes/test/utils/replicaset.go
generated
vendored
4
vendor/k8s.io/kubernetes/test/utils/replicaset.go
generated
vendored
@ -47,7 +47,7 @@ func UpdateReplicaSetWithRetries(c clientset.Interface, namespace, name string,
|
||||
updateErr = err
|
||||
return false, nil
|
||||
})
|
||||
if pollErr == wait.ErrWaitTimeout {
|
||||
if wait.Interrupted(pollErr) {
|
||||
pollErr = fmt.Errorf("couldn't apply the provided updated to replicaset %q: %v", name, updateErr)
|
||||
}
|
||||
return rs, pollErr
|
||||
@ -85,7 +85,7 @@ func UpdateReplicaSetStatusWithRetries(c clientset.Interface, namespace, name st
|
||||
updateErr = err
|
||||
return false, nil
|
||||
})
|
||||
if pollErr == wait.ErrWaitTimeout {
|
||||
if wait.Interrupted(pollErr) {
|
||||
pollErr = fmt.Errorf("couldn't apply the provided update to replicaset %q: %v", name, updateErr)
|
||||
}
|
||||
return rs, pollErr
|
||||
|
4
vendor/k8s.io/kubernetes/test/utils/runners.go
generated
vendored
4
vendor/k8s.io/kubernetes/test/utils/runners.go
generated
vendored
@ -134,6 +134,7 @@ type RCConfig struct {
|
||||
PriorityClassName string
|
||||
TerminationGracePeriodSeconds *int64
|
||||
Lifecycle *v1.Lifecycle
|
||||
SchedulerName string
|
||||
|
||||
// Env vars, set the same for every pod.
|
||||
Env map[string]string
|
||||
@ -615,7 +616,8 @@ func (config *RCConfig) create() error {
|
||||
Annotations: config.Annotations,
|
||||
},
|
||||
Spec: v1.PodSpec{
|
||||
Affinity: config.Affinity,
|
||||
SchedulerName: config.SchedulerName,
|
||||
Affinity: config.Affinity,
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: config.Name,
|
||||
|
Reference in New Issue
Block a user