Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] add linode token health check #296

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ficap-akamai
Copy link

Sometimes it happens that the LINODE API TOKEN used by ccm expires or is revoked. This can go unnoticed for long periods since the only mechanism in place is logging it when actual call to Linode API fails. This PR implements health checker component that periodically makes calls to authenticated linode api endpoint (/v4/profile) to determine validity of token being used. Upon detection of invalid token health checker sends a signal to shut down controllers. This results in ccm Pod CrashLoopBackOffing which is greatly visible and can be acted upon. Health checker is only started when the controller is elected the leader. This reduces number of calls done to Linode API if there are multiple replicas of ccm. Whole health checker functionality is behind --enable-token-health-checker flag to be explicitly enabled if needed rather than enabling it by default.

General:

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

Pull Request Guidelines:

  1. Does your submission pass tests?
  2. Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. Have you linked your PR to an open issue

@github-actions github-actions bot added the new-feature for new features in the changelog. label Jan 16, 2025
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 65.15152% with 23 lines in your changes missing coverage. Please review.

Project coverage is 70.85%. Comparing base (ec8a70a) to head (fffa2b0).

Files with missing lines Patch % Lines
cloud/linode/cloud.go 31.81% 14 Missing and 1 partial ⚠️
cloud/linode/health_check.go 80.00% 5 Missing and 2 partials ⚠️
cloud/linode/client/client.go 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #296      +/-   ##
==========================================
- Coverage   71.07%   70.85%   -0.23%     
==========================================
  Files          12       13       +1     
  Lines        2216     2278      +62     
==========================================
+ Hits         1575     1614      +39     
- Misses        490      510      +20     
- Partials      151      154       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant