From 66c65322a66d5cfc40bda85ef45b3841237985c2 Mon Sep 17 00:00:00 2001 From: Sam Stoelinga Date: Fri, 22 Jul 2022 06:40:25 -0700 Subject: [PATCH] Use psaapi.LatestVersion instead of parse --- migrator.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/migrator.go b/migrator.go index e19f759..0701f47 100644 --- a/migrator.go +++ b/migrator.go @@ -36,13 +36,9 @@ func init() { } func SuggestedPodSecurityStandard(pod *v1.Pod) (psaapi.Level, error) { - apiVersion, err := psaapi.ParseVersion("latest") - if err != nil { - return "", err - } for _, apiLevel := range []psaapi.Level{psaapi.LevelRestricted, psaapi.LevelBaseline} { result := policy.AggregateCheckResults(evaluator.EvaluatePod( - psaapi.LevelVersion{Level: apiLevel, Version: apiVersion}, &pod.ObjectMeta, &pod.Spec)) + psaapi.LevelVersion{Level: apiLevel, Version: psaapi.LatestVersion()}, &pod.ObjectMeta, &pod.Spec)) if result.Allowed { return apiLevel, nil