Fix segmentation violation error in karmada-agent component

Signed-off-by: Joe Nathan Abellard <contact@jabellard.com>
This commit is contained in:
Joe Nathan Abellard 2025-03-19 22:03:18 -04:00
parent b939368e08
commit c0525e8715
1 changed files with 6 additions and 2 deletions

View File

@ -184,8 +184,12 @@ func run(ctx context.Context, opts *options.Options) error {
if err != nil {
return err
}
registerOption.Secret = *clusterSecret
registerOption.ImpersonatorSecret = *impersonatorSecret
if clusterSecret != nil {
registerOption.Secret = *clusterSecret
}
if impersonatorSecret != nil {
registerOption.ImpersonatorSecret = *impersonatorSecret
}
err = util.RegisterClusterInControllerPlane(registerOption, controlPlaneKubeClient, generateClusterInControllerPlane)
if err != nil {
return fmt.Errorf("failed to register with karmada control plane: %w", err)