Skip to content

Add token file watcher#979

Merged
sean-breen merged 90 commits intov3from
add-token-file-watcher
Mar 3, 2025
Merged

Add token file watcher#979
sean-breen merged 90 commits intov3from
add-token-file-watcher

Conversation

@sean-breen
Copy link
Contributor

Proposed changes

  • Add a new watcher service CredentialWatcherService which will initially monitor the file pointed to by tokenpath option in agent conf.
  • When a write is detected to any of the files being watched, this will trigger a restart of the gRPC connection to the control plane. It also resets the FIle and Command Service clients to use this new connection.
  • During the reset, the Agent may become unavailable for a moment while the gRPC connection is being re-initiated.
  • Once the health message is received, the dataplane status should return to being available.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

}
}

func (fp *FilePlugin) handleConnectionReset(ctx context.Context, msg *bus.Message) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above with the lock just wondering if when it is being reset the connection needs to be locked

@sean-breen sean-breen requested a review from aphralG February 21, 2025 10:58
@sean-breen sean-breen merged commit 4caf164 into v3 Mar 3, 2025
20 checks passed
@sean-breen sean-breen deleted the add-token-file-watcher branch March 3, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Pull requests for routine tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants