mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-06 17:27:08 +00:00
Improve logging in selectBootstrapKubeConfigs function by replacing index with bootstrapKubeConfig in error and info messages for better clarity. (#896)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 2m34s
Post / coverage (push) Failing after 8m1s
Post / images (amd64) (push) Failing after 3m27s
Post / images (arm64) (push) Failing after 5m19s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 50s
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 2m34s
Post / coverage (push) Failing after 8m1s
Post / images (amd64) (push) Failing after 3m27s
Post / images (arm64) (push) Failing after 5m19s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 50s
Signed-off-by: xuezhaojun <zxue@redhat.com>
This commit is contained in:
@@ -28,16 +28,16 @@ func selectBootstrapKubeConfigs(ctx context.Context,
|
||||
for index, fp := range bootstrapKubeConfigFilePaths {
|
||||
equal, err := compareServerEndpoint(fp, hubKubeConfigFilePath)
|
||||
if err != nil {
|
||||
logger.Error(err, "failed to compare hub and bootstrap kubeconfigs", "index", index)
|
||||
logger.Error(err, "failed to compare hub and bootstrap kubeconfigs", "bootstrapKubeConfig", fp)
|
||||
continue
|
||||
}
|
||||
if equal {
|
||||
err := checkBootstrapKubeConfigValid(ctx, managedCluster, fp)
|
||||
if err != nil {
|
||||
logger.Error(err, "failed to check matched bootstrap kubeconfig", "index", index)
|
||||
logger.Error(err, "failed to check matched bootstrap kubeconfig", "bootstrapKubeConfig", fp)
|
||||
break
|
||||
}
|
||||
logger.Info("found matched bootstrap kubeconfig and it's valid, no need to reselect another one", "index", index)
|
||||
logger.Info("found matched bootstrap kubeconfig and it's valid, no need to reselect another one", "bootstrapKubeConfig", fp)
|
||||
return index, nil
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func selectBootstrapKubeConfigs(ctx context.Context,
|
||||
for index, fp := range bootstrapKubeConfigFilePaths {
|
||||
err := checkBootstrapKubeConfigValid(ctx, managedCluster, fp)
|
||||
if err != nil {
|
||||
logger.Error(err, "failed to check bootstrap kubeconfig", "index", index)
|
||||
logger.Error(err, "failed to check bootstrap kubeconfig", "bootstrapKubeConfig", fp)
|
||||
continue
|
||||
}
|
||||
return index, nil
|
||||
|
||||
Reference in New Issue
Block a user