Skip to content

Commit 0f925c6

Browse files
committed
fix comments and error msg
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
1 parent 087e94a commit 0f925c6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

cmd/flux/cluster_info.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,18 @@ var bootstrapLabels = []string{
4040
type fluxClusterInfo struct {
4141
// bootstrapped indicates that Flux was installed using the `flux bootstrap` command.
4242
bootstrapped bool
43-
// managedBy is the name of the manager who installed Flux.
43+
// managedBy is the name of the tool being used to manage the installation of Flux.
4444
managedBy string
4545
// version is the Flux version number in semver format.
4646
version string
4747
}
4848

49-
// getFluxClusterInfo checks the GitRepository CRD for labels passed into the function. It returns the version of Flux
50-
// (from the app.kubernetes.io/version label), a boolean to indicate whether the CRD was found
51-
// with the required labels and an error if the CRD query failed.
49+
// getFluxClusterInfo returns information on the Flux installation running on the cluster.
50+
// If the information cannot be retrieved, the boolean return value will be false.
51+
// If an error occurred, the returned error will be non-nil.
52+
//
53+
// This function retrieves the GitRepository CRD from the cluster and checks it
54+
// for a set of labels used to determine the Flux version and how Flux was installed.
5255
func getFluxClusterInfo(ctx context.Context, c client.Client) (fluxClusterInfo, bool, error) {
5356
var info fluxClusterInfo
5457
crdMetadata := &metav1.PartialObjectMetadata{

cmd/flux/install.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func installCmdRun(cmd *cobra.Command, args []string) error {
190190

191191
info, installed, err := getFluxClusterInfo(ctx, kubeClient)
192192
if err != nil {
193-
return fmt.Errorf("error checking for exisiting flux installation: %w", err)
193+
return fmt.Errorf("cluster info unavailable: %w", err)
194194
}
195195

196196
if installed && info.bootstrapped {

0 commit comments

Comments
 (0)