Skip to content

Commit

Permalink
fix reconciler unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes94 committed Aug 1, 2023
1 parent 4ad49c1 commit ee8b5ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions fleetshard/pkg/central/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ func (r *CentralReconciler) collectReconciliationStatus(ctx context.Context, rem
}
}

// Only store secrets if central was ready once to ensure we're not trying to get secrets before they are created
if isRemoteCentralReady(remoteCentral) {
secrets, err := r.collectSecretsEncrypted(ctx, remoteCentral)
if err != nil {
Expand Down
12 changes: 12 additions & 0 deletions fleetshard/pkg/central/reconciler/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,18 @@ func TestIgnoreCacheForCentralForceReconcileAlways(t *testing.T) {
},
},
centralDeploymentObject(),
&v1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: "central-tls",
Namespace: centralNamespace,
},
},
&v1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: "central-db-password",
Namespace: centralNamespace,
},
},
)

managedCentral := simpleManagedCentral
Expand Down

0 comments on commit ee8b5ae

Please sign in to comment.