Skip to content

Commit

Permalink
CLOUDP-285690: Fix race condition between schema and events (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
josvazg authored Nov 20, 2024
1 parent 9d7ab67 commit e92c44b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/helper/e2e/k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/pem"
"errors"
"fmt"
"log"
"os"
"path/filepath"

Expand All @@ -26,12 +27,15 @@ import (
"github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/utils"
)

func CreateNewClient() (client.Client, error) {
cfg, err := k8scfg.GetConfig()
func init() {
err := akov2.AddToScheme(scheme.Scheme)
if err != nil {
return nil, err
log.Fatalf("failed to preload Kubernetes schemas: %v", err)
}
err = akov2.AddToScheme(scheme.Scheme)
}

func CreateNewClient() (client.Client, error) {
cfg, err := k8scfg.GetConfig()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit e92c44b

Please sign in to comment.