Skip to content

Commit 18dfac1

Browse files
Merge pull request #29172 from vrutkovs/tls-collection-complete
API-1689: tls registry: extend time for cert collection pod to start
2 parents 0163f3b + 943d92f commit 18dfac1

File tree

2 files changed

+24
-3
lines changed
  • pkg/monitortests/network/disruptionpodnetwork
  • test/extended/operators

2 files changed

+24
-3
lines changed

pkg/monitortests/network/disruptionpodnetwork/utils.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ package disruptionpodnetwork
33
import (
44
"bytes"
55
"context"
6+
"errors"
67
"fmt"
7-
"github.com/sirupsen/logrus"
88
"io/ioutil"
99
"os"
1010
"os/exec"
1111
"strings"
12+
"time"
13+
14+
"github.com/sirupsen/logrus"
1215

1316
configclient "github.com/openshift/client-go/config/clientset/versioned"
1417
exutil "github.com/openshift/origin/test/extended/util"
@@ -136,3 +139,21 @@ func GetOpenshiftTestsImagePullSpec(ctx context.Context, adminRESTConfig *rest.C
136139

137140
return openshiftTestsImagePullSpec, nil
138141
}
142+
143+
func GetOpenshiftTestsImagePullSpecWithRetries(ctx context.Context, adminRESTConfig *rest.Config, suggestedPayloadImage string, oc *exutil.CLI, retries int) (string, error) {
144+
var errs []error
145+
146+
for i := 0; i < retries; i++ {
147+
result, err := GetOpenshiftTestsImagePullSpec(ctx, adminRESTConfig, suggestedPayloadImage, oc)
148+
if err == nil {
149+
return result, nil
150+
}
151+
select {
152+
case <-ctx.Done():
153+
return "", ctx.Err()
154+
case <-time.After(30 * time.Second):
155+
}
156+
errs = append(errs, err)
157+
}
158+
return "", errors.Join(errs...)
159+
}

test/extended/operators/certs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ var _ = g.Describe(fmt.Sprintf("[sig-arch][Late][Jira:%q]", "kube-apiserver"), g
117117
inClusterPKIContent, err := gatherCertsFromPlatformNamespaces(ctx, kubeClient, masters, bootstrapHostname)
118118
o.Expect(err).NotTo(o.HaveOccurred())
119119

120-
openshiftTestImagePullSpec, err := disruptionpodnetwork.GetOpenshiftTestsImagePullSpec(ctx, oc.AdminConfig(), "", oc)
120+
openshiftTestImagePullSpec, err := disruptionpodnetwork.GetOpenshiftTestsImagePullSpecWithRetries(ctx, oc.AdminConfig(), "", oc, 5)
121121
// Skip metal jobs if test image pullspec cannot be determined
122122
if jobType.Platform != "metal" || err == nil {
123123
o.Expect(err).NotTo(o.HaveOccurred())
@@ -385,7 +385,7 @@ func createPods(ctx context.Context, kubeClient kubernetes.Interface, namespace
385385
return podOnNode, fmt.Errorf("error creating pod on node %s: %v", node.Name, err)
386386
}
387387

388-
timeLimitedCtx, cancel := context.WithTimeout(ctx, time.Minute)
388+
timeLimitedCtx, cancel := context.WithTimeout(ctx, 5*time.Minute)
389389
defer cancel()
390390

391391
if _, watchErr := watchtools.UntilWithSync(timeLimitedCtx,

0 commit comments

Comments
 (0)