-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix validation of references to CA certificate in TLS config #1119
Fix validation of references to CA certificate in TLS config #1119
Conversation
@@ -87,6 +87,15 @@ func newScramReplicaSet(users ...mdbv1.MongoDBUser) mdbv1.MongoDBCommunity { | |||
} | |||
|
|||
func newTestReplicaSetWithTLS() mdbv1.MongoDBCommunity { | |||
return newTestReplicaSetWithTLSCaCertificateReferences(&mdbv1.LocalObjectReference{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please help me understand what this change bring to the table? I'm not sure if it changes anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It allows us to create test fixtures, where the caller passes custom arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, understood. Thanks
}) | ||
t.Run("Failure if reference to CA cert is missing", func(t *testing.T) { | ||
mdb := newTestReplicaSetWithTLSCaCertificateReferences(nil, nil) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's quite a lot of code duplication within this test. Can I ask you to re-implement it to the parameters-driven test, like https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/test/e2e/replica_set_arbiter/replica_set_arbiter_test.go#L28 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sure. I initially started it as a table-driven test, but skimming through the codebase it didn't seem to me like a prevalent pattern.
…s-operator into adamliesko/stricter-tls-config-validations-#1114
Integrated, thanks @adamliesko |
Hey @adamliesko - I'm the PM for our MongoDB Kubernetes operators. Wondered if you or any of your colleagues would be up for a chat about how you're getting on running MongoDB in Kubernetes? |
Closes #1114 and #1054 on GH.
All Submissions:
The issue has existed beforehand.
Yes.
#1115 Exists, however, is incomplete and is mixing the TLS validations into an (at least in my opinion) undesired place of different validations. But maybe you/we would like to actually broaden the scope of validations, happy to hear your preferred choice.
closes #XXXX
in your comment to auto-close the issue that your PR fixes (if such).