Skip to content

Commit

Permalink
Fix post-rebase test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwest committed Sep 27, 2023
1 parent 5173a37 commit ee61abf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend-shared/db/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func SetupForTestingDBGinkgo() error {
Expect(err).ToNot(HaveOccurred())
for idx := range apiCRToDatabaseMappings {
item := apiCRToDatabaseMappings[idx]
if strings.HasPrefix(item.APIResourceUID, "test-") || strings.HasPrefix(item.DBRelationKey, "test-") {
if strings.HasPrefix(item.APIResourceUID, "test-") || strings.HasPrefix(item.APIResourceName, "test-") || strings.HasPrefix(item.DBRelationKey, "test-") {
rowsAffected, err := dbq.DeleteAPICRToDatabaseMapping(ctx, &item)
Expect(err).ToNot(HaveOccurred())
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion backend/eventloop/db_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var _ = Describe("DB Clean-up Function Tests", func() {

ctx = context.Background()
log = logger.FromContext(ctx)
dbq, err = db.NewUnsafePostgresDBQueries(true, true)
dbq, err = db.NewUnsafePostgresDBQueries(false, true)
Expect(err).ToNot(HaveOccurred())

_, managedEnvironment, _, gitopsEngineInstance, _, err = db.CreateSampleData(dbq)
Expand Down
8 changes: 4 additions & 4 deletions backend/eventloop/workspace_resource_event_loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func handleResourceLoopRepositoryCredential(ctx context.Context, msg workspaceRe

req, ok := (msg.payload).(ctrl.Request)
if !ok {
return noRetry, fmt.Errorf("invalid payload in processWorkspaceResourceMessage")
return noRetry, fmt.Errorf("invalid RepositoryCredential payload in processWorkspaceResourceMessage")
}

// Retrieve the namespace that the repository credential is contained within
Expand All @@ -249,7 +249,7 @@ func handleResourceLoopRepositoryCredential(ctx context.Context, msg workspaceRe
// - If the GitOpsDeploymentRepositoryCredential does exist, but not in the DB, then create a RepositoryCredential DB entry
// - If the GitOpsDeploymentRepositoryCredential does exist, and also in the DB, then compare and change a RepositoryCredential DB entry
// Then, in all 3 cases, create an Operation to update the cluster-agent
_, err := sharedResourceLoop.ReconcileRepositoryCredential(ctx, msg.apiNamespaceClient, *namespace, req.Name, shared_resource_loop.DefaultK8sClientFactory{}, log)
_, err := sharedResourceLoop.ReconcileRepositoryCredential(ctx, msg.apiNamespaceClient, *namespace, req.Name, k8sClientFactory, log)

if err != nil {
return retry, fmt.Errorf("unable to reconcile repository credential. Error: %v", err)
Expand All @@ -262,7 +262,7 @@ func handleResourceLoopManagedEnvironment(ctx context.Context, msg workspaceReso

evlMessage, ok := (msg.payload).(eventlooptypes.EventLoopMessage)
if !ok {
return noRetry, fmt.Errorf("invalid payload in processWorkspaceResourceMessage")
return noRetry, fmt.Errorf("invalid ManagedEnvironment payload in processWorkspaceResourceMessage")
}

if evlMessage.Event == nil { // Sanity test the message
Expand All @@ -289,7 +289,7 @@ func handleResourceLoopManagedEnvironment(ctx context.Context, msg workspaceReso

// Ask the shared resource loop to ensure the managed environment is reconciled
_, err := sharedResourceLoop.ReconcileSharedManagedEnv(ctx, msg.apiNamespaceClient, *namespace, req.Name, req.Namespace,
false, shared_resource_loop.DefaultK8sClientFactory{}, log)
false, k8sClientFactory, log)

if err != nil {
return retry, fmt.Errorf("unable to reconcile shared managed env: %v", err)
Expand Down

0 comments on commit ee61abf

Please sign in to comment.