mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #41097 from kargakis/test-update
Automatic merge from submit-queue (batch tested with PRs 41103, 41042, 41097, 40946, 40770) test: enhance still failing test https://github.com/kubernetes/kubernetes/issues/39785 has stopped on gce-etcd3, gci-gce but not on gci-gke and kops https://k8s-testgrid.appspot.com/sq-blocking#gce-etcd3&include-filter-by-regex=%5EOverall%24%7C%5C%5Bk8s%5C.io%5C%5D%5C%20Deployment%5C%20lack%5C%20of%5C%20progress%5C%20should%5C%20be%5C%20reported%5C%20in%5C%20the%5C%20deployment%5C%20status
This commit is contained in:
commit
b57dc268d6
@ -1215,7 +1215,7 @@ func testFailedDeployment(f *framework.Framework) {
|
|||||||
replicas := int32(1)
|
replicas := int32(1)
|
||||||
|
|
||||||
// Create a nginx deployment.
|
// Create a nginx deployment.
|
||||||
deploymentName := "nginx"
|
deploymentName := "progress-check"
|
||||||
nonExistentImage := "nginx:not-there"
|
nonExistentImage := "nginx:not-there"
|
||||||
ten := int32(10)
|
ten := int32(10)
|
||||||
d := framework.NewDeployment(deploymentName, replicas, podLabels, nginxImageName, nonExistentImage, extensions.RecreateDeploymentStrategyType)
|
d := framework.NewDeployment(deploymentName, replicas, podLabels, nginxImageName, nonExistentImage, extensions.RecreateDeploymentStrategyType)
|
||||||
|
@ -3456,18 +3456,23 @@ func WaitForObservedDeployment(c clientset.Interface, ns, deploymentName string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func WaitForDeploymentWithCondition(c clientset.Interface, ns, deploymentName, reason string, condType extensions.DeploymentConditionType) error {
|
func WaitForDeploymentWithCondition(c clientset.Interface, ns, deploymentName, reason string, condType extensions.DeploymentConditionType) error {
|
||||||
var conditions []extensions.DeploymentCondition
|
var deployment *extensions.Deployment
|
||||||
pollErr := wait.PollImmediate(time.Second, 5*time.Minute, func() (bool, error) {
|
pollErr := wait.PollImmediate(time.Second, 5*time.Minute, func() (bool, error) {
|
||||||
deployment, err := c.Extensions().Deployments(ns).Get(deploymentName, metav1.GetOptions{})
|
d, err := c.Extensions().Deployments(ns).Get(deploymentName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
conditions = deployment.Status.Conditions
|
deployment = d
|
||||||
cond := deploymentutil.GetDeploymentCondition(deployment.Status, condType)
|
cond := deploymentutil.GetDeploymentCondition(deployment.Status, condType)
|
||||||
return cond != nil && cond.Reason == reason, nil
|
return cond != nil && cond.Reason == reason, nil
|
||||||
})
|
})
|
||||||
if pollErr == wait.ErrWaitTimeout {
|
if pollErr == wait.ErrWaitTimeout {
|
||||||
pollErr = fmt.Errorf("deployment %q never updated with the desired condition and reason: %v", deploymentName, conditions)
|
pollErr = fmt.Errorf("deployment %q never updated with the desired condition and reason: %v", deployment.Name, deployment.Status.Conditions)
|
||||||
|
_, allOldRSs, newRS, err := deploymentutil.GetAllReplicaSets(deployment, c)
|
||||||
|
if err == nil {
|
||||||
|
logReplicaSetsOfDeployment(deployment, allOldRSs, newRS)
|
||||||
|
}
|
||||||
|
logPodsOfDeployment(c, deployment)
|
||||||
}
|
}
|
||||||
return pollErr
|
return pollErr
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user