Skip to content

Commit

Permalink
[#1008] Log ignored secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
brusdev authored and gtully committed Sep 13, 2024
1 parent fbfd56a commit f0f2a8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/activemqartemis_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,10 @@ var _ = Describe("artemis controller", func() {
Expect(matchErr).To(BeNil())
Expect(hasMatch).To(BeFalse())

hasMatch, matchErr = MatchCapturedLog("The secret " + secret.Name + " is ignored because its onwer references doesn't include ActiveMQArtemis/" + brokerCr.Name)
Expect(matchErr).To(BeNil())
Expect(hasMatch).To(BeTrue())

CleanResource(brokerCr, brokerCr.Name, defaultNamespace)
CleanResource(secret, secret.Name, defaultNamespace)
})
Expand Down
4 changes: 4 additions & 0 deletions controllers/activemqartemis_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,10 @@ func (reconciler *ActiveMQArtemisReconcilerImpl) sourceEnvVarFromSecret(customRe
}
}
}

if !desired {
log.V(1).Info("The secret " + secretName + " is ignored because its onwer references doesn't include ActiveMQArtemis/" + customResource.Name)
}
}

if desired {
Expand Down

0 comments on commit f0f2a8c

Please sign in to comment.