From cdbc9c084dc246cae1d04a9dd1a9d47e95b68196 Mon Sep 17 00:00:00 2001 From: Marco Dinis Date: Fri, 25 Oct 2024 11:12:04 +0100 Subject: [PATCH] fix typo --- api/proto/teleport/legacy/types/types.proto | 2 +- api/types/types.pb.go | 2 +- lib/auth/usertasks/usertasksv1/service.go | 3 +-- lib/srv/discovery/status.go | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/api/proto/teleport/legacy/types/types.proto b/api/proto/teleport/legacy/types/types.proto index 20d89be3b7dd0..1e5b3df6ff8d6 100644 --- a/api/proto/teleport/legacy/types/types.proto +++ b/api/proto/teleport/legacy/types/types.proto @@ -7624,7 +7624,7 @@ message IntegrationV1 { message IntegrationStatusV1 { // PendingUserTasksNotificationID contains the notification ID that indicates that this integration has unresolved user tasks. string PendingUserTasksNotificationID = 1 [(gogoproto.jsontag) = "pending_user_tasks_notification_id,omitempty"]; - // NeedsAttentionNotificationExpires contains the expiration date for the notification. + // PendingUserTasksNotificationExpires contains the expiration date for the notification. // Used to ensure new notifications' expiration is the greater between the current notification and the new one. google.protobuf.Timestamp PendingUserTasksNotificationExpires = 2 [ (gogoproto.stdtime) = true, diff --git a/api/types/types.pb.go b/api/types/types.pb.go index 53933f3733bb0..8e95100601117 100644 --- a/api/types/types.pb.go +++ b/api/types/types.pb.go @@ -20317,7 +20317,7 @@ var xxx_messageInfo_IntegrationV1 proto.InternalMessageInfo type IntegrationStatusV1 struct { // PendingUserTasksNotificationID contains the notification ID that indicates that this integration has unresolved user tasks. PendingUserTasksNotificationID string `protobuf:"bytes,1,opt,name=PendingUserTasksNotificationID,proto3" json:"pending_user_tasks_notification_id,omitempty"` - // NeedsAttentionNotificationExpires contains the expiration date for the notification. + // PendingUserTasksNotificationExpires contains the expiration date for the notification. // Used to ensure new notifications' expiration is the greater between the current notification and the new one. PendingUserTasksNotificationExpires *time.Time `protobuf:"bytes,2,opt,name=PendingUserTasksNotificationExpires,proto3,stdtime" json:"pending_user_tasks_notification_expires,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` diff --git a/lib/auth/usertasks/usertasksv1/service.go b/lib/auth/usertasks/usertasksv1/service.go index 94658aa24453d..a5c0aca198fa1 100644 --- a/lib/auth/usertasks/usertasksv1/service.go +++ b/lib/auth/usertasks/usertasksv1/service.go @@ -475,8 +475,7 @@ func (s *Service) notifyUserAboutPendingTask(ctx context.Context, ut *usertasksv return trace.Wrap(err) } integrationStatus := integration.GetStatus() - existingNotification := integrationStatus.PendingUserTasksNotificationID - if existingNotification != "" { + if integrationStatus.PendingUserTasksNotificationID != "" { if err := s.backend.DeleteGlobalNotification(ctx, integrationStatus.PendingUserTasksNotificationID); err != nil { // NotFound might be returned when the GlobalNotification already expired or was deleted. if !trace.IsNotFound(err) { diff --git a/lib/srv/discovery/status.go b/lib/srv/discovery/status.go index 2ed3724169aab..8697fcb3ce169 100644 --- a/lib/srv/discovery/status.go +++ b/lib/srv/discovery/status.go @@ -547,7 +547,7 @@ func (s *Server) acquireSemaphore(kind, semaphoreName string) (releaseFn func(), // acquireSemaphoreForIntegration tries to acquire a semaphore lock for the integration. // This allows the process to do two things: -// - merge the current UserTask with the one stored in the backend, so that no discover-ec2.instance is lost +// - merge the current UserTask with the one stored in the backend, so that no task items are lost // - ensure a single Notification (pending-user-task-integration) is created // The former could be achieved using the UserTask name as lock identifier. // However, for the latter, we would need a lock for the Integration.