mirror of
https://github.com/siderolabs/omni.git
synced 2025-08-06 09:37:01 +02:00
Some checks failed
default / default (push) Has been cancelled
default / e2e-backups (push) Has been cancelled
default / e2e-forced-removal (push) Has been cancelled
default / e2e-scaling (push) Has been cancelled
default / e2e-short (push) Has been cancelled
default / e2e-short-secureboot (push) Has been cancelled
default / e2e-templates (push) Has been cancelled
default / e2e-upgrades (push) Has been cancelled
default / e2e-workload-proxy (push) Has been cancelled
All test modules were moved under `integration` tag and are now in `internal/integration` folder: no more `cmd/integration-test` executable. New Kres version is able to build the same executable from the tests directory instead. All Omni related flags were renamed, for example `--endpoint` -> `--omni.endpoint`. 2 more functional changes: - Enabled `--test.failfast` for all test runs. - Removed finalizers, which were running if the test has failed. Both of these changes should make it easier to understand the test failure: Talos node logs won't be cluttered with the finalizer tearing down the cluster. Fixes: https://github.com/siderolabs/omni/issues/1171 Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
// Copyright (c) 2025 Sidero Labs, Inc.
|
|
//
|
|
// Use of this software is governed by the Business Source License
|
|
// included in the LICENSE file.
|
|
|
|
//go:build sidero.debug
|
|
|
|
package clientconfig
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/siderolabs/go-api-signature/pkg/client/auth"
|
|
"github.com/siderolabs/go-api-signature/pkg/pgp"
|
|
"google.golang.org/grpc/metadata"
|
|
|
|
grpcomni "github.com/siderolabs/omni/internal/backend/grpc"
|
|
)
|
|
|
|
func registerKey(ctx context.Context, cli *auth.Client, key *pgp.Key, email string, opts ...auth.RegisterPGPPublicKeyOption) error {
|
|
armoredPublicKey, err := key.ArmorPublic()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
_, err = cli.RegisterPGPPublicKey(ctx, email, []byte(armoredPublicKey), opts...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
debugCtx := metadata.AppendToOutgoingContext(ctx, grpcomni.DebugVerifiedEmailHeaderKey, email)
|
|
|
|
err = cli.ConfirmPublicKey(debugCtx, key.Fingerprint())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, 10*time.Second)
|
|
defer timeoutCtxCancel()
|
|
|
|
return cli.AwaitPublicKeyConfirmation(timeoutCtx, key.Fingerprint())
|
|
}
|