Skip to content

Commit

Permalink
Merge pull request #29172 from vrutkovs/tls-collection-complete
Browse files Browse the repository at this point in the history
API-1689: tls registry: extend time for cert collection pod to start
  • Loading branch information
openshift-merge-bot[bot] authored Nov 19, 2024
2 parents 0163f3b + 943d92f commit 18dfac1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
23 changes: 22 additions & 1 deletion pkg/monitortests/network/disruptionpodnetwork/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ package disruptionpodnetwork
import (
"bytes"
"context"
"errors"
"fmt"
"github.com/sirupsen/logrus"
"io/ioutil"
"os"
"os/exec"
"strings"
"time"

"github.com/sirupsen/logrus"

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

return openshiftTestsImagePullSpec, nil
}

func GetOpenshiftTestsImagePullSpecWithRetries(ctx context.Context, adminRESTConfig *rest.Config, suggestedPayloadImage string, oc *exutil.CLI, retries int) (string, error) {
var errs []error

for i := 0; i < retries; i++ {
result, err := GetOpenshiftTestsImagePullSpec(ctx, adminRESTConfig, suggestedPayloadImage, oc)
if err == nil {
return result, nil
}
select {
case <-ctx.Done():
return "", ctx.Err()
case <-time.After(30 * time.Second):
}
errs = append(errs, err)
}
return "", errors.Join(errs...)
}
4 changes: 2 additions & 2 deletions test/extended/operators/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ var _ = g.Describe(fmt.Sprintf("[sig-arch][Late][Jira:%q]", "kube-apiserver"), g
inClusterPKIContent, err := gatherCertsFromPlatformNamespaces(ctx, kubeClient, masters, bootstrapHostname)
o.Expect(err).NotTo(o.HaveOccurred())

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

timeLimitedCtx, cancel := context.WithTimeout(ctx, time.Minute)
timeLimitedCtx, cancel := context.WithTimeout(ctx, 5*time.Minute)
defer cancel()

if _, watchErr := watchtools.UntilWithSync(timeLimitedCtx,
Expand Down

0 comments on commit 18dfac1

Please sign in to comment.