Skip to content

Commit

Permalink
Fix OC version when no complete version status
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Jan 27, 2023
1 parent 8bb3064 commit 41fba62
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/kclient/oc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func (c *Client) GetOCVersion() (string, error) {
return "", err
}
if clusterVersion != nil {
if len(clusterVersion.Status.History) == 1 {
return clusterVersion.Status.History[0].Version, nil
}
for _, update := range clusterVersion.Status.History {
if update.State == configv1.CompletedUpdate {
// obtain the version from the last completed update
Expand Down

0 comments on commit 41fba62

Please sign in to comment.