Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change info to error #2201

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/vcluster/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ func RunRoot() {
// create a new command and execute
err = BuildRoot().ExecuteContext(ctx)
if err != nil {
klog.Fatal(err)
klog.FromContext(ctx).Error(err, "error")
os.Exit(1)
}
}

Expand Down
2 changes: 1 addition & 1 deletion hack/load-testing/tests/throughput/throughput.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestThroughput(ctx context.Context, kubeClient client.Client, namespace str

err = kubeClient.Create(ctx, &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
GenerateName: fmt.Sprintf("secret-test-" + random.String(10) + "-"),
GenerateName: "secret-test-" + random.String(10) + "-",
Namespace: namespace,
},
Data: map[string][]byte{
Expand Down
2 changes: 1 addition & 1 deletion pkg/setup/controller_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func initControllerContext(
return nil, errors.Wrap(err, "get virtual cluster version")
}
nodes.FakeNodesVersion = virtualClusterVersion.GitVersion
klog.Infof("Can connect to virtual cluster with version " + virtualClusterVersion.GitVersion)
klog.FromContext(ctx).Info("Can connect to virtual cluster", "version", virtualClusterVersion.GitVersion)

// create a new current namespace client
currentNamespaceClient, err := newCurrentNamespaceClient(ctx, localManager, vClusterOptions)
Expand Down
2 changes: 1 addition & 1 deletion pkg/syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (r *SyncController) excludePhysical(ctx *synccontext.SyncContext, pObj, vOb
if !excluderOk && vObj != nil {
msg := fmt.Sprintf("conflict: cannot sync virtual object %s/%s as unmanaged physical object %s/%s exists with desired name", vObj.GetNamespace(), vObj.GetName(), pObj.GetNamespace(), pObj.GetName())
r.vEventRecorder.Eventf(vObj, "Warning", "SyncError", msg)
return false, fmt.Errorf(msg)
return false, errors.New(msg)
}

return true, nil
Expand Down
Loading