Skip to content

Send create connection after disconnect from management plane#967

Merged
aphralG merged 11 commits intov3from
send-create-connection-after-disconnect
Jan 27, 2025
Merged

Send create connection after disconnect from management plane#967
aphralG merged 11 commits intov3from
send-create-connection-after-disconnect

Conversation

@aphralG
Copy link
Contributor

@aphralG aphralG commented Jan 22, 2025

Proposed changes

If the agent looses connection to the management plane try to reestablish the connection and send a create connection request.

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

@aphralG aphralG self-assigned this Jan 22, 2025
@aphralG aphralG requested a review from a team as a code owner January 22, 2025 09:56
@github-actions github-actions bot added the chore Pull requests for routine tasks label Jan 22, 2025
@sjberman
Copy link

Tested this out and verified that it works. Thank you!

@aphralG aphralG merged commit 92fff50 into v3 Jan 27, 2025
20 checks passed
@aphralG aphralG deleted the send-create-connection-after-disconnect branch January 27, 2025 12:43
sean-breen added a commit that referenced this pull request Mar 3, 2025
* support reading token from file via config

* remove empty file

* simplify token validation and add unit tests

* add unit tests for transport credentials funtions

* address PR feedback

* proto updates

* fix function name

* fix lint error: lll

* add missing PR feedback

* remove error log message

* fix unit test

* Fix apk test package naming (#961)

* modify alpine package name:
nginx-agent-3.0.0_1234 -> nginx-agent-3.0.0.1234

* protoc-gen update

* Update agent config defaults and format (#959)

* update config defaults and format

* Add config apply request queue (#949)

* add unit tests for transport credentials funtions

* fix test name

* fix error message

* fix lint error: lll

* modify error messages

* remove error logging and modify messages

* fall back to token field if error occurs when reading file

* fix bad merge

* restarting gRPC conn

* remove code from testing

* fix lint errors: whitespace, revive

* add new topic for handling Token file updates

* add CredentialWatcherService

* adding initial watcher for credential files

* trigger connection reset after credential update

* added ConnectionResetTopic and event processing

* Automatically add token-path to Credential watcher

* add function to check credential paths defined in agent config

* fix lint

* use tokenpath as config option, fixes problem with cli param parsing

* add CredentialWatcherService + tests

* fix lint errors

* updates to generated files

* Send create connection after disconnect from management plane (#967)

* correct yaml key in AuthConfig

* fix: flaky test (#968)

`TestConvertToStructs` was occasionally failing because it was expecting `range` over a `map` to be a consistent order, but per [spec]:

> The iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next.

Uses `ElementsMatch` so the test passes even when the order of elements is different.

[spec]: https://go.dev/ref/spec#RangeClause

* update tests

* update tests

* wait for create connection

* PR feedback

* fix race condition

* clean up

* clean up

* update grpc connection in command and file plugins

* move log message and fix file_plugin_test.go

* fix lint

* handle command and file service client updates after grpc reset

* update FakeCommandService

* add unit tests

* fix bad test

* formatting

* remove test

* increase timeout before checking connection after restart

* set isConnected to false when handling subscribe errors

* increase code coverage

* lint fix

* fieldalignment

* remove unused fake

* PR feedback

* update fake command service

* more PR feedback

* PR feedback: disable watcher during config apply

* don't pause credential watcher during config apply

* debug log messages

* Add mutex around updating client in the CommandService

* undo change to metric name

* update test

* lock watcher when replacing grpc connection

* add lock around subscibe client access

* fix lint error

* unlock watcher mutex in error case

* return with no blank line

* lint error ?

* handle rename cases

* remove unneccessary cases from switch

* rewrite switch as if

* handling kubernetes secret update case

* fix test

* save connection status when resetting file manager service

---------

Co-authored-by: aphralG <108004222+aphralG@users.noreply.github.com>
Co-authored-by: Donal Hurley <djhurley1990@gmail.com>
Co-authored-by: Ryan Davis <ry.davis@f5.com>
Co-authored-by: Aphral Griffin <a.griffin@f5.com>
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.

6 participants