GetKernelVersion gets the kernel version
()
| 316 | |
| 317 | // GetKernelVersion gets the kernel version |
| 318 | func (d *Detector) GetKernelVersion() string { |
| 319 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 320 | defer cancel() |
| 321 | |
| 322 | info, err := host.InfoWithContext(ctx) |
| 323 | if err != nil { |
| 324 | d.logger.WithError(err).Warn("Failed to get kernel version") |
| 325 | return constants.ErrUnknownValue |
| 326 | } |
| 327 | |
| 328 | return info.KernelVersion |
| 329 | } |
| 330 | |
| 331 | // getSELinuxStatus gets SELinux status using file reading |
| 332 | func (d *Detector) getSELinuxStatus() string { |
no outgoing calls
no test coverage detected