From 00658980e7ff7c1fa18c89f64c746f2b05adf79f Mon Sep 17 00:00:00 2001 From: irenarindos Date: Mon, 21 Oct 2024 14:50:06 -0400 Subject: [PATCH] chore(server): fix const ops --- internal/server/repository_controller.go | 2 +- internal/server/repository_nonce.go | 2 +- internal/server/repository_worker.go | 6 +++--- internal/server/worker_auth.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/server/repository_controller.go b/internal/server/repository_controller.go index 5e5ac77cba..4ecc229894 100644 --- a/internal/server/repository_controller.go +++ b/internal/server/repository_controller.go @@ -46,7 +46,7 @@ func (r *Repository) listControllersWithReader(ctx context.Context, reader db.Re } func (r *Repository) UpsertController(ctx context.Context, controller *store.Controller) (int, error) { - const op = "server.UpsertController" + const op = "server.(Repository).UpsertController" if controller == nil { return db.NoRowsAffected, errors.New(ctx, errors.InvalidParameter, op, "controller is nil") diff --git a/internal/server/repository_nonce.go b/internal/server/repository_nonce.go index c72fe659e4..90626f0e28 100644 --- a/internal/server/repository_nonce.go +++ b/internal/server/repository_nonce.go @@ -30,7 +30,7 @@ const ( // AddNonce adds a nonce func (r *Repository) AddNonce(ctx context.Context, nonce, purpose string, opt ...Option) error { - const op = "server.AddNonce" + const op = "server.(Repository).AddNonce" if nonce == "" { return errors.New(ctx, errors.InvalidParameter, op, "empty nonce") } diff --git a/internal/server/repository_worker.go b/internal/server/repository_worker.go index 576313fb6e..339ed77925 100644 --- a/internal/server/repository_worker.go +++ b/internal/server/repository_worker.go @@ -303,7 +303,7 @@ func ListWorkers(ctx context.Context, reader db.Reader, scopeIds []string, opt . // the only ones used. All others are ignored. // Workers are intentionally not oplogged. func (r *Repository) UpsertWorkerStatus(ctx context.Context, worker *Worker, opt ...Option) (*Worker, error) { - const op = "server.UpsertWorkerStatus" + const op = "server.(Repository).UpsertWorkerStatus" opts := GetOpts(opt...) switch { @@ -485,10 +485,10 @@ func setWorkerTags(ctx context.Context, w db.Writer, id string, ts TagSource, ta // via the old registration method or pki-kms) name updates will be disallowed. func (r *Repository) UpdateWorker(ctx context.Context, worker *Worker, version uint32, fieldMaskPaths []string, opt ...Option) (*Worker, int, error) { const ( + op = "server.(Repository).UpdateWorker" nameField = "name" descField = "description" ) - const op = "server.(Repository).UpdateWorker" switch { case worker == nil: return nil, db.NoRowsAffected, errors.New(ctx, errors.InvalidParameter, op, "worker is nil") @@ -597,7 +597,7 @@ func (r *Repository) UpdateWorker(ctx context.Context, worker *Worker, version u // WithCreateControllerLedActivationToken. The latter two are mutually // exclusive. func (r *Repository) CreateWorker(ctx context.Context, worker *Worker, opt ...Option) (*Worker, error) { - const op = "server.CreateWorker" + const op = "server.(Repository).CreateWorker" opts := GetOpts(opt...) diff --git a/internal/server/worker_auth.go b/internal/server/worker_auth.go index 08b91c3f4f..490986bb3f 100644 --- a/internal/server/worker_auth.go +++ b/internal/server/worker_auth.go @@ -215,7 +215,7 @@ func (w *WorkerCertBundle) clone() *WorkerCertBundle { // Validate is called before storing a WorkerCertBundle in the db func (w *WorkerCertBundle) ValidateNewWorkerCertBundle(ctx context.Context) error { - const op = "server.(WorkerAuth).validateNewWorkerCertBundle" + const op = "server.(WorkerCertBundle).validateNewWorkerCertBundle" if w.RootCertificatePublicKey == nil { return errors.New(ctx, errors.InvalidParameter, op, "missing CertificatePublicKey") }