nfs: fix null pointer deref in generateSssdSidecarResources()
0a151e913results in a bug which causes null pointer dereference when Kerberos is not setup. This causes a failure in Unit test TestReconcileCephNFS_addSecurityConfigsToPod Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> (cherry picked from commit6cf4627ccd)
This commit is contained in:
1 parent
fe35e61aed
commit
22b4e5d7ea
1 file changed
+9
-8
@@ -164,15 +164,16 @@ func generateSssdSidecarResources(nfs *cephv1.CephNFS, sidecarCfg *cephv1.SSSDSi
|
||||
SubPath: "krb5.conf",
|
||||
}
|
||||
sssdMounts = append(sssdMounts, krb5ConfD, krbConfMount)
|
||||
}
|
||||
if nfs.Spec.Security.Kerberos.KeytabFile.VolumeSource != nil {
|
||||
volName := "krb5-keytab"
|
||||
keytabMount := v1.VolumeMount{
|
||||
Name: volName,
|
||||
MountPath: "/etc/krb5.keytab",
|
||||
SubPath: "krb5.keytab",
|
||||
|
||||
if nfs.Spec.Security.Kerberos.KeytabFile.VolumeSource != nil {
|
||||
volName := "krb5-keytab"
|
||||
keytabMount := v1.VolumeMount{
|
||||
Name: volName,
|
||||
MountPath: "/etc/krb5.keytab",
|
||||
SubPath: "krb5.keytab",
|
||||
}
|
||||
sssdMounts = append(sssdMounts, keytabMount)
|
||||
}
|
||||
sssdMounts = append(sssdMounts, keytabMount)
|
||||
}
|
||||
|
||||
// the init container is needed to copy the starting content from the /var/lib/sss/pipes
|
||||
|
||||
Reference in new issue
Block a user