mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
Update cephcsi secret created by rook
as we need to include the encryption secret key inside the secret created by the rook, This PR will add the key and value required for the encryption inside the secrets. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
c3cf6be6a7
commit
a1f5425b88
33
e2e/utils.go
33
e2e/utils.go
@ -425,6 +425,39 @@ func createRBDSecret(c kubernetes.Interface, f *framework.Framework) {
|
||||
sc.Namespace = cephCSINamespace
|
||||
_, err := c.CoreV1().Secrets(cephCSINamespace).Create(&sc)
|
||||
Expect(err).Should(BeNil())
|
||||
|
||||
err = updateSecretForEncryption(c)
|
||||
Expect(err).Should(BeNil())
|
||||
}
|
||||
|
||||
// updateSecretForEncryption is an hack to update the secrets created by rook to
|
||||
// include the encyption key
|
||||
// TODO in cephcsi we need to create own users in ceph cluster and use it for E2E
|
||||
func updateSecretForEncryption(c kubernetes.Interface) error {
|
||||
secrets, err := c.CoreV1().Secrets(rookNamespace).Get(rbdProvisionerSecretName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
secrets.Data["encryptionPassphrase"] = []byte("test_passphrase")
|
||||
|
||||
_, err = c.CoreV1().Secrets(rookNamespace).Update(secrets)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
secrets, err = c.CoreV1().Secrets(rookNamespace).Get(rbdNodePluginSecretName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
secrets.Data["encryptionPassphrase"] = []byte("test_passphrase")
|
||||
|
||||
_, err = c.CoreV1().Secrets(rookNamespace).Update(secrets)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func deleteResource(scPath string) {
|
||||
|
Loading…
Reference in New Issue
Block a user