-
Notifications
You must be signed in to change notification settings - Fork 25
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
Make spread encryption the default for v1 API create_db #590
Conversation
b36e4e0
to
2e71868
Compare
@@ -175,7 +175,7 @@ func (c *CreateDBReconciler) generatePostDBCreateSQL(ctx context.Context, initia | |||
// config parm in the create db call. | |||
if c.Vdb.Spec.EncryptSpreadComm != vapi.EncryptSpreadCommDisabled && ok && vinf.IsOlder(vapi.SetEncryptSpreadCommAsConfigVersion) { | |||
sb.WriteString(fmt.Sprintf(`alter database default set parameter EncryptSpreadComm = '%s'; | |||
`, c.Vdb.Spec.EncryptSpreadComm)) | |||
`, vapi.EncryptSpreadCommWithVertica)) |
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.
Why did you do this? What if a user wants to disable spread encryption(if that even makes sense)?
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.
The code here is for enabling spread encryption. The if statement above makes sure the user does not want to disable spread encryption. When encryptSpreadComm is an empty string, 'c.Vdb.Spec.EncryptSpreadComm' won't give the correct value to the ddl, but 'vapi.EncryptSpreadCommWithVertica' will.
v, ok := g.ConfigurationParams.Get("InitialDefaultSubclusterName") | ||
Expect(ok).Should(BeTrue()) | ||
Expect(v).Should(Equal(vdb.Spec.Subclusters[0].Name)) | ||
v, ok = g.ConfigurationParams.Get("EncryptSpreadComm") |
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.
I think you can create a new test function for spread encryption where you can directly call setEncryptSpreadCommConfigIfNecessary()
and have a few scenarios by changing EncryptSpreadComm
and vertica version.
@@ -36,3 +36,4 @@ spec: | |||
imagePullSecrets: [] | |||
volumes: [] | |||
volumeMounts: [] | |||
encryptSpreadComm: disabled |
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.
Why didn't you do the same for other e2e tests?
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.
I think encrypting spread channel will not affect other e2e tests. And since "enable" is the default behavior now, we can test the default behavior in other e2e tests.
It turns out the admintool e2e tests are using old Vertica version(12.0.3) that does not support spread channel encryption without a db restart. Do you think should we update the Vertica version for the admintool e2e tests or should I disable spread channel encryption for the admintool e2e tests?
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.
I suggest we update the broken e2e testcases to explicitly disable spread encryption.
pkg/controllers/vdb/config.go
Outdated
|
||
// getEncryptSpreadComm will return "vertica" if encryptSpreadComm is set to | ||
// an empty string, otherwise return the value of encryptSpreadComm | ||
func (g *ConfigParamsGenerator) getEncryptSpreadComm() string { |
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.
Can we move this to VeritcaDB? And rename it so that it's exported (i.e. GetEncryptSpreadComm
). There is a file (helpers.go) that has these kind of functions.
For v1 api, set 'vertica' as the default value of encryptSpreadComm: when encryptSpreadComm is set to an empty string or not set, the operator will also enable spread encryption when creating a database. Add another value "disabled" to encryptSpreadComm for the user to explicitly disable spread encryption.