Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit 3c65bf3

Browse files
author
Jakub Dzon
committed
Rename FinalizeRegistration to Register
Signed-off-by: Jakub Dzon <[email protected]>
1 parent 3016e50 commit 3c65bf3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

internal/edgeapi/backend/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ type EdgeDeviceBackend interface {
3535
// GetTargetNamespace returns the namespace the device should belong to. This method may return NotApproved error.
3636
GetTargetNamespace(ctx context.Context, name, namespace string, matchesCertificate bool) (string, error)
3737

38-
// FinalizeRegistration is called during device registration request handling, after mTLS certificate has
38+
// Register is called during device registration request handling, after mTLS certificate has
3939
// been correctly issued.
40-
// The responsibility of the method is to potentially record information that the device is finally registered and
40+
// The responsibility of the method is to record information that the device is finally registered and
4141
// what hardware configuration it has.
42-
FinalizeRegistration(ctx context.Context, name, namespace string, registrationInfo *models.RegistrationInfo) error
42+
Register(ctx context.Context, name, namespace string, registrationInfo *models.RegistrationInfo) error
4343

4444
// UpdateStatus records current state of the device sent in a heartbeat message
4545
// (i.e. workload status, events reported by the device, OS upgrade status).

internal/edgeapi/backend/k8s/backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (b *backend) GetTargetNamespace(ctx context.Context, name, identityNamespac
166166
return namespace, nil
167167
}
168168

169-
func (b *backend) FinalizeRegistration(ctx context.Context, name, namespace string, registrationInfo *models.RegistrationInfo) error {
169+
func (b *backend) Register(ctx context.Context, name, namespace string, registrationInfo *models.RegistrationInfo) error {
170170
logger := b.logger.With("DeviceID", name, "Namespace", namespace)
171171
dvc, err := b.repository.GetEdgeDevice(ctx, name, namespace)
172172
deviceCopy := dvc.DeepCopy()

internal/edgeapi/yggdrasil/yggdrasil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func (h *Handler) PostDataMessageForDevice(ctx context.Context, params yggdrasil
253253
content.Certificate = string(cert)
254254

255255
res.Content = content
256-
err = h.backend.FinalizeRegistration(ctx, deviceID, ns, &registrationInfo)
256+
err = h.backend.Register(ctx, deviceID, ns, &registrationInfo)
257257

258258
if err != nil {
259259
logger.Error(err, "cannot finalize device registration")

0 commit comments

Comments
 (0)