Skip to content

Commit

Permalink
Add GetClusterId function to cluster package
Browse files Browse the repository at this point in the history
  • Loading branch information
mcornea committed Jan 26, 2024
1 parent b86fdd3 commit 3c7465b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/internal/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,18 @@ func GetClusterVersion(apiClient *clients.Settings) (string, error) {

return clusterVersion.Object.Status.Desired.Version, nil
}

// GetClusterId can be used to get the Openshift version from the provided cluster.
func GetClusterId(apiClient *clients.Settings) (string, error) {

Check failure on line 93 in tests/internal/cluster/cluster.go

View workflow job for this annotation

GitHub Actions / build

var-naming: func GetClusterId should be GetClusterID (revive)
// Check if the client was even defined first
if apiClient == nil {
return "", fmt.Errorf("provided client was not defined")
}

clusterVersion, err := clusterversion.Pull(apiClient)
if err != nil {
return "", err
}

return string(clusterVersion.Object.Spec.ClusterID), nil
}

0 comments on commit 3c7465b

Please sign in to comment.