Skip to content

Commit

Permalink
Fix logging of pre-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
cguertin14 committed Apr 5, 2022
1 parent e596285 commit 4e0175b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifests/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ resources:
images:
# Needs to be updated on each new release
- name: quay.io/cguertin14/k3supdater
newTag: v1.0.5
newTag: v1.0.6
12 changes: 6 additions & 6 deletions pkg/updater/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@ func (c *ClientSet) getLatestK3sRelease(ctx context.Context, req getLatestK3sRel
// Find latest stable versions among all releases
latestStableVersions := make([]*github.RepositoryRelease, 0)
for _, r := range releases {
// Exclude release candidates since
// they're not stable versions
if strings.Contains(*r.Name, "rc") {
continue
}

// Exclude pre-releases, since they're
// not fully ready yet
if *r.Prerelease {
logger.Warnf("A new pre-release is available: %q\n", *r.Name)
continue
}

// Exclude release candidates since
// they're not stable versions
if strings.Contains(*r.Name, "rc") {
continue
}

// Keep only three releases.
if len(latestStableVersions) < 3 {
latestStableVersions = append(latestStableVersions, r)
Expand Down

0 comments on commit 4e0175b

Please sign in to comment.