Skip to content

Commit

Permalink
Merge pull request #1689 from vrothberg/fix-aa
Browse files Browse the repository at this point in the history
apparmor: fix parsing beta/alpha version
  • Loading branch information
openshift-ci[bot] authored Oct 6, 2023
2 parents 40732c4 + 5c81adc commit f2d1b14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/apparmor/apparmor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ func parseAAParserVersion(output string) (int, error) {
words := strings.Split(lines[0], " ")
version := words[len(words)-1]

// trim "-beta1" suffix from version="3.0.0-beta1" if exists
version = strings.SplitN(version, "-", 2)[0]
// also trim "~..." suffix used historically (https://gitlab.com/apparmor/apparmor/-/commit/bca67d3d27d219d11ce8c9cc70612bd637f88c10)
version = strings.SplitN(version, "~", 2)[0]

// split by major minor version
v := strings.Split(version, ".")
if len(v) == 0 || len(v) > 3 {
Expand Down

0 comments on commit f2d1b14

Please sign in to comment.