Skip to content

Commit

Permalink
docs: fix kompat tools to support semantic versioning correctly (#5859)
Browse files Browse the repository at this point in the history
  • Loading branch information
erezzarum authored Mar 15, 2024
1 parent 62faff8 commit 354fdda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/kompat/pkg/kompat/kompat.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (k Kompat) Markdown(_ ...Options) string {
if c.MaxK8sVersion == "" || c.MinK8sVersion == c.MaxK8sVersion {
headers = append(headers, fmt.Sprintf("\\>= `%s`", c.MinK8sVersion))
} else {
headers = append(headers, fmt.Sprintf("`%s` - `%s`", c.MinK8sVersion, c.MaxK8sVersion))
headers = append(headers, fmt.Sprintf("\\>= `%s` \\<= `%s`", c.MinK8sVersion, c.MaxK8sVersion))
}
data = append(data, c.AppVersion)
}
Expand Down Expand Up @@ -368,7 +368,7 @@ func semverRange(semvers []string, allSemvers ...string) string {
return fmt.Sprintf("\\>= %s", strings.ReplaceAll(semvers[0], ".x", ""))
}
}
return fmt.Sprintf("%s - %s", semvers[0], semvers[len(semvers)-1])
return fmt.Sprintf("\\>= %s \\<= %s", strings.ReplaceAll(semvers[0], ".x", ""), strings.ReplaceAll(semvers[len(semvers)-1], ".x", ""))
}

func sortSemvers(semvers []string) {
Expand Down

0 comments on commit 354fdda

Please sign in to comment.