-
Notifications
You must be signed in to change notification settings - Fork 458
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
API Refactor: switch agent to use new server APIs #1789
Conversation
@@ -7,6 +7,8 @@ import ( | |||
"crypto/rand" | |||
"crypto/tls" | |||
"crypto/x509" | |||
"errors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is mostly a renamed version of experimental_test.go.
Bundles map[string]*common.Bundle | ||
} | ||
|
||
func (u *Update) String() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is not really used. The cache implementation already has rich logging of the changes to entries and such.
@@ -65,19 +63,20 @@ func (r *rotator) Run(ctx context.Context) error { | |||
|
|||
func (r *rotator) runRotation(ctx context.Context) error { | |||
for { | |||
if err := r.rotateSVID(ctx); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change causes the rotator to evaluate the SVID for rotation right when Run is executed instead of waiting for the initial period (1.5s). The resolved a flaky unit-test and shouldn't have any real impact on production behavior as far as I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @azdagron!
pkg/agent/client/client.go
Outdated
telemetry.RegistrationID: params[i].EntryId, | ||
telemetry.Status: r.Status.Code, | ||
telemetry.Error: r.Status.Message, | ||
}).Warn("Fails to mint X509 SVID") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
}).Warn("Fails to mint X509 SVID") | |
}).Warn("Failed to mint X509 SVID") |
This change updates the agent to use the new server APIs unconditionally and removes the experimental flag. It is a little larger than expected, mostly due to updates to unit-tests that had a strong coupling/dependency on the agent client, in particular the manager tests. I was going to go for a larger refactor but that would be mostly wasted effort since we have planned work that will shake everything up in these layers quite a bit when we implement the agent feature to do a "soft" restart when it needs to re-attest. Signed-off-by: Andrew Harding <andrew.harding@hpe.com>
Also cleaned up some of the types conversion functions now used in the tests. Signed-off-by: Andrew Harding <andrew.harding@hpe.com>
1ed3263
to
4990a73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
This change updates the agent to use the new server APIs unconditionally and removes the experimental flag.
It is a little larger than expected, mostly due to updates to unit-tests that had a strong coupling/dependency on the agent client, in particular the manager tests. I was going to go for a larger refactor but that would be mostly wasted effort since we have planned work that will shake everything up in these layers quite a bit when we implement the agent feature to do a "soft" restart when it needs to re-attest.