libpod: fix 'podman kube generate' on FreeBSD

This avoids dereferencing c.config.Spec.Linux if it is nil, which is the
case on FreeBSD.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson 2024-06-05 10:33:33 +01:00
parent b63767866e
commit ffc8522646
1 changed files with 1 additions and 1 deletions

View File

@ -1308,7 +1308,7 @@ func generateKubeSecurityContext(c *Container) (*v1.SecurityContext, bool, error
scHasData = true
sc.ReadOnlyRootFilesystem = &ro
}
if c.config.Spec.Linux.MaskedPaths == nil {
if c.config.Spec.Linux != nil && c.config.Spec.Linux.MaskedPaths == nil {
scHasData = true
unmask := v1.UnmaskedProcMount
sc.ProcMount = &unmask